This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// 비공개
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |