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 <cstdio>
#include <iostream>
#include <fstream>
#include <deque>
#include <algorithm>
#include <utility>
#include <vector>
#include <cmath>
#include <queue>
using namespace std;
#define in cin
#define out cout
#define PII pair<int, int>
#define x first
#define y second
#define REP(i, s, e) for(int i=s; i<=e; i++)
struct aaa
{
int idx, time, score;
};
int main()
{
//freopen("in.txt", "r", stdin);
int n; in >> n;
aaa arr[111];
int maxn = -1, maxi = -1;
REP(i, 1, n)
{
arr[i].idx = i;
in >> arr[i].time >> arr[i].score;
if( arr[i].score > maxn ) {maxn = arr[i].score; maxi = i;}
}
if( arr[maxi].score == 0 )
out << 0 << endl;
else
out << arr[maxi].time + (arr[maxi].idx-1)*20;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |