Rezultati

Up. imeNalogaJezikRezultatČas oddaje
kumkvat-2018 Niz Python 3 100/100OK 19. apr '18 @ 16:36

Test Točke Porabljen spomin Porabljen čas Status
#1 10/10 8,664 MiB 0,000 s OK
#2 10/10 8,656 MiB 0,000 s OK
#3 10/10 8,691 MiB 0,000 s OK
#4 10/10 8,656 MiB 0,000 s OK
#5 10/10 8,586 MiB 0,000 s OK
#6 10/10 8,699 MiB 0,000 s OK
#7 10/10 8,746 MiB 0,000 s OK
#8 10/10 8,590 MiB 0,000 s OK
#9 10/10 8,590 MiB 0,000 s OK
#10 10/10 8,586 MiB 0,000 s OK

Ocenjevani program (niz.py):
n = int(input().strip())
niz = input().strip()

stevec = 0
i = 0
while i <= n-3:
    if niz[i:i+3] == '010':
        if niz[i+2:i+5] == '010':
            stevec += 1
            i += 4
        else:
            stevec += 1
            i += 2
    else:
        i += 1

print(stevec)