标签:
3 5 00:59 00:25 04:16 00:12 03:57 1 2 1 1 3 01:03 00:17 02:38 00:22 02:08 1 1 1 1 1 00:44 00:29 03:42 00:20 01:53 1 1 3 1 1 1 7 00:27 01:58 03:15 00:47 02:44 04:13 02:39 2 1 4 4 1 7 4 4 3 02:12 00:42 00:24 4 1 1 01:27 03:03 00:31 1 2 1 00:58 00:33 00:18 1 1 1 04:05 00:41 01:27 6 2 4
388 468 649 1283 109 258 321 553
#include<stdio.h> //#include<bits/stdc++.h> #include<string.h> #include<iostream> #include<math.h> #include<sstream> #include<set> #include<queue> #include<map> #include<vector> #include<algorithm> #include<limits.h> #define inf 0x3fffffff #define INF 0x3f3f3f3f #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 #define LL long long #define ULL unsigned long long using namespace std; struct P { // string s; int sum; } L[100000]; int i,j; int n,m; int k; int M,s; int FA; bool cmd(P x,P y) { return x.sum<y.sum; } int main () { while(cin>>n>>k) { for(j=0;j<n;j++) { int num=0; for(i=0; i<k; i++) { scanf("%d:%d",&M,&s); num+=M*60+s; } for(i=0; i<k; i++) { cin>>FA; num+=(FA-1)*20; } L[j].sum=num; // cout<<L[j].sum<<endl; } sort(L,L+n,cmd); for(i=0;i<n;i++) { if(i!=n-1) { printf("%d ",L[i].sum); } else { printf("%d\n",L[i].sum); } } } return 0; }
1 123456789 2333333333333333333333333333333333333333
No Yes No
#include<stdio.h> //#include<bits/stdc++.h> #include<string.h> #include<iostream> #include<math.h> #include<sstream> #include<set> #include<queue> #include<map> #include<vector> #include<algorithm> #include<limits.h> #define inf 0x3fffffff #define INF 0x3f3f3f3f #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 #define LL long long #define ULL unsigned long long using namespace std; string s; int main() { while(cin>>s) { int sum=0; for(int i=0;i<s.length();i++) { sum+=s[i]-‘0‘; } // cout<<sum<<endl; if(sum%3==0) { puts("Yes"); } else { puts("No"); } } return 0; }
2015苏州大学ACM-ICPC集训队选拔赛(2) 1001 1010
标签:
原文地址:http://www.cnblogs.com/yinghualuowu/p/5116132.html