Submission #8518

#TimeUsernameProblemLanguageResultExecution timeMemory
8518tncks0121Penalty calculation (kriii2_PE)C++98
4 / 4
0 ms1088 KiB
#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);
		if(!cnt[s]) cnt[s] = i, tm[s] = t;
	}

	if(maxs > 0)
		printf("%d\n", tm[maxs] + (cnt[maxs] - 1) * 20);
	else
		puts("0");

	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...