답안 #10073

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
10073 2014-10-08T09:44:09 Z gs14004 올림픽 (KOI13_olympic) C++
100 / 100
0 ms 1104 KB
#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;
        }
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1104 KB Output is correct
2 Correct 0 ms 1104 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1104 KB Output is correct
2 Correct 0 ms 1104 KB Output is correct
3 Correct 0 ms 1104 KB Output is correct
4 Correct 0 ms 1104 KB Output is correct
5 Correct 0 ms 1104 KB Output is correct
6 Correct 0 ms 1104 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1104 KB Output is correct
2 Correct 0 ms 1104 KB Output is correct
3 Correct 0 ms 1104 KB Output is correct
4 Correct 0 ms 1104 KB Output is correct
5 Correct 0 ms 1104 KB Output is correct
6 Correct 0 ms 1104 KB Output is correct
7 Correct 0 ms 1104 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1104 KB Output is correct
2 Correct 0 ms 1104 KB Output is correct
3 Correct 0 ms 1104 KB Output is correct
4 Correct 0 ms 1104 KB Output is correct
5 Correct 0 ms 1104 KB Output is correct
6 Correct 0 ms 1104 KB Output is correct
7 Correct 0 ms 1104 KB Output is correct
8 Correct 0 ms 1104 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1104 KB Output is correct
2 Correct 0 ms 1104 KB Output is correct
3 Correct 0 ms 1104 KB Output is correct
4 Correct 0 ms 1104 KB Output is correct
5 Correct 0 ms 1104 KB Output is correct
6 Correct 0 ms 1104 KB Output is correct
7 Correct 0 ms 1104 KB Output is correct
8 Correct 0 ms 1104 KB Output is correct
9 Correct 0 ms 1104 KB Output is correct