Rezultati

Up. imeNalogaJezikRezultatČas oddaje
veseleveverce-2018 Niz Python 3 100/100OK 19. apr '18 @ 17:02

Test Točke Porabljen spomin Porabljen čas Status
#1 10/10 8,746 MiB 0,000 s OK
#2 10/10 8,746 MiB 0,000 s OK
#3 10/10 9,613 MiB 0,000 s OK
#4 10/10 9,457 MiB 0,000 s OK
#5 10/10 9,602 MiB 0,000 s OK
#6 10/10 9,547 MiB 0,000 s OK
#7 10/10 9,605 MiB 0,000 s OK
#8 10/10 9,609 MiB 0,000 s OK
#9 10/10 9,602 MiB 0,000 s OK
#10 10/10 9,453 MiB 0,000 s OK

Ocenjevani program (niz111.py):
aaa = []
import fileinput
for line in fileinput.input():
    aaa.append(line)
    if len(aaa) == 2:
        break

n = int(aaa[0])
inputt = aaa[1]
lista_inputa = list(inputt)
stevc = 0

for i in range(n-2):
    if lista_inputa[i] == "0" and lista_inputa[i+1] == "1" and lista_inputa[i+2] == "0":
        lista_inputa[i+2] = "1"
        stevc += 1

print(stevc)




"""
nizek = inputt[i:i+3]
    print(nizek)
    if nizek == "010":
        inputt.
        inputt[i+2] = "1"
        print(nizek)
#print(inputt)

"""