Rezultati

Up. imeNalogaJezikRezultatČas oddaje
kjejenovictk-2018 Niz Python 3 100/100OK 19. apr '18 @ 16:46

Test Točke Porabljen spomin Porabljen čas Status
#1 10/10 8,320 MiB 0,000 s OK
#2 10/10 8,316 MiB 0,000 s OK
#3 10/10 9,102 MiB 0,000 s OK
#4 10/10 9,266 MiB 0,000 s OK
#5 10/10 9,195 MiB 0,000 s OK
#6 10/10 9,105 MiB 0,000 s OK
#7 10/10 9,215 MiB 0,000 s OK
#8 10/10 9,211 MiB 0,000 s OK
#9 10/10 9,102 MiB 0,000 s OK
#10 10/10 9,109 MiB 0,000 s OK

Ocenjevani program (Niz.py):
import sys

vrstice = sys.stdin.readlines()

# with open("test","r") as f:
#     vrstice = f.readlines()

niz = list(vrstice[1].strip())

stevilo = 0
for i in range(2,len(niz)):
    if niz[i-2] == "0" and niz[i-1] == "1" and niz[i] == "0":
        niz[i] = "1"
        stevilo += 1

print(stevilo)