1962021-02-06 11:37:29Molnár AttilaOszthatóság 31-gyelpython3Wrong answer 25/5041ms13348 KiB
from sys import stdin, stdout

s=0
r=0
l=[]

def oszt31():
  global l,s,r
  l.append(s)
  (s,r) = divmod(s,10)
  s-=3*r
  if (s<=0): # 27 = 3*9, a legnagyobb kivonható összeg
    return s==0
  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:]:
    stdout.write(f'{e} ')
  if not b:
    stdout.write('\n')

main()
SubtaskSumTestVerdictTimeMemory
base25/50
1Accepted0/041ms13188 KiB
2Accepted0/034ms13124 KiB
3Accepted3/330ms13232 KiB
4Wrong answer0/329ms13324 KiB
5Wrong answer0/430ms13232 KiB
6Accepted4/430ms13272 KiB
7Accepted4/428ms13304 KiB
8Wrong answer0/428ms13244 KiB
9Wrong answer0/428ms13240 KiB
10Accepted4/435ms13300 KiB
11Wrong answer0/429ms13348 KiB
12Accepted4/429ms13324 KiB
13Accepted4/432ms13312 KiB
14Wrong answer0/429ms13260 KiB
15Wrong answer0/228ms13264 KiB
16Accepted2/237ms13320 KiB