Rezultati

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

Test Točke Porabljen spomin Porabljen čas Status
#1 10/10 8,406 MiB 0,000 s OK
#2 10/10 8,340 MiB 0,000 s OK
#3 10/10 8,441 MiB 0,000 s OK
#4 10/10 8,383 MiB 0,000 s OK
#5 10/10 8,383 MiB 0,000 s OK
#6 10/10 8,359 MiB 0,000 s OK
#7 10/10 8,512 MiB 0,000 s OK
#8 10/10 8,449 MiB 0,000 s OK
#9 10/10 8,449 MiB 0,000 s OK
#10 10/10 8,441 MiB 0,000 s OK

Ocenjevani program (nurek.py):
import sys

N = input()
niz = input().strip()
if len(niz) < 3:
    print("0")
    sys.exit(0)
last = ""

def testa(a):
    last = "   "
    t = 0
    for j in range(len(a)):
        last = last[1] + last[2] + a[j]
        if last == "010":
            t +=1
            last = "   "
    return t
print(min(testa(niz), testa(niz[::-1])))