Rezultati

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

Test Točke Porabljen spomin Porabljen čas Status
#1 5/5 8,488 MiB 0,000 s OK
#2 5/5 8,660 MiB 0,000 s OK
#3 5/5 8,492 MiB 0,000 s OK
#4 5/5 8,496 MiB 0,000 s OK
#5 5/5 8,664 MiB 0,000 s OK
#6 5/5 8,492 MiB 0,000 s OK
#7 5/5 8,492 MiB 0,000 s OK
#8 5/5 8,652 MiB 0,000 s OK
#9 6/6 8,488 MiB 0,000 s OK
#10 6/6 8,648 MiB 0,000 s OK
#11 6/6 8,652 MiB 0,000 s OK
#12 6/6 8,656 MiB 0,000 s OK
#13 6/6 8,656 MiB 0,000 s OK
#14 6/6 8,555 MiB 0,000 s OK
#15 6/6 8,559 MiB 0,000 s OK
#16 6/6 8,582 MiB 0,000 s OK
#17 6/6 8,660 MiB 0,000 s OK
#18 6/6 8,492 MiB 0,000 s OK

Ocenjevani program (sveti_gral.py):
n = int(input().strip())

dolz = len(str(n))


def vsota_stevk(x):
    strx = str(x)
    vsota = 0
    for m in strx:
        vsota += int(m)
    return vsota

stevila = []
start = n-9*dolz
if start <= 0:
    start = 0
for i in range(start, n):
    if vsota_stevk(i)+i == n:
        stevila.append(i)

print(len(stevila))
for st in stevila:
    print(st)