Rezultati

Up. imeNalogaJezikRezultatČas oddaje
zerodays-2018 Podnapisi Python 3 100/100OK 10. maj '18 @ 17:44

Test Točke Porabljen spomin Porabljen čas Status
#1 7/7 9,066 MiB 0,000 s OK
#2 7/7 9,254 MiB 0,000 s OK
#3 7/7 9,215 MiB 0,000 s OK
#4 7/7 10,027 MiB 0,000 s OK
#5 7/7 9,094 MiB 0,000 s OK
#6 7/7 9,129 MiB 0,000 s OK
#7 7/7 9,191 MiB 0,000 s OK
#8 7/7 9,258 MiB 0,000 s OK
#9 7/7 9,109 MiB 0,000 s OK
#10 7/7 9,207 MiB 0,000 s OK
#11 7/7 9,102 MiB 0,000 s OK
#12 7/7 9,203 MiB 0,000 s OK
#13 8/8 9,102 MiB 0,000 s OK
#14 8/8 9,105 MiB 0,000 s OK

Ocenjevani program (podnapisi.py):
import datetime

def split(s):
    ms = s[s.find(',') + 1:]
    ostalo = s[:s.find(',')]
    h, m, s = ostalo.split(':')
    return int(h), int(m), int(s), int(ms)

shift = input().split()[-1]
shift_h, shift_m, shift_s, shift_ms = split(shift)

delta = datetime.timedelta(hours=shift_h, minutes=shift_m, seconds=shift_s, milliseconds=shift_ms)

def premakn(cas):
    h, m, s, ms = split(cas)
    t = datetime.datetime(year=2018, month=1, day=1, 
        hour=h, minute=m, second=s, microsecond=ms * 1000
    )
    t += delta
    return '{:0>2d}:{:0>2d}:{:0>2d},{:0>3d}'.format(t.hour, t.minute, t.second, t.microsecond // 1000)


brk = False
while not brk:
    cifra = input()
    casi = input()
    
    l = []
    try:
        while True:
            podnapis = input()
            if (podnapis == ''): break
            l.append(podnapis)
    except:
        brk = True
        pass
    
    print(cifra)

    cajt1, cajt2 = casi.split(' --> ')

    cajt1 = premakn(cajt1)
    cajt2 = premakn(cajt2)

    print('{:} --> {:}'.format(cajt1, cajt2))        
    for podnapis in l:
        print(podnapis)
    
    if not brk:
        print()