讲解康托展开与逆康托展开.http://wenku.baidu.com/view/55ebccee4afe04a1b071deaf.html #include<bits/stdc++.h> using namespace std; int fac[20]; int fun(){ fac[0]=1; int i; for(i=1;i<=12;i++){ fac[i]=fac[i-1]*i; } } int main(){ int t,i,j,c,sum,num; char str[15];…
Ignatius and the Princess II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4865 Accepted Submission(s): 2929 Problem Description Now our hero finds the door to the BEelzebub feng5166. He o…
Background\text{Background}Background The \text{The }The Listen&Say Test will be hold on May 11, so I decided to fill my blog \text{Test will be hold on May 11, so I decided to fill my blog }Test will be hold on May 11, so I decided to fill my blog …
题意 题目链接 Sol 由于阶乘的数量增长非常迅速,而\(k\)又非常小,那么显然最后的序列只有最后几位会发生改变. 前面的位置都是\(i = a[i]\).那么前面的可以直接数位dp/爆搜,后面的部分是经典问题,可以用逆康托展开计算. #include<bits/stdc++.h> #define Pair pair<int, int> #define MP(x, y) make_pair(x, y) #define fi first #define se second #def…