Lucky Permutation (Codeforces 121C)
http://codeforces.com/problemset/problem/121/C
問題
n桁のk-th permutationはlucky numberがlucky numberの位置に何個あるか答えよ。
1<=n,k<=10^9
解法
k<=10^9なんで後ろの15個くらいしか並べ替えはおこらない。あとはやるだけ。
http://codeforces.com/problemset/problem/121/C
n桁のk-th permutationはlucky numberがlucky numberの位置に何個あるか答えよ。
1<=n,k<=10^9
k<=10^9なんで後ろの15個くらいしか並べ替えはおこらない。あとはやるだけ。