![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
CF刷题集
风中追风111111
不断改错
展开
-
L1-002 打印沙漏 (20分)
注意:不用输出符号后面的空格AC代码:#include<iostream>using namespace std;int main(){ int n; int sum = 1; int i = 1; //该行的个数 int i2; int row = 1; //行数 char str; cin >> n; cin >> str; wh...原创 2020-01-13 23:53:08 · 1188 阅读 · 0 评论 -
HDU 2544(单源最短路问题Dijkstra算法)
最短路Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 112304 Accepted Submission(s): 48320Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-sh...原创 2019-11-24 11:46:54 · 100 阅读 · 0 评论 -
Jungle Roads(并查集和kruskal)
Jungle RoadsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12024 Accepted Submission(s): 8794Problem DescriptionThe Head Elder of the t...原创 2019-11-24 09:33:34 · 129 阅读 · 0 评论 -
Oil Deposits(深度优先搜索DFS)
Problem DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a ...原创 2019-11-24 09:28:54 · 198 阅读 · 0 评论 -
c++----map函数的应用
//数据的插入–第一种:用insert函数插入pair数据map<int,string>mapstudent; mapstudent.insert(pair<int,string>(0,"student_one")); mapstudent.insert(pair<int,string>(1,"student_two")); mapstudent.ins...原创 2019-05-19 23:42:24 · 499 阅读 · 0 评论 -
c++---string遇到空格读取结束问题
string类基本的输入函数有如下几个:1)istream& operator>>(istream&,string&);2)istream& getline(istream&,string&);3)istream& getline(istream&,string&,char);所以使用cin默认是读取一个词...原创 2019-05-19 23:43:47 · 9012 阅读 · 1 评论 -
A. Combination Lock
Scrooge McDuck keeps his most treasured savings in a home safe with a combination lock. Each time he wants to put there the treasures that he’s earned fair and square, he has to open the lock.The com...转载 2019-06-10 11:44:44 · 479 阅读 · 0 评论 -
codeforces -584A
#include<cstdio>#include<algorithm>using namespace std;int main(){ int n,t; while(scanf("%d%d",&n,&t)!=EOF) { if(t>=2&&t<10) { for(int i=0;i<n;i++) ...转载 2019-06-07 17:43:13 · 158 阅读 · 0 评论 -
cf---B. Nauuo and Chess
Nauuo is a girl who loves playing chess.One day she invented a game by herself which needs n chess pieces to play on a m×m chessboard. The rows and columns are numbered from 1 to m. We denote a cell ...转载 2019-06-10 11:45:35 · 317 阅读 · 0 评论 -
cf---A. Patrick and Shopping
Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long road between his h...原创 2019-06-17 10:37:19 · 102 阅读 · 0 评论 -
c++----memset用法
#include<iostream>//#include"string.h"using namespace std;int main(){ char str[10]; str[9] = 'w'; memset(str,97,9); for(int i=0;i<10;i++){ cout<<str[i]<&l...原创 2019-05-19 23:42:41 · 113 阅读 · 0 评论 -
cf-贪心算法--A - Ilya and a Colorful Walk
#include<bits/stdc++.h>using namespace std;int main(){ int n; int max=0; int temp=0; int j; int house[300000]; cin>>n; j=n-1; for(int i=0;i<n;i++) { cin>>house[i]; ...原创 2019-06-10 11:44:56 · 266 阅读 · 0 评论 -
cf刷题---贪心算法应用-B. Taxi
B. Taxitime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter the lessons n groups of schoolchildren went outside and decided to visit Polycar...原创 2019-06-10 11:45:04 · 329 阅读 · 0 评论 -
cf---A. Design Tutorial: Learn from Math
One way to create a task is to learn from math. You can generate some random math statement or modify some theorems to get something new and build a new task from that.For example, there is a stateme...原创 2019-06-10 11:43:56 · 266 阅读 · 0 评论 -
cf--A. Calculating Function 水题超时
For a positive integer n let’s define a function f:f(n) = - 1 + 2 - 3 + … + ( - 1)nnYour task is to calculate f(n) for a given integer n.InputThe single line contains the positive integer n (1 ≤ ...原创 2019-06-10 11:45:10 · 238 阅读 · 0 评论 -
cf-----A. Insomnia cure
A. Insomnia curetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output«One dragon. Two dragon. Three dragon», — the princess was counting. She had ...原创 2019-06-10 11:44:14 · 302 阅读 · 0 评论 -
c++-----vector开辟空间
#include<bits/stdc++.h>using namespace std;int main(){ int n=3; vector<int>c; for(int i=0;i<n;i++) { c.push_back(i); } for(int i=0;i<n;i++) { cout<<c[i]<&...原创 2019-06-23 18:09:05 · 2864 阅读 · 0 评论 -
刷题日记----136A - Presents
A. Presentstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Petya very much likes gifts. Recently he has received a new laptop as a New...原创 2019-06-10 11:44:27 · 319 阅读 · 0 评论 -
cf---A. Amusing Joke
So, the New Year holidays are over. Santa Claus and his colleagues can take a rest and have guests at last. When two “New Year and Christmas Men” meet, thear assistants cut out of cardboard the letter...原创 2019-06-10 11:43:48 · 405 阅读 · 0 评论 -
A. Chat room
A. Chat roomtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya has recently learned to type and log on to the Internet. He immediately ente...原创 2019-06-10 11:44:21 · 702 阅读 · 0 评论