Rezultati

Up. imeNalogaJezikRezultatČas oddaje
svetatrojica-2017 Hodnik Python 3 100/100OK 20. apr '17 @ 16:48

Test Točke Porabljen spomin Porabljen čas Status
#1 10/10 8,395 MiB 0,000 s OK
#2 10/10 8,359 MiB 0,000 s OK
#3 10/10 8,344 MiB 0,000 s OK
#4 10/10 8,379 MiB 0,000 s OK
#5 10/10 8,395 MiB 0,000 s OK
#6 10/10 8,383 MiB 0,000 s OK
#7 10/10 8,363 MiB 0,000 s OK
#8 10/10 8,383 MiB 0,000 s OK
#9 10/10 8,355 MiB 0,000 s OK
#10 10/10 8,375 MiB 0,000 s OK

Ocenjevani program (hodnik.py):
enke = 0
nicle = 0

n = input()

for i in range(len(n)):
    if(i%2 == 0):
        if(n[i] == '0'):
            enke+=1
        else:
            nicle+=1
    else:
        if(n[i] == '1'):
            enke+=1
        else:
            nicle+=1
print(min(nicle, enke))