Rezultati

Up. imeNalogaJezikRezultatČas oddaje
Kumkvat Pasavci Python 3 0/100Napaka med izvajanjem / ob izhodu (RTE) 11. maj '17 @ 19:24

Test Točke Porabljen spomin Porabljen čas Status
#1 5/5 8,801 MiB 0,000 s OK
#2 5/5 9,520 MiB 0,000 s OK
#3 5/5 16,535 MiB 0,000 s OK
#4 5/5 45,816 MiB 0,192 s OK
#5 5/5 64,582 MiB 0,000 s OK
#6 0/5 128,363 MiB 0,000 s Prekoračen spomin
#7 5/5 115,180 MiB 0,000 s OK
#8 0/5 128,414 MiB 0,000 s Prekoračen spomin
#9 0/6 128,281 MiB 0,000 s Prekoračen spomin
#10 0/6 196,016 MiB 0,000 s Prekoračen spomin
#11 6/6 8,602 MiB 0,000 s OK
#12 6/6 8,605 MiB 0,000 s OK
#13 6/6 8,602 MiB 0,000 s OK
#14 6/6 8,590 MiB 0,000 s OK
#15 6/6 10,496 MiB 0,608 s OK
#16 6/6 8,621 MiB 0,000 s OK
#17 6/6 8,594 MiB 0,000 s OK
#18 6/6 10,664 MiB 0,000 s OK

Ocenjevani program (pasavci.py):
p = input()
s1 = input()
s2 = input()
m = int(input())
sez = []
for i in range(m):
    s = input()
    s = list(map(int, s.split()))
    s = list(map(lambda x: x - 1, s))
    sez.append(s)
pasavci = [0 for i in range(m+2)]
pasavci[0] = s1
pasavci[1] = s2

for i in range(m):
    [pr, dr] = sez[i]
    pasavci[i + 2] = pasavci[pr] + pasavci[dr]

zadnji = pasavci[m + 1]

n = len(p)
d = len(zadnji)
if d < n:
    print(0)
else:
    st = 0
    for i in range(d - n + 1):
        if zadnji[i:i+n] == p:
            st += 1
    print(st)