Rezultati

Up. imeNalogaJezikRezultatČas oddaje
OgresOfWekmar2017 Hodnik Python 3 100/100OK 20. apr '17 @ 17:02

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

Ocenjevani program (hodnik3.py):
inp = input()
l = len(inp)
A = "01"*(l//2)
B = "10"*(l//2)
if l%2 == 1:
    A += "0"
    B += "1"

q, w = 0, 0
for i,x in enumerate(inp):
    if A[i] != x:
        q += 1
    if B[i] != x:
        w += 1
print(min(q,w))