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>
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;
}
# | 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... |