# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
576348 | 2022-06-13T04:14:55 Z | AGE | ACM (COCI19_acm) | C++14 | 26 ms | 31872 KB |
#include <bits/stdc++.h> #define int long long #define F first #define S second #define pb push_back using namespace std; const int N=1e6,M=3e3+2,mod=1e9+7; int a[N]; string ss[N]; int num[N],ans[N]; main() { int n,m; cin>>n>>m; int index; for(int i=0; i<n; i++) { cin>>ss[i]; for(int j=0; j<m; j++) { string s; cin>>s; if(ss[i]=="NijeZivotJedanACM"){ index=i; continue; } if(s[0]=='-') { continue; } else { num[i]++; ans[i]+=1200*(s[1]-'0'); ans[i]+=(s[4]-'0')*3600; int x=s[6]-'0'; x*=10; x+=(s[7]-'0'); ans[i]+=x*60; x=s[9]-'0'; x*=10; x+=(s[10]-'0'); ans[i]+=x; } } num[i]=-num[i]; } string sss; cin>>sss; for(int j=0; j<m; j++) { string s; cin>>s; if(s[0]=='-'||s[0]=='?') { continue; } else { num[index]++; ans[index]+=1200*(s[1]-'0'); ans[index]+=(s[4]-'0')*3600; int x=s[6]-'0'; x*=10; x+=(s[7]-'0'); ans[index]+=x*60; x=s[9]-'0'; x*=10; x+=(s[10]-'0'); ans[index]+=x; } } num[index]=-num[index]; int ansindex; vector< pair< int, pair<int,string > > >v; for(int i=0; i<n; i++){ v.pb({num[i],{ans[i],ss[i]}}); } sort(v.begin(),v.end()); for(int i=0; i<v.size(); i++) { if(v[i].S.S=="NijeZivotJedanACM") ansindex=i; } cout<<ansindex+1<<endl; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 17 ms | 31700 KB | Output is correct |
2 | Correct | 20 ms | 31832 KB | Output is correct |
3 | Correct | 18 ms | 31628 KB | Output is correct |
4 | Correct | 26 ms | 31828 KB | Output is correct |
5 | Correct | 24 ms | 31872 KB | Output is correct |