Rezultati

Up. imeNalogaJezikRezultatČas oddaje
jayzcrew-2018 Podnapisi Python 3 0/100Napaka med izvajanjem / ob izhodu (RTE) 10. maj '18 @ 16:53

Test Točke Porabljen spomin Porabljen čas Status
#1 7/7 8,945 MiB 0,000 s OK
#2 0/7 9,113 MiB 0,000 s Napačen odgovor
Tvoj izhod:
​916
21:41:58,936 --> 21:42:00,537
Greg, move your head.

916
00:42:38,305 --> 00:42:44,914
Support us and become VIP member
to remove all ads from www.OpenSubtitles.org
<<<EOF>>>
Pravilen izhod:
​916
21:41:58,936 --> 21:42:00,537
Greg, move your head.

916
21:42:01,326 --> 21:42:07,935
Support us and become VIP member
to remove all ads from www.OpenSubtitles.org
<<<EOF>>>
#3 7/7 8,969 MiB 0,000 s OK
#4 7/7 9,090 MiB 0,000 s OK
#5 7/7 8,871 MiB 0,000 s OK
#6 7/7 8,871 MiB 0,000 s OK
#7 7/7 8,996 MiB 0,000 s OK
#8 0/7 9,039 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 70, in <module>
    cas1 = totime(prvi[0])
  File "source.py3", line 45, in totime
    ure = int(s[0])
ValueError: invalid literal for int() with base 10: 'SHIFT'
#9 7/7 8,875 MiB 0,000 s OK
#10 7/7 8,949 MiB 0,000 s OK
#11 7/7 9,047 MiB 0,000 s OK
#12 7/7 8,949 MiB 0,000 s OK
#13 8/8 9,055 MiB 0,000 s OK
#14 8/8 8,910 MiB 0,000 s OK

Ocenjevani program (nal1.py):
import datetime
import sys
# ure, minute, sekunde

def zamakni(pod, zamik):

    tisoc = pod[3] + zamik[3]

    prestopt = tisoc // 1000

    tisoc = tisoc % 1000

    s2 = pod[2] + zamik[2] + prestopt
    prestops = s2//60
    s2 = s2 % 60

    min2 = pod[1]  + zamik[1] + prestops

    prestopm = min2//60

    min2 = min2 % 60

    ure = pod[0] + zamik[0] + prestopm

    return [ure,min2, s2,tisoc]

def formattime(cas):
    ure = str(cas[0])
    ure = '0'*(2-len(ure)) + ure

    min = str(cas[1])
    min = '0'*(2-len(min)) + min

    s = str(cas[2])
    s = '0'*(2-len(s)) + s

    tisoc = str(cas[3])
    tisoc = '0'*(3-len(tisoc)) + tisoc

    return '{0}:{1}:{2},{3}'.format(ure,min,s,tisoc)

def totime(s):

    s = s.split(':')
    ure = int(s[0])
    min = int(s[1])

    zad = s[2].split(',')

    sek = int(zad[0])

    t = int(zad[1])

    return [ure, min, sek, t]

shift = sys.stdin.readline()
shift = shift[7:]
shift = totime(shift)

count = 1

popravi = False

for vrs in sys.stdin:
    try:
        vrs = vrs.strip()
        if popravi:
            popravi = False
            prvi = vrs.split('-->')
            cas1 = totime(prvi[0])
            cas2 = totime(prvi[1])
            cas1zam = zamakni(cas1,shift)
            cas2zam = zamakni(cas2,shift)
            cas11 = formattime(cas1zam)
            cas22 = formattime(cas2zam)
            print('{0} --> {1}'.format(cas11,cas22))
        else:
            print(vrs)
            if vrs == str(count):
                popravi = True
                count += 1

    except EOFError:
        break