Power Tree by nn

function f(v)p[v+=(v&&f(p[v]),j)]=p[v]||a.push(v)&&j
p=[i=0,,1]
n=/\d+/(l=readline(a=[2]))
for(o=l<'t'?n:'';i>3e4?(o=p[n]+' '+o,n=l<'t'?p[n]:n-1)>1:f(j=a[i++]););
print(o)

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page