Rezultati

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

Test Točke Porabljen spomin Porabljen čas Status
#1 10/10 6,414 MiB 0,000 s OK
#2 10/10 6,414 MiB 0,000 s OK
#3 10/10 6,379 MiB 0,000 s OK
#4 10/10 6,387 MiB 0,000 s OK
#5 10/10 6,418 MiB 0,000 s OK
#6 10/10 6,387 MiB 0,000 s OK
#7 10/10 6,414 MiB 0,000 s OK
#8 10/10 6,422 MiB 0,000 s OK
#9 10/10 6,418 MiB 0,000 s OK
#10 10/10 6,414 MiB 0,000 s OK

Ocenjevani program (hodnik.py):
from operator import xor

a = raw_input()



s1 = "0"
s2 = "1"

c1 = 0
c2 = 0

for bit in a:
    if (bit != s1):
        c1 += 1

    if (bit != s2):
        c2 += 1
    t = s1
    s1 = s2
    s2 = t

print(min(c1, c2))