uva729 The Hamming Distance Problem
2013-07-20 20:21
435 查看
uva729 The Hamming Distance Problem
全排列水题存1的时候要注意位置。。。 刚开始因为这个不小心wa了
#include <algorithm> using namespace std; #include <stdio.h> #include <string.h> int t; int n, h; int i; char sb[25]; int main() { scanf("%d", &t); while (t --) { memset(sb, '0', sizeof(sb)); scanf("%d%d", &n, &h); for(i = n - 1; i > n - 1 - h; i --) { sb[i] = '1'; } sb = '\0'; printf("%s\n", sb); while (next_permutation(sb, sb + n)) { printf("%s\n", sb); } if(t) printf("\n"); } return 0; }
相关文章推荐
- UVa 729 The Hamming Distance Problem
- uva 729 The Hamming Distance Problem
- UVa729 - The Hamming Distance Problem(全排列)
- uva729 - The Hamming Distance Problem(Hamming距离问题)
- uva - 729 - The Hamming Distance Problem
- UVa 729 - The Hamming Distance Problem
- UVa 729 - The Hamming Distance Problem
- UVa729 The Hamming Distance Problem
- UVA 729 The Hamming Distance Problem
- UVa 729 - The Hamming Distance Problem
- UVa 729 - The Hamming Distance Problem (暗藏杀机的大水题!!)
- UVA 729 - The Hamming Distance Problem
- UVa 729 - The Hamming Distance Problem
- UVA 729 The Hamming Distance Problem
- uva 729 - The Hamming Distance Problem(全排列)
- UVA - 729 The Hamming Distance Problem
- UVA 729 - The Hamming Distance Problem
- uva 729 The Hamming Distance Problem
- UVa 729: The Hamming Distance Problem
- uva 729 - The Hamming Distance Problem