11 2019 档案
Codeforces 432A
摘要:#include <stdio.h> #include <stdlib.h> int comp_inc(const void *first, const void *second) { return *(int *)first-*(int *)second; } int times[2048]; i 阅读全文
posted @ 2019-11-24 19:50 ComMario 阅读(137) 评论(0) 推荐(0)
Codeforces 427A
摘要:#include <stdio.h> int main() { int min=0; int num; int temp; int sum=0; scanf("%d", &num); while(num--) { scanf("%d", &temp); sum+=temp; if((sum<0)&& 阅读全文
posted @ 2019-11-24 19:41 ComMario 阅读(123) 评论(0) 推荐(0)
Codeforces 313A
摘要:#include <stdio.h> int main() { long long n; int a, b; scanf("%lld", &n); if(n>0) ; else { if((n>=(-10))&&(n<0)) n=0; else { a=(n%10)*(-1); b=((n/10)% 阅读全文
posted @ 2019-11-24 15:14 ComMario 阅读(137) 评论(0) 推荐(0)
Coding笔记
摘要:@在已知输入数据规模的前提下,定义数组的时,数组的大小一定要严格且略大于该规模! @C语言中qsort函数的用法。头文件:#include <stdlib.h>。 #include <stdio.h> #include <stdlib.h> int comp_inc(const void *firs 阅读全文
posted @ 2019-11-24 11:03 ComMario 阅读(202) 评论(0) 推荐(0)
Codeforces 758A
摘要:#include <stdio.h> int main() { int a[120]; int num; scanf("%d", &num); int i; int max=-1; for(i=0; i<num; ++i) { scanf("%d", &a[i]); if(a[i]>max) max 阅读全文
posted @ 2019-11-12 21:12 ComMario 阅读(147) 评论(0) 推荐(0)
Codeforces 732A
摘要:#include <stdio.h> #define min(x, y) (x<y?x:y) int main() { int a[10]={0, 10, 5, 10, 5, 2, 5, 10, 5, 10}; int k, r; scanf("%d %d", &k, &r); int temp=k 阅读全文
posted @ 2019-11-11 16:52 ComMario 阅读(177) 评论(0) 推荐(0)
Codeforces 750A
摘要:#include <stdio.h> int main() { int n, k; scanf("%d %d", &n, &k); int ans, i; int sum=0; for(i=0; i<=n; ++i) { sum+=i; if((5*sum)<=(240-k)) ans=i; els 阅读全文
posted @ 2019-11-11 16:43 ComMario 阅读(78) 评论(0) 推荐(0)
Codeforces 723A
摘要:#include <stdio.h> #define max(x, y, z) (x>y?x>z?x:z:y>z?y:z) #define min(x, y, z) (x<y?x<z?x:z:y<z?y:z) int main() { int a, b, c; scanf("%d %d %d", & 阅读全文
posted @ 2019-11-11 16:39 ComMario 阅读(101) 评论(0) 推荐(0)
Codeforces 155A
摘要:#include <stdio.h> int main() { int n; scanf("%d", &n); int temp; scanf("%d", &temp); int min=temp; int max=temp; int Count=0; while(--n) { scanf("%d" 阅读全文
posted @ 2019-11-11 16:34 ComMario 阅读(121) 评论(0) 推荐(0)
Codeforces 581A
摘要:#include <stdio.h> #include <math.h> int main() { int a, b; scanf("%d %d", &a, &b); int temp; if(a<b) { temp=a; a=b; b=temp; } printf("%d %d\n", b, (( 阅读全文
posted @ 2019-11-11 16:21 ComMario 阅读(85) 评论(0) 推荐(0)
Python笔记
摘要:首先Python与其他主流编程语言有两个直观的不同点:1、变量命名时不需要指出变量类型。2、每个语句的结尾不再需要';'。这个两地方在编程过程中确实能节省很多敲击次数,不过由于本人目前只写过长度为几十行代码,不知道在编写大型程序时,这种方式会有多大的优点或者存在哪些不便之处。 @要运行Python程 阅读全文
posted @ 2019-11-08 09:58 ComMario 阅读(128) 评论(0) 推荐(0)
Codeforces 785A
摘要:#include <stdio.h> int main() { char line[30]; int n; scanf("%d", &n); getchar(); int ans=0; while(n--) { scanf("%s", line); if(line[0]=='T') ans+=4; 阅读全文
posted @ 2019-11-07 12:15 ComMario 阅读(146) 评论(0) 推荐(0)
Codeforces 1243B1
摘要:#include <stdio.h> #include <string.h> # define MaxSize 10010 char line_0[MaxSize]; char line_1[MaxSize]; int main() { int k; int n; scanf("%d", &k); 阅读全文
posted @ 2019-11-07 11:56 ComMario 阅读(174) 评论(0) 推荐(0)
Codeforces 1243A
摘要:#include <stdio.h> #include <string.h> int num[1024]; int main() { int k; int n; int temp; scanf("%d", &k); while(k--) { memset(num, 0, sizeof(int)*10 阅读全文
posted @ 2019-11-07 11:55 ComMario 阅读(256) 评论(0) 推荐(0)
Codeforces 339B
摘要:#include <stdio.h> int main() { int n, m; long long Count=0; scanf("%d%d", &n, &m); int cur, pre=1; while(m--) { scanf("%d", &cur); if(cur>pre) Count+ 阅读全文
posted @ 2019-11-06 10:59 ComMario 阅读(144) 评论(0) 推荐(0)
Codeforces 141A
摘要:#include <stdio.h> #include <string.h> #include <stdbool.h> int main() { char line1[110]; char line2[110]; char line3[210]; scanf("%s", line1); scanf( 阅读全文
posted @ 2019-11-06 10:58 ComMario 阅读(149) 评论(0) 推荐(0)
Codeforces 472A
摘要:#include <stdio.h> #include <math.h> #include <stdbool.h> int IsPrime(int n) { if(n==1) return 1; if(n==2) return 1; if(n%2==0) return 0; int end=sqrt 阅读全文
posted @ 2019-11-06 10:57 ComMario 阅读(131) 评论(0) 推荐(0)
Codeforces 977A
摘要:#include <stdio.h> int main() { int n; int k; scanf("%d%d", &n, &k); while(k--) { if((n%10)!=0) --n; else n/=10; } printf("%d\n", n); return 0; } 阅读全文
posted @ 2019-11-06 10:56 ComMario 阅读(145) 评论(0) 推荐(0)
Codeforces 520A
摘要:#include <stdio.h> #include <string.h> #include <stdbool.h> int main() { int n; scanf("%d", &n); char line[120]; scanf("%s", line); int alp[30]; int C 阅读全文
posted @ 2019-11-06 10:56 ComMario 阅读(129) 评论(0) 推荐(0)
Codeforces 228A
摘要:#include <stdio.h> #include <stdlib.h> int comp_inc(const void *first, const void *second); int main() { int a[5]; int i; for(i=0; i<4; ++i) { scanf(" 阅读全文
posted @ 2019-11-06 10:55 ComMario 阅读(140) 评论(0) 推荐(0)
Codeforces 268A
摘要:#include <stdio.h> #define Maxsize 50 struct uniform { int h; int g; }; int main() { int n; scanf("%d", &n); struct uniform Set[Maxsize]; int i; for(i 阅读全文
posted @ 2019-11-06 10:54 ComMario 阅读(103) 评论(0) 推荐(0)
Codeforces 200B
摘要:#include <stdio.h> int main() { int n; double num; scanf("%d", &n); int i; double sum=0.0; for(i=0; i<n; ++i) { scanf("%lf", &num); sum+=num; } printf 阅读全文
posted @ 2019-11-06 10:54 ComMario 阅读(107) 评论(0) 推荐(0)
Codeforces 443A
摘要:#include <stdio.h> #include <string.h> #define Maxsize 3200 int main() { int letter[30]; memset(letter, 0, sizeof(letter)); char line[Maxsize]; gets(l 阅读全文
posted @ 2019-11-06 10:53 ComMario 阅读(106) 评论(0) 推荐(0)
Codeforces 25A
摘要:#include <stdio.h> int main() { int n; int temp; int Count1=0, Count2=0; int Index1, Index2; scanf("%d", &n); int i; for(i=0; i<n; ++i) { scanf("%d", 阅读全文
posted @ 2019-11-06 10:52 ComMario 阅读(121) 评论(0) 推荐(0)
Codeforces 705A
摘要:#include <stdio.h> int main() { int n; scanf("%d", &n); int i; for(i=1; i<=n; ++i) { if(i!=1) printf(" that "); if(i%2!=0) printf("I hate"); else prin 阅读全文
posted @ 2019-11-06 10:51 ComMario 阅读(93) 评论(0) 推荐(0)
Codeforces 451A
摘要:#include <stdio.h> int main() { int n, m; int Count=0; scanf("%d%d", &n, &m); while((n>0)&&(m>0)) { --n; --m; ++Count; } if(Count%2==0) printf("Malvik 阅读全文
posted @ 2019-11-06 10:50 ComMario 阅读(95) 评论(0) 推荐(0)
Codeforces 144A
摘要:#include <stdio.h> int main() { int max=-1, min=1000; int max_ind=0, min_ind=0; int n; int line; scanf("%d", &n); int i; for(i=0; i<n; ++i) { scanf("% 阅读全文
posted @ 2019-11-06 10:49 ComMario 阅读(95) 评论(0) 推荐(0)
Codeforces 469A
摘要:#include <stdio.h> #include <string.h> #include <stdlib.h> #define Maxsize 110 int comp_inc(const void *first, const void *second); int main() { int L 阅读全文
posted @ 2019-11-06 10:47 ComMario 阅读(135) 评论(0) 推荐(0)
Codeforces 791A
摘要:#include <stdio.h> int main() { int a, b; int Count=0; scanf("%d%d", &a, &b); while(a<=b) { ++Count; a*=3; b*=2; } printf("%d\n", Count); return 0; } 阅读全文
posted @ 2019-11-06 10:46 ComMario 阅读(89) 评论(0) 推荐(0)
Codeforces 61A
摘要:#include <stdio.h> #include <string.h> #define Maxsize 110 int main() { char line1[Maxsize]; char line2[Maxsize]; scanf("%s", line1); scanf("%s", line 阅读全文
posted @ 2019-11-06 10:45 ComMario 阅读(122) 评论(0) 推荐(0)
Codeforces 405A
摘要:#include <stdio.h> #include <stdlib.h> #define Maxsize 110 int comp_inc(const void *first, const void *second); int columns[Maxsize]; int main() { int 阅读全文
posted @ 2019-11-06 10:45 ComMario 阅读(104) 评论(0) 推荐(0)
Codeforces 677A
摘要:#include <stdio.h> int main() { int n, h; scanf("%d%d", &n, &h); int temp, width=0; int i; for(i=0; i<n; ++i) { scanf("%d", &temp); if(temp<=h) ++widt 阅读全文
posted @ 2019-11-06 10:44 ComMario 阅读(117) 评论(0) 推荐(0)
Codeforces 344A
摘要:#include <stdio.h> int main() { int a, b; int n; scanf("%d", &n); scanf("%d", &a); int Count=1; int i; for(i=0; i<n-1; ++i) { scanf("%d", &b); if((a%1 阅读全文
posted @ 2019-11-06 10:42 ComMario 阅读(153) 评论(0) 推荐(0)
Codeforces 318A
摘要:#include <stdio.h> int main() { long long n, k; scanf("%I64d%I64d", &n, &k); long long even; if(n%2==0) even=n/2; else even=(n/2)+1; if(k<=even) print 阅读全文
posted @ 2019-11-06 10:41 ComMario 阅读(117) 评论(0) 推荐(0)
Codeforces 208A
摘要:#include <stdio.h> #include <string.h> #include <stdbool.h> #define Maxsize 210 int main() { char sentence[Maxsize]; char wub[4]={'W', 'U', 'B'}; scan 阅读全文
posted @ 2019-11-06 10:41 ComMario 阅读(94) 评论(0) 推荐(0)
Codeforces 148A
摘要:#include <stdio.h> #include <string.h> int main() { int a[5]; int total; memset(a, 0, sizeof(a)); int i; for(i=1; i<=4; ++i) { scanf("%d", &a[i]); } s 阅读全文
posted @ 2019-11-06 10:40 ComMario 阅读(127) 评论(0) 推荐(0)
Codeforces 546A
摘要:#include <stdio.h> int main() { int k, n , w; scanf("%d%d%d", &k, &n, &w); int ans=(k*((w*(w+1))/2))-n; if(ans>0) printf("%d\n", ans); else printf("%d 阅读全文
posted @ 2019-11-06 10:39 ComMario 阅读(80) 评论(0) 推荐(0)
Codeforces 486A
摘要:#include <stdio.h> int main() { long long ans; long long n; scanf("%I64d", &n); long long i; if(n%2==0) ans=((n/2)*((n/2)+1))-((n/2)*(n/2)); else ans= 阅读全文
posted @ 2019-11-06 10:39 ComMario 阅读(99) 评论(0) 推荐(0)
Codeforces 59A
摘要:#include <stdio.h> #include <string.h> #define MAXSIZE 120 int main() { int cntlow=0; int cntupp=0; char str[MAXSIZE]; memset(str, 0, sizeof(str)); sc 阅读全文
posted @ 2019-11-06 10:37 ComMario 阅读(133) 评论(0) 推荐(0)
Codeforces 136A
摘要:#include <stdio.h> #include <string.h> #define MAXSIZE 110 int main() { int giv[MAXSIZE]; int rec[MAXSIZE]; memset(giv, 0, sizeof(giv)); memset(rec, 0 阅读全文
posted @ 2019-11-06 10:37 ComMario 阅读(138) 评论(0) 推荐(0)
Codeforces 337A
摘要:#include <stdio.h> #include <stdlib.h> #define MAXSIZE 60 int comp_inc(const void *first, const void *second); int main() { int pieces[MAXSIZE]; int n 阅读全文
posted @ 2019-11-06 10:36 ComMario 阅读(108) 评论(0) 推荐(0)
Codeforces 617A
摘要:#include <stdio.h> int main() { int moves[5]={1,2,3,4,5}; int x; scanf("%d", &x); int ind=4; int Minsteps=0; while((x!=0)&&(ind>=0)) { if(x>=moves[ind 阅读全文
posted @ 2019-11-06 10:35 ComMario 阅读(122) 评论(0) 推荐(0)
Codeforces 580A
摘要:#include <stdio.h> #include <string.h> #define MAXSIZE 100024//之前数据少开了一个量级 int money[MAXSIZE]; int main() { memset(money, 0, sizeof(money)); int a; sc 阅读全文
posted @ 2019-11-06 10:34 ComMario 阅读(148) 评论(0) 推荐(0)
Codeforces 271A
摘要:#include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> int comp(const void *a, const void *b); int main () { int year; int a[ 阅读全文
posted @ 2019-11-06 10:33 ComMario 阅读(223) 评论(0) 推荐(0)
Codeforces 41A
摘要:#include <stdio.h> #include <string.h> #define MAXSIZE 105 int main() { char Berlandish[MAXSIZE]; char Birlandish[MAXSIZE]; scanf("%s", Berlandish); s 阅读全文
posted @ 2019-11-06 10:32 ComMario 阅读(90) 评论(0) 推荐(0)
Codeforces 266B
摘要:#include <stdio.h> #define MAXSIZE 1024 char que[MAXSIZE]; int main() { int n, t; scanf("%d %d", &n, &t); scanf("%s", que); int i, j; char temp; for(j 阅读全文
posted @ 2019-11-06 10:31 ComMario 阅读(152) 评论(0) 推荐(0)
Codeforces 110A
摘要:#include <stdio.h> #include<string.h> #define MAXSIZE 30 int main() { char digits[30]; memset(digits, 0, sizeof(digits)); scanf("%s", digits); int len 阅读全文
posted @ 2019-11-06 10:31 ComMario 阅读(120) 评论(0) 推荐(0)
Codeforces 131A
摘要:#include <stdio.h> #include <string.h> #include <stdbool.h> #define MAXSIZE 105 int main() { char str[MAXSIZE]; scanf("%s", str); int length=strlen(st 阅读全文
posted @ 2019-11-06 10:29 ComMario 阅读(160) 评论(0) 推荐(0)
Codeforces 467A
摘要:#include <stdio.h> int main() { int n; int p, q; int rooms=0; scanf("%d", &n); int i; for(i=0; i<n; ++i) { scanf("%d %d", &p, &q); if((q-p)>=2) ++room 阅读全文
posted @ 2019-11-06 10:29 ComMario 阅读(113) 评论(0) 推荐(0)
Codeforces 133A
摘要:#include <stdio.h> #include<string.h> #include <stdbool.h> #define MAXSIZE 105 int main() { char str[MAXSIZE]; scanf("%s", str); int length=strlen(str 阅读全文
posted @ 2019-11-06 10:27 ComMario 阅读(106) 评论(0) 推荐(0)
Codeforces 160A
摘要:#include <stdio.h> int main() { int n; int sum1=0, sum2=0, sum3=0; int x, y, z; scanf("%d", &n); int i; for(i=0; i<n; ++i) { scanf("%d %d %d", &x, &y, 阅读全文
posted @ 2019-11-06 10:27 ComMario 阅读(147) 评论(0) 推荐(0)
Codeforces 69A
摘要:#include <stdio.h> int main() { int n; int sum1=0, sum2=0, sum3=0; int x, y, z; scanf("%d", &n); int i; for(i=0; i<n; ++i) { scanf("%d %d %d", &x, &y, 阅读全文
posted @ 2019-11-06 10:26 ComMario 阅读(172) 评论(0) 推荐(0)
Codeforces 122A
摘要:#include <stdio.h> int main() { int dig; int flag=0; scanf("%d", &dig); if(dig%4==0) flag=1; else if(dig%7==0) flag=1; else if(dig%44==0) flag=1; else 阅读全文
posted @ 2019-11-06 10:25 ComMario 阅读(131) 评论(0) 推荐(0)
Codeforces 58A
摘要:#include <stdio.h> #include <string.h> int main() { char hel[6]="hello"; char str[120]; memset(str, 0, sizeof(str)); scanf("%s", str); int length=strl 阅读全文
posted @ 2019-11-06 10:24 ComMario 阅读(127) 评论(0) 推荐(0)
Codeforces 236A
摘要:#include <stdio.h> #include <string.h> int main() { char str[150]; int arr[35]; memset(str, 0, sizeof(str)); memset(arr, 0, sizeof(str)); scanf("%s", 阅读全文
posted @ 2019-11-06 10:23 ComMario 阅读(117) 评论(0) 推荐(0)
Codeforces 116A
摘要:#include <stdio.h> int main() { int n; int a1,a2; int min=0; int cap=0; scanf("%d",&n); while(n>0) { scanf("%d %d",&a1,&a2); cap-=a1; cap+=a2; if(min< 阅读全文
posted @ 2019-11-06 10:22 ComMario 阅读(163) 评论(0) 推荐(0)
Codeforces 266A
摘要:#include <iostream> #include <string> using namespace std; int main() { string stones; int n,count; while(cin>>n>>stones) { count=0; for(int i=0; i<st 阅读全文
posted @ 2019-11-06 10:21 ComMario 阅读(125) 评论(0) 推荐(0)
Codeforces 158A
摘要:#include <iostream> #include <algorithm> using namespace std; int main() { int groups[100009], num[5]; int n, sum; while(cin>>n) { sum=num[1]=num[2]=n 阅读全文
posted @ 2019-11-06 10:21 ComMario 阅读(170) 评论(0) 推荐(0)
263A
摘要:#include<stdio.h> #include<stdlib.h> int main() { int i, j; int temp; int t_i, t_j; int ans; for(i=1; i<=5; ++i) for(j=1; j<=5; ++j) { scanf("%d",&tem 阅读全文
posted @ 2019-11-06 10:20 ComMario 阅读(105) 评论(0) 推荐(0)
Codeforces 281A
摘要:#include <iostream> #include <string> #include <cctype> using namespace std; int main() { string word; cin>>word; word[0]=toupper(word[0]); cout<<word 阅读全文
posted @ 2019-11-06 10:19 ComMario 阅读(83) 评论(0) 推荐(0)
Codeforces 339A
摘要:#include <iostream> #include <string> #include <algorithm> using namespace std; #define maxSize 105 int main() { string exp; int digit[maxSize]; int l 阅读全文
posted @ 2019-11-06 10:18 ComMario 阅读(122) 评论(0) 推荐(0)
Codeforces 112A
摘要:#include <iostream> #include <string> #include <cctype> using namespace std; int main() { string str1; string str2; int length; while(cin>>str1>>str2) 阅读全文
posted @ 2019-11-06 10:16 ComMario 阅读(186) 评论(0) 推荐(0)
Codeforces 96A
摘要:#include <iostream> #include <string> #include <cctype> using namespace std; int main() { string str1; string str2; int length; while(cin>>str1>>str2) 阅读全文
posted @ 2019-11-06 10:16 ComMario 阅读(115) 评论(0) 推荐(0)
Codeforces 282A
摘要:#include <iostream> #include <string> using namespace std; int main() { int n, plus, sub; string ope; while(cin>>n) { plus=sub=0; while(n--) { cin>>op 阅读全文
posted @ 2019-11-06 10:15 ComMario 阅读(134) 评论(0) 推荐(0)
Codeforces 50A
摘要:#include <iostream> using namespace std; int main() { int m, n; cin>>m>>n; cout<<(m*n)/2<<endl; return 0; } 阅读全文
posted @ 2019-11-06 10:14 ComMario 阅读(99) 评论(0) 推荐(0)
Codeforces 231A
摘要:#include <iostream> using namespace std; #define maxSize 10 int main() { int views[maxSize]; int n, res; while(cin>>n) { res=0; for(int i=0; i<n; ++i) 阅读全文
posted @ 2019-11-06 10:13 ComMario 阅读(124) 评论(0) 推荐(0)
Codeforces 118A
摘要:#include <iostream> #include <cctype> #include <string> using namespace std; int main() { string str; cin>>str; int length; length=str.size(); for(int 阅读全文
posted @ 2019-11-06 10:12 ComMario 阅读(142) 评论(0) 推荐(0)
Codeforces 158A
摘要:#include <iostream> using namespace std; #define maxSize 60 int main() { int score[maxSize]; int n, k, res; cin>>n>>k; res=0; for(int i=0; i<n; ++i) c 阅读全文
posted @ 2019-11-06 10:11 ComMario 阅读(89) 评论(0) 推荐(0)
Codeforces 71A
摘要:#include <iostream> #include <string> using namespace std; int main() { string word; int length, n; cin>>n; for(int i=0; i<n; ++i) { cin>>word; length 阅读全文
posted @ 2019-11-06 10:10 ComMario 阅读(102) 评论(0) 推荐(0)
Codeforces 1A
摘要:#include <iostream> using namespace std; int main() { long long n, m, a, r, c; cin>>n>>m>>a; r=n/a; if(n%a!=0) ++r; c=m/a; if(m%a!=0) ++c; cout<<r*c<< 阅读全文
posted @ 2019-11-06 10:08 ComMario 阅读(92) 评论(0) 推荐(0)
Codeforces 4A
摘要:#include <iostream> using namespace std; int main() { int a; cin>>a; if((a>=4) && (a%2==0)) cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; } 阅读全文
posted @ 2019-11-06 10:07 ComMario 阅读(155) 评论(0) 推荐(0)
Codeforces 510A
摘要:#include <stdio.h> int main() { int n, m; scanf("%d %d", &n, &m); int i, j; int Count=0; for(i=1; i<=n; ++i) { if((i%2)!=0) { for(j=0; j<m; ++j) print 阅读全文
posted @ 2019-11-06 09:18 ComMario 阅读(132) 评论(0) 推荐(0)
Codeforces 492B
摘要:#include <stdio.h> #include <stdlib.h> int comp(const void *first, const void *second); int lanterns[1024]; int main() { int n, l; scanf("%d %d", &n, 阅读全文
posted @ 2019-11-05 19:32 ComMario 阅读(162) 评论(0) 推荐(0)
Codeforces 230A
摘要:#include <stdio.h> int data[1024][2]; int main() { int s, n; scanf("%d %d", &s, &n); int i; for(i=0; i<n; ++i) { scanf("%d %d", &data[i][0], &data[i][ 阅读全文
posted @ 2019-11-05 19:20 ComMario 阅读(144) 评论(0) 推荐(0)
Codeforces 1030A
摘要:#include <stdio.h> int main() { int num; scanf("%d", &num); int i, sum=0; int temp; for(i=0; i<num; ++i) { scanf("%d", &temp); sum+=temp; } if(sum) pr 阅读全文
posted @ 2019-11-05 19:13 ComMario 阅读(120) 评论(0) 推荐(0)