Submission #940364

#TimeUsernameProblemLanguageResultExecution timeMemory
9403641075508020060209tcACM (COCI19_acm)C++14
0 / 50
2 ms11100 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define X first #define Y second int n;int m; string sar[200005]; int slvar[200005]; int pen[200005]; bool cmp(int i,int j){ if(slvar[i]>slvar[j]){return 1;} if(slvar[i]<slvar[j]){return 0;} if(pen[i]<pen[j]){return 1;} if(pen[i]>pen[j]){return 0;} return sar[i]<sar[j]; } int vl(string s){ int ret=(s[0]-'0')*10+s[1]-'0'; return ret; } void clc(int id){ for(int i=1;i<=m;i++){ char typ; cin>>typ; int ul; if(typ=='-'){ cin>>ul; continue; } slvar[id]++; int wr;int a;int b;int c; scanf("%lld/%lld:%lld:%lld",&wr,&a,&b,&c); pen[id]+=wr*20+60+c+b*60+a*3600; } } string hero="NijeZivotJedanACM"; int hid; int ar[200005]; signed main(){ cin>>n>>m; for(int i=1;i<=n;i++){ cin>>sar[i]; if(sar[i]==hero){ hid=i; } clc(i); ar[i]=i; } cin>>sar[hid]; clc(hid); sort(ar+1,ar+n+1,cmp); for(int i=1;i<=n;i++){ if(ar[i]==hid){ cout<<i<<"\n"; } } }

Compilation message (stderr)

acm.cpp: In function 'void clc(long long int)':
acm.cpp:35:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   35 |     scanf("%lld/%lld:%lld:%lld",&wr,&a,&b,&c);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...