UVA 729 - The Hamming Distance Problem
来源:互联网 发布:网络的重要性的名言 编辑:程序博客网 时间:2024/06/06 00:25
题目大意:给你一个给定长度 N 的字符串,其中有 H 个 1 , 求其全排列
#include <cstdio>#include <algorithm>using namespace std;int main() {int t;scanf("%d", &t);while (t--) {int num, one;char s[20] = {0};scanf("%d%d", &num, &one);for (int i = 0; i < num ; i++)s[i] = (i >= num - one ? '1' : '0');do {puts(s);} while (next_permutation(s, s + num));if (t)printf("\n");}return 0;}
0 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
- QTimer
- 使用Vagrant在Windows下部署开发环境
- 华为CaaS开放平台产品宣传片
- php.ini配置详解(2)
- Android中的Service详解
- UVA 729 - The Hamming Distance Problem
- Linux命令和实例大全
- [140811]C++必备:掌握标准C++类 pdf
- 云计算的成熟 一段搅动IT领域的历史
- 《STL源码剖析》---stl_uninitialized阅读笔记
- jqueryMobile Loader widget 控件改造
- (12)ListView之SimpleAdapter的使用
- wikioi 1226 倒水问题
- 设置导航栏的相关属性