POJ 2245 Lotto G++
给出k个数,挑出6个,求所有组合。
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
//谢谢写书的老师
int main()
{while(1){int n;cin>>n;if(n==0){break;}vector<int> da;for(int i=0;i<n;i++){int t;cin>>t;da.push_back(t);}for(int a=0;a<n;a++){for(int b=a+1;b<n;b++){for(int c=b+1;c<n;c++){for(int d=c+1;d<n;d++){for(int e=d+1;e<n;e++){for(int f=e+1;f<n;f++){cout<<da[a]<<" "<<da[b]<<" "<<da[c]<<" "<<da[d]<<" "<<da[e]<<" "<<da[f]<<endl;}}}}}}cout<<endl;}return 0;
}
POJ 2245 Lotto G++相关推荐
- poj 2245 lotto
题目链接:http://poj.org/problem?id=2245 本题属暴力搜索(递归). 注意两个点:第一:每组测试数据后都要有空行,除非下次输入k=0.第二:输出结果时每一行的最后一个数的后 ...
- POJ 1877 Flooded! G++
#include <iostream> #include <cstdio> #include <algorithm> #include <iomanip> ...
- POJ 1838 Banana G++
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> ...
- POJ 2245 Addition Chains(算竞进阶习题)
迭代加深dfs 每次控制序列的长度,依次加深搜索 有几个剪枝: 优化搜索顺序,从大往下枚举i, j这样能够让序列中的数尽快逼近n 对于不同i,j和可能是相等的,在枚举的时候用过的数肯定不会再被填上所以 ...
- POJ 2316 SPIN G++
D位密码锁,每位有数字0到9.开始时都为0,给出数字代表每次移动对应位置次数.求最终数字. #include <iostream> using namespace std; int mai ...
- POJ 3077 Rounders G++
#include <iostream> //#include <string> using namespace std; //英文没看懂 谢谢博友的翻译 int main() ...
- POJ 1375 Intervals G++ 几何 背
#include <iostream> #include <cstdio> #include <cmath> #include <vector> #in ...
- POJ 1026 Cipher G++
#include <iostream> #include <cstring> #include <cstdio> using namespace std; //抄博 ...
- POJ前面的题目算法思路【转】
1000 A+B Problem 送分题 49% 2005-5-7 1001 Exponentiation 高精度 85% 2005-5-7 1002 487-3279 n/a 90% 2005-5- ...
最新文章
- 关系型数据库设计要领(值得收藏)
- 零代码实战 SharePoint 2013 BCS:三、实干篇
- 谈PC安全经验:杀毒八大错误观念
- 27.思科防火墙(ASA)
- kvm连接服务器显示不全有重影,KVM延长器系列常见问题及解决方法
- 【OS学习笔记】二十一 保护模式六:保户模式下操作系统内核如何加载用户程序并运行 对应的汇编代码之内核代码
- bpl开发模式_BPL的完整形式是什么? 什么是电力线宽带
- System Center 2016 Data Protection Manager 部署手册
- Kali Linux渗透测试实战 1.3 渗透测试的一般化流程
- Linux内核探索之路——关于方法
- 针式打印机风格英文字体_可爱漂亮的圣诞节和新年贺卡艺术字体推荐!
- 【离散数学】相关概念_01
- [ 原创 ] 概念01--中国财政真相:25省负债 全国只有6省1市在赚钱
- 漫画:互联网公司会议观察
- 深圳中科院计算机研究所,专家人才库数据----中国科学院计算技术研究所
- Hack The Box——Traceback
- 家庭NAS服务器(1)服务器的配置与选择
- 黑科技手机计算机,轻量又好用的黑科技APP,绝对能让你的手机能量满满!
- Automated pulmonary nodule detection in CT images using deep convolutional neural networks
- python爬取MOOC课程信息
热门文章
- Apollo path_bounds_decider解析
- 【思维导图】零基础如何把握Python学习方向
- 一件代发分销商城系统怎么规避拼多多、淘宝、抖店对无货源的限制,还能继续做无货源代发
- 在传统连连看游戏的基础上设计出新游戏增量式的创新(结对编程)(2011212026徐颖 2011212023 裴乐)
- 数据在网络中是如何传输的
- Pspice积分线路仿真问题汇总(压控电压源模拟理想运放)
- 在线工具, 在线网站, 好东西
- 在Windows Server 2008系统环境下无损调整分区
- 2021年科技园区规划设计方案
- 软件外包市场发展现状分析