hiho week 59 register

Ended

Participants:345

Verdict:Accepted
Score:100 / 100
Submitted:2015-08-19 22:06:14

Lang:Python2

Edit
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
N = int(raw_input())
s = []
incorrect = False
res = {}
order = []
for _ in range(N):
    ftsstatus = raw_input().split()
    ts = map(intts.split(':'))
    t = 3600 * ts[0] + 60 * ts[1] + ts[2]
    if status == 'END':
        if s:
            x = s.pop()
            if x[0] != f or x[1] != 'START' or x[2] > t:
                incorrect = True
                break
            else:
                res[f] = t - x[2]
        else:
            incorrect = True
            break
    else:
        order.append(f)
        s.append((fstatust))
if incorrect or len(s) != 0:
    print "Incorrect performance log"
else:
    for f in order:
        t = res[f]
        print '{} {:0>2}:{:0>2}:{:0>2}'.format(ft // 3600(t%3600)//60t%60)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX