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 <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 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... |