Rezultati

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

Test Točke Porabljen spomin Porabljen čas Status
#1 10/10 8,516 MiB 0,000 s OK
#2 10/10 8,660 MiB 0,000 s OK
#3 10/10 8,660 MiB 0,000 s OK
#4 10/10 8,742 MiB 0,000 s OK
#5 10/10 8,734 MiB 0,000 s OK
#6 10/10 8,750 MiB 0,000 s OK
#7 10/10 8,684 MiB 0,000 s OK
#8 10/10 8,672 MiB 0,000 s OK
#9 10/10 8,676 MiB 0,000 s OK
#10 10/10 8,742 MiB 0,000 s OK

Ocenjevani program (niz.py):
N=int(input())
s=input()

res = 0
if(N>2):
    c1,c2 = s[0],s[1]

    for i in range(2,N):
        if(c1=='0' and c2=='1' and s[i] =='0'):
            res+=1
            c1=c2
            c2='1'
        else:
            c1=c2
            c2=s[i]
        
print(res)