Rezultati

Up. imeNalogaJezikRezultatČas oddaje
bizgeci-2018 Sveti gral Python 3 100/100OK 10. maj '18 @ 16:31

Test Točke Porabljen spomin Porabljen čas Status
#1 5/5 8,586 MiB 0,000 s OK
#2 5/5 8,566 MiB 0,000 s OK
#3 5/5 8,648 MiB 0,000 s OK
#4 5/5 8,484 MiB 0,000 s OK
#5 5/5 8,484 MiB 0,000 s OK
#6 5/5 8,492 MiB 0,000 s OK
#7 5/5 8,512 MiB 0,000 s OK
#8 5/5 8,512 MiB 0,000 s OK
#9 6/6 8,484 MiB 0,000 s OK
#10 6/6 8,484 MiB 0,000 s OK
#11 6/6 8,563 MiB 0,000 s OK
#12 6/6 8,484 MiB 0,000 s OK
#13 6/6 8,582 MiB 0,000 s OK
#14 6/6 8,500 MiB 0,000 s OK
#15 6/6 8,656 MiB 0,000 s OK
#16 6/6 8,492 MiB 0,000 s OK
#17 6/6 8,656 MiB 0,000 s OK
#18 6/6 8,656 MiB 0,000 s OK

Ocenjevani program (gral.py):
n = int(input())

nn = n
eks = 1
while nn>1:
    nn /= 10
    eks += 1

zac = n - eks*9
zac = max((0,zac))

kon = n

def stevke(k):
    S = 0
    while k>0:
        S+=k%10
        k=k//10
    return S

R = []

for i in range(zac,kon):
    if(i + stevke(i)) == n:
        R.append(i)


print(len(R))
for j in R:
    print(j)