Rezultati

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

Test Točke Porabljen spomin Porabljen čas Status
#1 5/5 8,656 MiB 0,000 s OK
#2 5/5 8,563 MiB 0,000 s OK
#3 5/5 8,488 MiB 0,000 s OK
#4 5/5 8,488 MiB 0,000 s OK
#5 5/5 8,586 MiB 0,000 s OK
#6 5/5 8,484 MiB 0,000 s OK
#7 5/5 8,586 MiB 0,000 s OK
#8 5/5 8,656 MiB 0,000 s OK
#9 6/6 8,594 MiB 0,000 s OK
#10 6/6 8,559 MiB 0,000 s OK
#11 6/6 8,664 MiB 0,000 s OK
#12 6/6 8,508 MiB 0,000 s OK
#13 6/6 8,656 MiB 0,000 s OK
#14 6/6 8,477 MiB 0,000 s OK
#15 6/6 8,531 MiB 0,000 s OK
#16 6/6 8,656 MiB 0,000 s OK
#17 6/6 8,590 MiB 0,000 s OK
#18 6/6 8,680 MiB 0,000 s OK

Ocenjevani program (tiest.py):
import sys
f = sys.stdin
#f = open("test.txt", "r")

lines = f.read().strip().split("\n")
n = int(lines[0])

x = (5*n)%9
lista = []
if n>100:
    i = n-100
else:
    i=x
def sum_d(y):
    ret= y
    while y != 0: 
        ret += y%10
        y=y//10
    return ret

while i<n+1:
    if sum_d(i) == n:
        lista.append(i)
    i = i+1   

print(len(lista))
for i in lista:
    print(i)
f.close()