Submission #9122

#TimeUsernameProblemLanguageResultExecution timeMemory
9122maniacPenalty calculation (kriii2_PE)C++98
4 / 4
0 ms1088 KiB
#include <cstdio> int pro[5]; int t[105], s[105]; int main(){ int n; scanf("%d", &n); for(int i=1; i<=n; i++){ scanf("%d %d", t+i, s+i); if( !pro[s[i]] ) pro[s[i]] = i; } int ans = 0; if( pro[4] ) ans = t[pro[4]] + (pro[4]-1)*20; else if( pro[1] ) ans = t[pro[1]] + (pro[1]-1)*20; else ans = 0; printf("%d\n", ans); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...