Rezultati

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

Test Točke Porabljen spomin Porabljen čas Status
#1 10/10 8,645 MiB 0,000 s OK
#2 10/10 8,602 MiB 0,000 s OK
#3 10/10 8,590 MiB 0,000 s OK
#4 10/10 8,539 MiB 0,000 s OK
#5 10/10 8,617 MiB 0,000 s OK
#6 10/10 8,629 MiB 0,000 s OK
#7 10/10 8,547 MiB 0,000 s OK
#8 10/10 8,617 MiB 0,000 s OK
#9 10/10 8,594 MiB 0,000 s OK
#10 10/10 8,629 MiB 0,000 s OK

Ocenjevani program (tiest.py):
import sys
f = sys.stdin

lines = f.read().strip().split('\n')
ret = []
comp1 = []
comp2 = []
for line in lines:
    l = len(line)
    
    for c in line:
        ret.append(int(c))
for i in range(l):
    if i%2==0:
        comp1.append(0)
    else:
        comp1.append(1)
for i in range(l):
    if i%2==0:
        comp2.append(1)
    else:
        comp2.append(0)        
m1=0
m2=0
for i in range(l):
    if ret[i]-comp1[i]!=0:
        m1+=1
for i in range(l):
    if ret[i]-comp2[i]!=0:
        m2+=1
print(min(m1,m2))        
f.close()