Rezultati

Up. imeNalogaJezikRezultatČas oddaje
JayZCrew Hodnik Python 3 100/100OK 20. apr '17 @ 16:37

Test Točke Porabljen spomin Porabljen čas Status
#1 10/10 8,375 MiB 0,000 s OK
#2 10/10 8,352 MiB 0,000 s OK
#3 10/10 8,367 MiB 0,000 s OK
#4 10/10 8,363 MiB 0,000 s OK
#5 10/10 8,363 MiB 0,000 s OK
#6 10/10 8,371 MiB 0,000 s OK
#7 10/10 8,410 MiB 0,000 s OK
#8 10/10 8,340 MiB 0,000 s OK
#9 10/10 8,352 MiB 0,000 s OK
#10 10/10 8,379 MiB 0,000 s OK

Ocenjevani program (naloga1.py):
import sys

def minklik(niz):
    resa = 0
    resb = 0
    for i,j in enumerate(niz):
        if j == "0":
            if i%2 == 0:
                resb += 1
            else:
                resa += 1
        else:
            if i%2 == 0:
                resa += 1
            else:
                resb += 1
    return min(resa,resb)

niz = sys.stdin.readline()
niz = niz.strip()
print(minklik(niz))