← Back to List

11531번: ACM 대회 채점 ↗

Solutions

Python 3
432 B | 432 chars
right = set()
wrong = {}
cnt, total = 0,0
while True:
    a = input()
    if a == "-1":
        break
    t,p,result = a.split()
    if p in right:
        continue
    
    if result == "right":
        right.add(p)
        cnt+=1
        total += int(t)
    else:
        try:
            wrong[p]+=1
        except:
            wrong[p]=1
for i in wrong.keys():
    if i in right:
        total += wrong[i] * 20
print(cnt, total)