-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuva10258.py
More file actions
36 lines (24 loc) · 878 Bytes
/
uva10258.py
File metadata and controls
36 lines (24 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python3
class Contestant:
def __init__
from collections import defaultdict, Counter
if __name__ == "__main__":
n = int(input())
input()
while n > 0:
n -= 1
data = []
contprob = [[False] * 10 for i in range(101)]
penalty = [0] * 101
while True:
a = input()
if not a:
break;
ctnt, prob, time, result = a.split()
ctnt, prob, time = map(int, ctnt, prob, time)
if result == "C" and not solved[ctnt][prob]:
penalty[ctnt] += time
elif result == "I" and not solved[ctnt][prob]:
penalty[ctnt] += 20
answer = [(sum(contprob[ctnt]), penalty[ctnt], ctnt) for ctnt in range(1,101) if sum(contprob[ctnt]) != 0]
answer = sorted(answer, key = lambda x : (-x[0], x[1], x[2]))