Rezultati

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

Test Točke Porabljen spomin Porabljen čas Status
#1 10/10 8,508 MiB 0,000 s OK
#2 10/10 8,656 MiB 0,000 s OK
#3 10/10 8,742 MiB 0,000 s OK
#4 10/10 8,746 MiB 0,000 s OK
#5 10/10 8,605 MiB 0,000 s OK
#6 10/10 8,754 MiB 0,000 s OK
#7 10/10 8,590 MiB 0,000 s OK
#8 10/10 8,742 MiB 0,000 s OK
#9 10/10 8,742 MiB 0,000 s OK
#10 10/10 8,676 MiB 0,000 s OK

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

i = 0
pop = 0


while i <= n-3:
    a = niz[i]
    b = niz[i+1]
    c = niz[i+2]
    if (a+b+c) == '010':
        pop += 1
        i += 3
    else:
        i += 1

print(pop)