Rezultati

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

Test Točke Porabljen spomin Porabljen čas Status
#1 5/5 8,664 MiB 0,000 s OK
#2 5/5 8,488 MiB 0,000 s OK
#3 5/5 8,594 MiB 0,000 s OK
#4 5/5 8,512 MiB 0,000 s OK
#5 5/5 8,660 MiB 0,000 s OK
#6 5/5 8,559 MiB 0,000 s OK
#7 5/5 8,559 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,496 MiB 0,000 s OK
#11 6/6 8,656 MiB 0,000 s OK
#12 6/6 8,496 MiB 0,000 s OK
#13 6/6 8,652 MiB 0,000 s OK
#14 6/6 8,594 MiB 0,000 s OK
#15 6/6 8,492 MiB 0,000 s OK
#16 6/6 8,645 MiB 0,000 s OK
#17 6/6 8,570 MiB 0,000 s OK
#18 6/6 8,656 MiB 0,000 s OK

Ocenjevani program (grail.py):
import sys

def sum_cif(n):
	s=0
	p=n
	while p>=10:
		s+=p%10
		p=p//10
	return s+p

		



b=0
l=[]
n=int(sys.stdin.readline())
for i in range(n-9*len(str(n)),n):
	if sum_cif(i)+i==n:
		b+=1
		l.append(i)
print(b)
for i in l:
	print(i)