UVA 729 - The Hamming Distance Problem
来源:互联网 发布:银行家算法例题ppt 编辑:程序博客网 时间:2024/06/05 17:08
下一个排列!next_permutation
#include<cstdio>#include<string>#include<algorithm>using namespace std;int main(){ int cas,n,h,a[19]; scanf("%d",&cas); while(cas--) { scanf("%d %d",&n,&h); for(int i=0;i<n-h;i++) { a[i]=0; printf("%d",a[i]); } for(int i=n-h;i<n;i++) { a[i]=1; printf("%d",a[i]); } putchar('\n'); while(next_permutation(a,a+n)) { for(int i=0;i<n;i++) printf("%d",a[i]); putchar('\n'); } if(cas) putchar('\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
- 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
- 2013阿里巴巴校园招聘笔试(大题,无解答)
- 链表合并算法
- Matlab中fft与fftshift命令的小结与分析
- 我的行业网站如何月挣7万
- 剑指offer面试题28字符串的所有排列permutation
- UVA 729 - The Hamming Distance Problem
- Ubuntu 12.10 显示隐藏文件
- Android中引入第三方Jar包的方法(java.lang.NoClassDefFoundError解决办法)
- Android Tasker应用之自动查询并显示话费流量套餐信息
- CitrusEngine系列教程二:结合starling和Box2D开发游戏
- Android用PopupWindow实现新浪微博的分组信息
- 新版新浪微博api使用问题及相关解决办法
- Linux 文件权限 变成制度 readonly 解决方法: mount -o remount -rw /
- 同样的css在html中与jsp中不一样【解决】