Rezultati

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

Test Točke Porabljen spomin Porabljen čas Status
#1 10/10 8,371 MiB 0,000 s OK
#2 10/10 8,359 MiB 0,000 s OK
#3 10/10 8,355 MiB 0,000 s OK
#4 10/10 8,383 MiB 0,000 s OK
#5 10/10 8,395 MiB 0,000 s OK
#6 10/10 8,398 MiB 0,000 s OK
#7 10/10 8,418 MiB 0,000 s OK
#8 10/10 8,438 MiB 0,000 s OK
#9 10/10 8,422 MiB 0,000 s OK
#10 10/10 8,418 MiB 0,000 s OK

Ocenjevani program (hodnik.py):
niz=input()
l=len(niz)

opt1 = "".join(str(i%2) for i in range(l))
opt2 = "".join(str((i+1)%2) for i in range(l))

opt1c = sum(1 if a!=b else 0 for a,b in zip(opt1, niz))
opt2c = sum(1 if a!=b else 0 for a,b in zip(opt2, niz))

print(min(opt1c,opt2c))