
codeforces
文章平均质量分 53
threeh20
暑假有半个月整个人像死了一样,所以更加明白生命的可贵
展开
-
codeforces 835 a Key races
A. Key racestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputTwo boys decided to compete in text typing on t原创 2017-08-02 20:36:49 · 299 阅读 · 0 评论 -
codeforces 884C Bertown Subway
http://codeforces.com/problemset/problem/884/C#include using namespace std;int con=0;long long int ans[111111]; bool vis[111111]; int ma[111111];void dfs(int x,int num原创 2017-10-29 17:24:08 · 474 阅读 · 0 评论 -
codeforces 876D Sorting the Coins
http://codeforces.com/problemset/problem/876/D#includeusing namespace std;int main(){ int a[333333]; bool b[333333]; int n; while(scanf("%d",&n)!=EOF) { memset(b,0,s原创 2017-10-21 11:02:14 · 268 阅读 · 0 评论 -
codeforces 876C Classroom Watch
http://codeforces.com/problemset/problem/876/C#includeusing namespace std;int main(){ int n; while(cin>>n) { int vis=0; int m=n; int a[11111]; if(n==2){ cout<<"1"原创 2017-10-21 11:01:17 · 348 阅读 · 0 评论 -
codeforces 876B Divisiblity of Differences
http://codeforces.com/problemset/problem/876/B#includeusing namespace std;int main(){ int n,k,m; while(cin>>n>>k>>m) { int nu[111111]; in原创 2017-10-21 11:00:42 · 238 阅读 · 0 评论 -
codeforces 876A Trip For Meal
http://codeforces.com/problemset/problem/876/A#includeusing namespace std;int main(){ int n; while(cin>>n) { int a,b,c; cin>>a>>b>>c; int s=min(min(a,b原创 2017-10-21 10:59:39 · 242 阅读 · 0 评论 -
codeforces 868C Qualification Rounds
http://codeforces.com/problemset/problem/868/C#includeusing namespace std;int main(){ int n,k; while(cin>>n>>k) { int tm[22]; int ts[22]; int i,j;原创 2017-10-06 03:04:06 · 210 阅读 · 0 评论 -
codeforces 868B Race Against Time
http://codeforces.com/problemset/problem/868/B#includeusing namespace std;int main(){ int h,m,s,t1,t2; while(cin>>h>>m>>s>>t1>>t2) { double ss=s*1.0*6;原创 2017-10-06 03:04:54 · 250 阅读 · 0 评论 -
codeforces 868A Bark to Unlock
http://codeforces.com/problemset/problem/868/A#includeusing namespace std;int main(){ char a[22]; char b[111]; while(cin>>a) { int n; cin>>n; int i,j; int f1=0,f2=0;原创 2017-10-06 03:05:54 · 239 阅读 · 0 评论 -
codeforces 884B Japanese Crosswords Strike Back
http://codeforces.com/problemset/problem/884/B#include using namespace std;int main(){ int n,t; while(cin>>n>>t) { long long int ans=0; long long in原创 2017-10-29 17:23:31 · 496 阅读 · 0 评论 -
CodeForces 332B Maximum Absurdity
http://codeforces.com/problemset/problem/332/B#includeusing namespace std;int a[222222];long long int b[222222];long long int c[222222];long long int w[22222原创 2017-10-29 17:20:23 · 317 阅读 · 0 评论 -
CodeForces 39F Pacifist frogs
http://codeforces.com/problemset/problem/39/F模拟具体看代码#include<iostream>#include<algorithm>#include<cstring>#include<iomanip>using namespace std;struct node{ int id; int ...原创 2018-05-04 10:21:35 · 230 阅读 · 0 评论 -
CodeForces 760C Pavel and barbecue
http://codeforces.com/problemset/problem/760/C#includeusing namespace std;int ans;int ans1;int ma[222222];bool vis[222222];void dfs(int x){ if(vis[ma[x]]==1){ a原创 2017-10-14 19:30:05 · 295 阅读 · 0 评论 -
CodeForces 760A Petr and a calendar
http://codeforces.com/problemset/problem/760/A#includeusing namespace std;int main(){ int n,m; int mo[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; while(cin>>n>>原创 2017-10-14 19:26:41 · 252 阅读 · 0 评论 -
Codeforces 711A Bus to Udayland
http://codeforces.com/problemset/problem/711/A#includeusing namespace std;int main(){ int n,m; while(cin>>n) { char a[1111][6]; int flag=1; for(int i=1;原创 2017-10-14 19:27:36 · 268 阅读 · 0 评论 -
CodeForces 711B Chris and Magic Square
http://codeforces.com/problemset/problem/711/B#includeusing namespace std; long long int a[555][555]; long long int b[555]; long long int c[555];int main(){原创 2017-10-14 19:28:25 · 265 阅读 · 0 评论 -
CodeForces 760B Frodo and pillows
http://codeforces.com/problemset/problem/760/B#includeusing namespace std; long long int a[555][555]; long long int b[555]; long long int c[555];int main(){ int n,m,k;原创 2017-10-14 19:29:29 · 468 阅读 · 0 评论 -
CodeForces 333A Secrets
http://codeforces.com/problemset/problem/333/A#includeusing namespace std;int main(){ long long int n; while(scanf("%I64d",&n)!=EOF) { long long int _3原创 2017-10-29 17:17:30 · 297 阅读 · 0 评论 -
CodeForces 332A Down the Hatch!
http://codeforces.com/problemset/problem/332/A#includeusing namespace std;int main(){ long long int n; while(scanf("%I64d",&n)!=EOF) { char a[2222]; cin>>a; int l=strlen(a原创 2017-10-29 17:18:26 · 409 阅读 · 0 评论 -
codeforces 864D - Make a Permutation!
http://codeforces.com/problemset/problem/864/D#includeusing namespace std;int num[222222];int vis[222222];int vs[222222];int ans[222222];int main(){ int n; whil原创 2017-09-29 21:47:07 · 362 阅读 · 0 评论 -
codeforces 864C - Bus
http://codeforces.com/problemset/problem/864/C#includeusing namespace std;int main(){ long long int a,b,f,k; while(cin>>a>>b>>f>>k) { bool dir=0; int bb=原创 2017-09-29 21:46:33 · 287 阅读 · 0 评论 -
codeforces 862A Mahmoud and Ehab and the MEX
http://codeforces.com/problemset/problem/862/A#include#includeusing namespace std;int main(){ int n,k; while(cin>>n>>k){ int a[1111]; int i,j; for(i=0;i<n;i++) cin>>原创 2017-09-20 17:56:08 · 249 阅读 · 0 评论 -
codeforces 837A Text Volume
A. Text Volumetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a text of single-space separate原创 2017-08-06 23:19:00 · 392 阅读 · 0 评论 -
codeforces 837B Flag of Berland
B. Flag of Berlandtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe flag of Berland is such rectangular f原创 2017-08-06 23:18:45 · 394 阅读 · 0 评论 -
codeforces 841B Godsend
http://codeforces.com/contest/841/problem/B一道奇偶博弈题,两个人轮流拿一串数列中的数字,第一个人能拿总和为奇数的数字,第二个人能拿总和为偶数的数字。如果对博弈很感兴趣的人一下就能发现,因为一个数只有减去(拿掉)奇数部分的时候,它本身的奇偶性才会发生变化,拿偶数则是不会发生变化的。那么第二个人想要赢就只有可能是先手的人第一步都走不下去的原创 2017-08-19 21:21:36 · 453 阅读 · 0 评论 -
codeforces 841A Generous Kefa
http://codeforces.com/contest/841/problem/A给一串包含小写字母的字符串,每个字符代表不同颜色的气球,再给出一个人数,问能否把气球发完并保证不存在一个人拿2个相同颜色的气球。只要保证数量最多的那种颜色的气球不超过人数即可。#include#includeusing namespace std;int main(){ int原创 2017-08-19 21:16:41 · 616 阅读 · 0 评论 -
codeforces 840A Leha and Function
http://codeforces.com/problemset/problem/840/A题目意思的算最小期望,给出2行数,第二行代表的是期望计算的概率,只不过是分子部分(可以这么看);然后计算第一行的数字乘以第二行数字的总和最小,将重新排序后的第一行数字输出。其实只要在输入的时候加入一个代表顺序的优先级变量来记录顺序就好了,然后就可以随心所欲的按要求对号入座了。原创 2017-08-19 21:13:17 · 449 阅读 · 0 评论 -
codeforces 835c Star sky
C. Star skytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Cartesian coordinate system is set in the s原创 2017-08-02 20:45:58 · 296 阅读 · 0 评论 -
codeforces 835b The number on the board
B. The number on the boardtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSome natural number was written原创 2017-08-02 20:40:31 · 370 阅读 · 0 评论 -
codeforces 847M Weather Tomorrow
http://codeforces.com/problemset/problem/847/M#include#include#includeusing namespace std;int main(){ int a[1111]; int n; while(scanf("%d",&n)!=EOF) { int i,j; for(i=原创 2017-09-20 17:57:51 · 846 阅读 · 0 评论 -
codeforces 861A k-rounding
http://codeforces.com/problemset/problem/858/A#include #include #include #include #include using namespace std;int main(){ long long int n,k; while(cin>>原创 2017-09-20 18:01:12 · 392 阅读 · 0 评论 -
codeforces 864B - Polycarp and Letters
http://codeforces.com/problemset/problem/864/B#includeusing namespace std;int main(){ int n; char a[1111]; while(cin>>n) { cin>>a; int za=0; int lette原创 2017-09-29 21:45:36 · 350 阅读 · 0 评论 -
codeforces 864A - Fair Game
http://codeforces.com/problemset/problem/864/A#includeusing namespace std;int main(){ int n; while(cin>>n) { int a[1111]; int i; for(i=1;i<=n;i++) ci原创 2017-09-29 21:43:57 · 340 阅读 · 0 评论 -
codeforces 855A - Tom Riddle's Diary
http://codeforces.com/problemset/problem/855/A#includeusing namespace std;int main(){ int n; while(cin>>n) { int a[1111]; int i; for(i=1;i<=n;i++) cin>>a原创 2017-09-29 21:41:48 · 644 阅读 · 0 评论 -
codeforces 863C 1-2-3
http://codeforces.com/problemset/problem/863/C#include#includeusing namespace std;long long int an1=0,an2=0;void did(long long int x,long long int y){ if(x==1) { if(原创 2017-09-23 13:41:14 · 582 阅读 · 0 评论 -
codeforces 863A Quasi-palindrome
http://codeforces.com/problemset/problem/863/A#include#include#include#includeusing namespace std;int main(){ char a[111]; while(cin>>a) { int l=strlen(a); in原创 2017-09-22 21:32:19 · 308 阅读 · 0 评论 -
codeforces 847G University Classes
http://codeforces.com/problemset/problem/847/G#include#include#includeusing namespace std;int main(){ char a[1111][8]; int n; while(scanf("%d",&n)!=EOF) { memset(a,0,si原创 2017-09-20 17:59:34 · 383 阅读 · 0 评论 -
codeforces 863B Kayaking
http://codeforces.com/problemset/problem/863/B#include#include#include#includeusing namespace std;int main(){ int a; while(cin>>a) { int i,j; int b[1111]; for(i=0;i<2*a原创 2017-09-22 21:30:59 · 964 阅读 · 0 评论 -
Codeforces Round #496 (Div. 3) ABCDE1
http://codeforces.com/contest/1005id:threeh20A数1出现的个数,水题B从尾部遍历记录后缀一样部分的长度C用map记录哪些数字出现过,并且出现了几次。然后对于每一个数字,用2^0-2^32这32个数字去减,看剩下的数字在map中存不存在。要注意如果剩下的数字和本来这个数字一样,那么map的值应该>1 才可以Ddp[i]记录前i个中能够分割出能被三整除...原创 2018-07-10 10:23:40 · 224 阅读 · 0 评论