ICUP by hallvabo

while 1:
 n=input();x=a=['_']*n;R=range(n);i=y=0
 while x>1:i+=1;a[-y]=`i`;x,y=max(min((abs(j-k),-j)for k in R if'_'>a[k])for j in R)
 print"%u:"%n,' '.join(a)

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

download

return to the top page