Submission #9076

#TimeUsernameProblemLanguageResultExecution timeMemory
9076roott76Penalty calculation (kriii2_PE)C++98
4 / 4
0 ms1676 KiB
/* #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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...