Submission #16227

# Submission time Handle Problem Language Result Execution time Memory
16227 2015-08-18T10:21:19 Z eaststar 올림픽 (KOI13_olympic) C++14
100 / 100
1 ms 1100 KB
#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
1 Correct 0 ms 1100 KB Output is correct
2 Correct 0 ms 1100 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1100 KB Output is correct
2 Correct 0 ms 1100 KB Output is correct
3 Correct 0 ms 1100 KB Output is correct
4 Correct 0 ms 1100 KB Output is correct
5 Correct 0 ms 1100 KB Output is correct
6 Correct 0 ms 1100 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1100 KB Output is correct
2 Correct 0 ms 1100 KB Output is correct
3 Correct 0 ms 1100 KB Output is correct
4 Correct 0 ms 1100 KB Output is correct
5 Correct 0 ms 1100 KB Output is correct
6 Correct 0 ms 1100 KB Output is correct
7 Correct 0 ms 1100 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1100 KB Output is correct
2 Correct 0 ms 1100 KB Output is correct
3 Correct 0 ms 1100 KB Output is correct
4 Correct 0 ms 1100 KB Output is correct
5 Correct 0 ms 1100 KB Output is correct
6 Correct 0 ms 1100 KB Output is correct
7 Correct 0 ms 1100 KB Output is correct
8 Correct 0 ms 1100 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1100 KB Output is correct
2 Correct 0 ms 1100 KB Output is correct
3 Correct 0 ms 1100 KB Output is correct
4 Correct 0 ms 1100 KB Output is correct
5 Correct 1 ms 1100 KB Output is correct
6 Correct 0 ms 1100 KB Output is correct
7 Correct 0 ms 1100 KB Output is correct
8 Correct 0 ms 1100 KB Output is correct
9 Correct 0 ms 1100 KB Output is correct