Rezultati

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

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

Ocenjevani program (hodnik.py):
line = list(input())
count = 0
for i in range(1, len(line)):
	if line[i] == line[i-1]:
		count+=1
		if line[i] == "1":
			line[i]= "0"
		else:
			line[i] = "1"
if count > (len(line)/2):
	print(len(line)-count)
else:
	print(count)