Submission #16227

#TimeUsernameProblemLanguageResultExecution timeMemory
16227eaststar올림픽 (KOI13_olympic)C++14
100 / 100
1 ms1100 KiB
#include <stdio.h> #include <algorithm> struct data{ int ind,g,s,b; bool operator<(const data&r)const{ if(g==r.g){ if(s==r.s)return b>r.b; return s>r.s; } return g>r.g; } }a[1010]; int main(){ int i,n,k,ans=1; scanf("%d%d",&n,&k); for(i=0;i<n;++i)scanf("%d%d%d%d",&a[i].ind,&a[i].g,&a[i].s,&a[i].b); std::sort(a,a+n); for(i=1;i<n;++i){ if(a[i].g!=a[i-1].g||a[i].s!=a[i-1].s||a[i].b!=a[i-1].b)ans=i+1; if(a[i].ind==k)break; } if(i==n)ans=1; printf("%d",ans); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...