14102022-09-04 20:07:47ncsOszthatóság 31-gyeljuliaMemory limit exceeded 0/503ms2884 KiB
# 31-el oszthato
function solve(n)
  ret=[n]
  while true
    x,r=divrem(ret[end],10)
    x-=3r
    (x<0)&&break
    push!(ret,x)
    (x==0)&&break
  end
  ["IGEN","NEM"][1+(ret[end]%31>0)]|>println
  join(ret[2:end]," ")|>println
end
solve(parse(Int,readline()))
SubtaskSumTestVerdictTimeMemory
base0/50
1Memory limit exceeded0/03ms1636 KiB
2Memory limit exceeded0/02ms1752 KiB
3Memory limit exceeded0/32ms1980 KiB
4Memory limit exceeded0/32ms2164 KiB
5Memory limit exceeded0/42ms2300 KiB
6Memory limit exceeded0/42ms2404 KiB
7Memory limit exceeded0/42ms2468 KiB
8Memory limit exceeded0/42ms2328 KiB
9Memory limit exceeded0/42ms2396 KiB
10Memory limit exceeded0/42ms2352 KiB
11Memory limit exceeded0/42ms2516 KiB
12Memory limit exceeded0/42ms2572 KiB
13Memory limit exceeded0/42ms2568 KiB
14Memory limit exceeded0/42ms2552 KiB
15Memory limit exceeded0/22ms2804 KiB
16Memory limit exceeded0/22ms2884 KiB