Ignatius and the Princess II hdu 1027
2011-08-26 02:08
351 查看
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <algorithm> using namespace std; int str[11000]; int main( ) { int N, M, i, j; while ( scanf("%d%d", &N, &M) != EOF) { for ( i = 1; i <= N; i++) str[i-1] = i; //默认已经是第1小了 int num = 0; while( num < M - 1 ) { next_permutation(str, str + N); num++; } printf("%d",str[0]); for(i = 1; i < N; i++) printf(" %d",str[i]); puts(""); } return 0; }
相关文章推荐
- hdu 1027 Ignatius and the Princess II
- hdu 1027 Ignatius and the Princess II
- hdu 1027 ignatius and the princess ii
- HDU 1027 Ignatius and the Princess II
- HDU 1027 Ignatius and the Princess II(stl,next_permutation)
- HDU 1027 Ignatius and the Princess II 全排列
- HDU1027——Ignatius and the Princess II(全排列)
- 排列-hdu_1027_Ignatius and the Princess II
- hdu 1027 Ignatius and the Princess II
- hdu 1027 Ignatius and the Princess II (全排列)
- HDU 1027 Ignatius and the Princess II
- HDU 1027 Ignatius and the Princess II(求由1-n组成按字典序排序的第m个序列)
- hdu 1027 Ignatius and the Princess II
- HDU-1027 Ignatius and the Princess II
- hdu 1027 Ignatius and the Princess II (dfs+剪枝)?
- hdu 1027 Ignatius and the Princess II
- HDU——1027Ignatius and the Princess II(next_permutation函数)
- Ignatius and the Princess II hdu 1027
- HDU 1027 Ignatius and the Princess II
- HDU 1027 Ignatius and the Princess II 选择序列题解