Guest User

factoradic conversion

a guest
May 20th, 2013
74
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. i=raw_input()
  2. a,b,x,c=((362880,'',9,'j=int(i);'+'b+=`j//a`;j%=a;a/=x;x-=1;'*9),(1,0,1,'b+=a*int(i[-x]);x+=1;a*=x;'*~-len(i)))['!'in i]
  3. exec c
  4. print int(b)
RAW Paste Data