Submission #10089

#TimeUsernameProblemLanguageResultExecution timeMemory
10089gs14004올림픽 (KOI13_olympic)C++98
100 / 100
0 ms1104 KiB
// 비공개 #include <cstdio> #include <algorithm> using namespace std; struct x{int a,g,s,b;}a[1005]; bool cmp(x a, x b){return a.g != b.g ? a.g > b.g : (a.s != b.s ? a.s > b.s : a.b > b.b);} bool operator==(x a, x b){ return a.g == b.g && a.s == b.s && a.b == b.b; } int main(){ int n,k; scanf("%d %d",&n,&k); for (int i=0; i<n; i++) { scanf("%d %d %d %d",&a[i].a,&a[i].g,&a[i].s,&a[i].b); } sort(a,a+n,cmp); x piv; for (int i=0; i<n; i++) { if(a[i].a == k) piv = a[i]; } for (int i=0; i<n; i++) { if(piv == a[i]){ printf("%d",i+1); 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...