hdu1342
来源:互联网 发布:linux 查看外网ip地址 编辑:程序博客网 时间:2024/04/26 03:41
蒟蒻的自我拯救...
#include <cstdio>#include <algorithm>#include <cstring>#include <iostream>int k ;int num[20] ;int ans[6] ;void dfs(int idx, int n){ int i ; if (n == 6) { for(i = 0 ; i < n ; i++) if (i == 0) printf("%d",ans[i]) ; else printf (" %d", ans[i]) ; printf ("\n") ; return ; } for (i = idx ; i < k + n - 5; i++) { ans[n] = num[i] ; dfs(i+1,n+1) ; }}int main (){ int i ; int flag = 0 ; while (~scanf ("%d", &k),k) { for(i=0;i<k;i++) scanf("%d", &num[i]) ; if (flag == 0) flag = 1; else printf ("\n") ; dfs (0,0) ; } return 0 ;}
0 0
- hdu1342
- Hdu1342 Lotto
- Lotto hdu1342
- HDU1342 Lotto
- hdu1342&poj2245Lotto - dfs
- HDU1342 Lotto 【深搜】
- hdu1342 && poj 2245 Lotto
- hdu1342 lotto【组合数DFS】
- 线段树题目 汇总 讲解(by not only success)
- 使用XCode6打开项目以后再用XCode5出现的问题fatal error: malformed or corr
- WCF服务在IIS发布时遇到的一些配置问题
- unity3d导入jar包发布出现错误No resource found that matches the given name 'Theme.AppCompat.Light'.
- JavaLearing: JAVA IO BufferedReader
- hdu1342
- 【转】POJ 3264 线段树解法
- cocos2dx 3.x Button的认识
- MFC中修改对话框ID时,向导中无法显示所有的控件ID
- Java多线程之任务执行架构
- hdu 4891 The Great Pan
- 苹果官方文档:理解和分析ios应用崩溃日志
- NYOJ206---求余数
- Java Servlet Specification 3.0之回顾