Rezultati

Up. imeNalogaJezikRezultatČas oddaje
TDT-2018 Sveti gral Python 3 100/100OK 10. maj '18 @ 17:23

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

Ocenjevani program (svetigral.py):
from sys import stdin

N = int(stdin.readline().strip())

c = 0
resitve = []

m = N - len(str(N)) * 9
if m < 0:
    m = 0

for i in range(m, N):
    l = str(i)
    vsota = sum([int(l[j]) for j in range(0, len(l))])

    if vsota + i == N:
        c += 1
        resitve.append(i)

print(c)
for r in resitve:
    print(r)