Rezultati

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

Test Točke Porabljen spomin Porabljen čas Status
#1 7/7 8,492 MiB 0,000 s OK
#2 7/7 8,664 MiB 0,000 s OK
#3 7/7 8,484 MiB 0,000 s OK
#4 7/7 8,555 MiB 0,000 s OK
#5 7/7 8,656 MiB 0,000 s OK
#6 7/7 8,492 MiB 0,000 s OK
#7 7/7 8,488 MiB 0,000 s OK
#8 7/7 8,559 MiB 0,000 s OK
#9 7/7 8,582 MiB 0,000 s OK
#10 7/7 8,648 MiB 0,000 s OK
#11 7/7 8,492 MiB 0,000 s OK
#12 7/7 8,484 MiB 0,000 s OK
#13 8/8 8,480 MiB 0,000 s OK
#14 8/8 8,563 MiB 0,000 s OK

Ocenjevani program (podnapisi.py):
class Time:
    def __init__(self, h, m, s, ms):
        self.h = h
        self.m = m
        self.s = s
        self.ms = ms

    def __add__(self, other):
        ms_n = (other.ms + self.ms) % 1000
        s_c = (other.ms + self.ms) // 1000

        s_n = (other.s + self.s + s_c) % 60
        m_c = (other.s + self.s + s_c) // 60

        m_n = (other.m + self.m + m_c) % 60
        h_c = (other.m + self.m + m_c) // 60

        h_n = (other.h + self.h + h_c)

        return Time(h_n, m_n, s_n, ms_n)

    def __repr__(self):
        return "%02d:%02d:%02d,%03d" % (self.h, self.m, self.s, self.ms)


def parse_time(string):
    return Time(int(string[0:2]), int(string[3:5]), int(string[6:8]), int(string[9:]))

shift = parse_time(input()[7:])

start = True
while(True):
    try:
        row = input()
        print(row)

        if(start):
            start = False
            time1, time2 = [parse_time(s) for s in input().split(" --> ")]
            print("%s --> %s" % (repr(time1+shift), repr(time2+shift)))

        if(len(row) == 0):
            start = True

    except EOFError:
        break