UVa 729 - The Hamming Distance Problem
2013-05-14 09:34
316 查看
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int MAX = 16+4; int A[MAX]; int main () { #ifndef ONLINE_JUDGE freopen("in.txt", "r", stdin); #endif int T; scanf("%d", &T); while(T--) { int N, H; scanf("%d%d", &N, &H); int i; for(i=0; i<N-H; i++) A[i] = 0; for(;i<N; i++) A[i] = 1; do{ for(i=0; i<N; i++) printf("%d",A[i]); printf("\n"); }while(next_permutation(A, A+N)); if(T>0) printf("\n"); } return 0; }
相关文章推荐
- 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
- UVa729 - The Hamming Distance Problem(全排列)
- uva 729 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