1942021-02-06 10:38:25Molnár AttilaOszthatóság 31-gyelpython3Wrong answer 48/5046ms13404 KiB
from sys import stdin, stdout

s=0
r=0
l=[]

def oszt31():
  global l,s,r
  l.append(s)
  if (s<10):
    return s==0
  (s,r) = divmod(s,10)
  s-=3*r
  return oszt31()

def main():
  global l,s,r
  s = int(stdin.readline())
  b = oszt31()
  stdout.write('IGEN\n' if b else 'NEM\n')

  for e in l[1:]:
    if (0<=e):
      stdout.write(f'{e} ')
  if b:
    stdout.write('\n')

main()
SubtaskSumTestVerdictTimeMemory
base48/50
1Accepted0/046ms13236 KiB
2Accepted0/030ms13368 KiB
3Accepted3/332ms13272 KiB
4Accepted3/328ms13316 KiB
5Accepted4/429ms13300 KiB
6Accepted4/428ms13268 KiB
7Accepted4/430ms13376 KiB
8Accepted4/432ms13304 KiB
9Accepted4/428ms13388 KiB
10Accepted4/429ms13300 KiB
11Accepted4/428ms13284 KiB
12Accepted4/428ms13288 KiB
13Accepted4/428ms13328 KiB
14Accepted4/430ms13404 KiB
15Accepted2/234ms13276 KiB
16Wrong answer0/228ms13360 KiB