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)
# |
결과 |
실행 시간 |
메모리 |
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 |