uva729 The Hamming Distance Problem
来源:互联网 发布:java swing 开源项目 编辑:程序博客网 时间:2024/06/06 03:17
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[n] = '\0';printf("%s\n", sb);while (next_permutation(sb, sb + n)){printf("%s\n", sb);}if(t)printf("\n");}return 0;}
- UVa729 The Hamming Distance Problem
- uva729 The Hamming Distance Problem
- The Hamming Distance Problem UVA729
- UVA729 The Hamming Distance Problem
- uva729 The Hamming Distance Problem
- UVa729 - The Hamming Distance Problem(全排列)
- uva729 - The Hamming Distance Problem(Hamming距离问题)
- 729--The Hamming Distance Problem
- JOJ1466:The Hamming Distance Problem
- 729 - The Hamming Distance Problem
- 729 - The Hamming Distance Problem
- 729 - The Hamming Distance Problem
- UVaOJ729---The Hamming Distance Problem
- The Hamming Distance Problem-uva
- UVa 729 The Hamming Distance Problem
- UVaOJ 729 - The Hamming Distance Problem
- UVa 729 - The Hamming Distance Problem
- UVA 729 - The Hamming Distance Problem
- 第一篇
- uva10098 Generating Fast, Sorted Permutation
- java6与java5的区别
- [037] 微信公众帐号开发教程第13篇-图文消息全攻略
- 十道海量数据处理面试题与十个方法大总结
- uva729 The Hamming Distance Problem
- struts2+jquery+json集成
- Struts2的工作原理
- sgu 326——Perspective
- UVA 10474 Where is the Marble?
- ubuntu的软件中心无法打开,竟然是我的默认Python解释器的变化引起的
- POJ1160 Post Office
- x264中比特流的存储结构
- 从决策树学习谈到贝叶斯分类算法、EM、HMM