uva 729 - The Hamming Distance Problem
来源:互联网 发布:淘宝哪里给买家评价 编辑:程序博客网 时间:2024/06/05 19:23
注意一的个数是第一个数减第二个数。
#include<iostream>#include<cstring>#include<algorithm>using namespace std;int main(){ int n; char str[1000]; cin>>n; while(n--) { memset(str,0,sizeof(str)); int len,zero_num; cin>>len>>zero_num; for(int i=0; i<len-zero_num; i++) str[i]='0'; for(int i=len-zero_num; i<len; i++) str[i]='1'; str[len]='\0'; cout<<str<<endl; while(next_permutation(str,str+len)) cout<<str<<endl; if(n)cout<<endl; } 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
- 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
- 用fgetc读文件,用fputc写文件
- 浏览器插件之ActiveX开发(四)
- 学习opencv 第二章 习题5答案
- c#中TextBox输入提示功能
- one or more breakpoints could not be set and have been disable
- uva 729 - The Hamming Distance Problem
- SVN 版本服务器搭配全过程详解(含服务端、客户端)
- Hibernate hql 查询指定字段并获取结果集
- AJAX实现无刷新分页(三层\存储过程\WebService\AJAX\Jquery)
- 挖雷游戏的概率
- Spring Quartz 集成基于数据库持久化出现错误的解决
- 前端视界:2012年度最独特的网页设计作品展示《中篇》
- For All Entries In - 你应该知道的
- VB.net Wcf事件广播(订阅、发布)