Rezultati

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

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

Ocenjevani program (hodnik.py):
line = input()
n = len(line)
s = 0
for i in range(n):
    if line[i] == '0' and i % 2 == 1:
        s += 1
        
    if line[i] == '1' and i % 2 == 0:
        s += 1

t = 0
for i in range(n):
    if line[i] == '1' and i % 2 == 1:
        t += 1
        
    if line[i] == '0' and i % 2 == 0:
        t += 1
        
print(min(s, t))