Submission #294986

#TimeUsernameProblemLanguageResultExecution timeMemory
294986BruteforcemanACM (COCI19_acm)Cpython 3
50 / 50
108 ms4556 KiB
import re def process(s): return re.split(r'[/:\s]\s*', s) def getPenalty(s): a = [int(i) for i in s[1:]] submission = 0 if len(s[0]) > 1: submission = ord(s[0][1]) - ord('0') - 1 penalty = a[0] * 60 * 60 + a[1] * 60 + a[2] penalty += submission * 20 * 60 return penalty n, m = map(int, input().split()) ranklist = [] for i in range(n + 1): arr = input().split() team = arr[0] solve, penalty = 0, 0 for j in arr[1:]: if j[0] == '-': continue solve += 1 penalty += getPenalty(process(j)) if i < n and team == 'NijeZivotJedanACM': continue if team == 'NijeZivotJedanACM': team = '' ranklist.append((-solve, penalty, team)) ranklist.sort() for i in range(0, len(ranklist)): if ranklist[i][2] == '': print(i + 1) exit(0)
#Verdict Execution timeMemoryGrader output
Fetching results...