Rezultati

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

Test Točke Porabljen spomin Porabljen čas Status
#1 5/5 8,594 MiB 0,000 s OK
#2 5/5 8,660 MiB 0,000 s OK
#3 5/5 8,563 MiB 0,000 s OK
#4 5/5 8,660 MiB 0,000 s OK
#5 5/5 8,559 MiB 0,000 s OK
#6 5/5 8,496 MiB 0,000 s OK
#7 5/5 8,594 MiB 0,000 s OK
#8 5/5 8,445 MiB 0,000 s OK
#9 6/6 8,676 MiB 0,000 s OK
#10 6/6 8,488 MiB 0,000 s OK
#11 6/6 8,660 MiB 0,000 s OK
#12 6/6 8,680 MiB 0,000 s OK
#13 6/6 8,656 MiB 0,000 s OK
#14 6/6 8,559 MiB 0,000 s OK
#15 6/6 8,555 MiB 0,000 s OK
#16 6/6 8,512 MiB 0,000 s OK
#17 6/6 8,484 MiB 0,000 s OK
#18 6/6 8,656 MiB 0,000 s OK

Ocenjevani program (nal2.py):
def sumd(x):
    c = 0
    while x > 0:
        c += x % 10
        x = x//10
    return c

n = int(input())

count = 0
res = []

start = n
while start > 0 and start + 1000 > n:
    if start + sumd(start) == n:
        count += 1
        res.append(start)
    start -= 1

res.sort()

print(count)

for e in res:
    print(e)