Rezultati

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

Test Točke Porabljen spomin Porabljen čas Status
#1 7/7 9,078 MiB 0,000 s OK
#2 7/7 9,078 MiB 0,000 s OK
#3 7/7 9,148 MiB 0,000 s OK
#4 7/7 9,172 MiB 0,000 s OK
#5 7/7 9,152 MiB 0,000 s OK
#6 7/7 9,238 MiB 0,000 s OK
#7 7/7 9,246 MiB 0,000 s OK
#8 7/7 9,242 MiB 0,000 s OK
#9 7/7 9,102 MiB 0,000 s OK
#10 7/7 9,262 MiB 0,000 s OK
#11 7/7 9,246 MiB 0,000 s OK
#12 7/7 9,242 MiB 0,000 s OK
#13 8/8 9,176 MiB 0,000 s OK
#14 8/8 9,086 MiB 0,000 s OK

Ocenjevani program (podnapisi3.py):
import datetime as dt


# def get_time(timestr):
#     timestr = timestr.split(':')
#     H, M = [int(x) for x in timestr[:2]]
#     S, MilS = [int(x) for x in timestr[2].split(',')]
#     MicS = MilS*1000
#     return H, M, S, MicS
#
# shift = input().split('SHIFT: ')
# sH, sM, sS, sMicS = get_time(shift[1])
# shift = dt.timedelta(hours=sH, minutes=sM, seconds=sS, microseconds=sMicS)
# D = 14
# Mo = 3
# Y = 1995

def give_time(time):
    time_split1=time.split(":")
    time_split2=time_split1[2].split(",")
    H=int(time_split1[0])
    M=int(time_split1[1])
    S=int(time_split2[0])
    mS=int(time_split2[1])
    actual_time=mS+1000*S+1000*60*M+1000*60*60*H
    return actual_time


def give_str(actual_time):
    signH=1000*60*60
    signM=1000*60
    signS=1000
    H=actual_time//signH
    actual_time=actual_time%signH
    M=actual_time//signM
    actual_time=actual_time%signM
    S=actual_time//signS
    actual_time=actual_time%signS
    mS=actual_time
    return "{:02}:{:02}:{:02},{:03}".format(H, M, S, mS)


def move_time(time,actual_shift):
    actual_time=give_time(time)
    new_time=actual_time+actual_shift
    return give_str(new_time)


shift = input().split('SHIFT: ')
shift=shift[1]
actual_shift=give_time(shift)
step=0
while True:
    try:
        line = input()
    except Exception:
        break
    if step==0:
        print(line)
        step=1
    elif step==1:
        times=line
        time1, time2 = times.split(' --> ')
        print("{} --> {}".format(move_time(time1,actual_shift), move_time(time2,actual_shift)))
        step=2
    elif step==2:
        if line=="\n" or line=="":
            step=0
            print()
        else:
            print(line)