# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
10073 |
2014-10-08T09:44:09 Z |
gs14004 |
올림픽 (KOI13_olympic) |
C++ |
|
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;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1104 KB |
Output is correct |
2 |
Correct |
0 ms |
1104 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
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 |
# |
Verdict |
Execution time |
Memory |
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 |
# |
Verdict |
Execution time |
Memory |
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 |
# |
Verdict |
Execution time |
Memory |
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 |