Submission #294986

# Submission time Handle Problem Language Result Execution time Memory
294986 2020-09-09T11:37:45 Z Bruteforceman ACM (COCI19_acm) Python 3
50 / 50
108 ms 4556 KB
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 time Memory Grader output
1 Correct 34 ms 4108 KB Output is correct
2 Correct 96 ms 4556 KB Output is correct
3 Correct 34 ms 4104 KB Output is correct
4 Correct 108 ms 4556 KB Output is correct
5 Correct 108 ms 4504 KB Output is correct