답안 #5328

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
5328 2014-03-23T12:11:43 Z baneling100 올림픽 (KOI13_olympic) C++
100 / 100
0 ms 1104 KB
#include <stdio.h>
#include <algorithm>

using namespace std;

typedef pair <int,int> ppair;
pair <ppair,ppair> medal[1001];
int n, k, ans;

void input(void)
{
    int i, a, b, c, d;

    scanf("%d %d",&n,&k);
    for(i=1 ; i<=n ; i++)
    {
        scanf("%d %d %d %d",&a,&b,&c,&d);
        if(a==k)
            a=0;
        medal[i]=make_pair(make_pair(-b,-c),make_pair(-d,a));
    }
    sort(medal+1,medal+n+1);
}

void process(void)
{
    int i;

    for(i=1 ; i<=n ; i++)
        if(medal[i].second.second==0)
        {
            ans=i;
            break;
        }
}

void output(void)
{
    printf("%d",ans);
}

int main(void)
{
    input();
    process();
    output();

    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