#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <functional>
#include <vector>
#include <deque>
#include <utility>
#include <bitset>
#include <limits.h>
using namespace std;
typedef long long ll;
typedef double lf;
typedef long double llf;
typedef unsigned long long llu;
int cnt[10], tm[10];
int main(int argc, char * argv[]) {
int n;
scanf("%d", &n);
int maxs = -1;
for(int i = 1; i <= n; i++) {
int t, s; scanf("%d%d", &t, &s);
maxs = max(maxs, s);
assert(s == 0 || s == 4);
if(!cnt[s]) cnt[s] = i, tm[s] = t;
}
printf("%d\n", tm[maxs] + (cnt[maxs] - 1) * 20);
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1088 KB |
Output is correct |
2 |
Correct |
0 ms |
1088 KB |
Output is correct |
3 |
Correct |
0 ms |
1088 KB |
Output is correct |
4 |
Correct |
0 ms |
1088 KB |
Output is correct |
5 |
Correct |
0 ms |
1088 KB |
Output is correct |
6 |
Correct |
0 ms |
1088 KB |
Output is correct |
7 |
Incorrect |
0 ms |
1088 KB |
Output isn't correct |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |