factoradic conversion

a guest May 20th, 2013 60 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand