답안 #170907

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
170907 2019-12-26T16:50:49 Z MatesV13 Titlovi (COCI19_titlovi) Python 3
50 / 50
27 ms 3428 KB
def turntostr(kl):
    lk = ""
    help = str(kl%1000)
    while len(help)<3: help = "0" + help
    lk = help
    kl=kl//1000
    help = str(kl%60)
    while len(help)<2: help = "0" + help
    lk = help + "," + lk
    kl=kl//60
    help = str(kl%60)
    while len(help)<2: help = "0" + help
    lk = help + ":" + lk
    kl=kl//60
    help = str(kl)
    while len(help)<2: help = "0" + help
    lk = help + ":" + lk
    return lk

def turntoms(kl):
    lk = int(kl[0])
    lk = lk*10
    lk += int(kl[1])
    lk = lk*6
    lk += int(kl[3])
    lk = lk*10
    lk += int(kl[4])
    lk = lk*6
    lk += int(kl[6])
    lk = lk*10
    lk += int(kl[7])
    lk = lk*10
    lk += int(kl[9])
    lk = lk*10
    lk += int(kl[10])
    lk = lk*10
    lk += int(kl[11])
    return lk

a = []
hm = 'x'
while True:
    hm = input()
    a.append(hm)
    if hm=='#': break
    
y = int(input())
for x in a:
    if len(x)==29 and x[2]==':':
        print(turntostr(turntoms(x[:12])+y) + " --> " + turntostr(turntoms(x[17:])+y))
    else: print(x)
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 3424 KB Output is correct
2 Correct 25 ms 3428 KB Output is correct
3 Correct 27 ms 3428 KB Output is correct
4 Correct 25 ms 3428 KB Output is correct
5 Correct 25 ms 3428 KB Output is correct