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>
int main()
{
printf("%s\n%s\n", "paper", "scissors");
}
*/
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n, t[101], s[101];
cin >> n;
for(int i=0; i<n; i++) cin >> t[i] >> s[i];
int max = 0;
for(int i=0; i<n; i++)
{
if(max < s[i]) max = s[i];
}
int time[101], cnt = 0;
for(int i=0; i<n; i++)
{
if(max == s[i]) time[cnt++] = t[i];
}
sort(time, time+cnt);
int index;
for(int i=0; i<n; i++)
{
if(time[0] == t[i]) index = i;
}
int P;
if(!max) P = 0;
else P = t[index] + index*20;
cout << P << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |