![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
递归
keny_fly
这个作者很懒,什么都没留下…
展开
-
暴力求解法中的枚举排列,生成全排列
**对于一个长度为n数组长度的数组={0,1,2,3,..., n-1}。要想枚举它的所有的长度为n的全排列出来。** 有两种选择:一个是直接枚举, 另外一个是使用递归构造。原创 2017-04-15 19:41:50 · 2789 阅读 · 0 评论 -
UVA-542 Prime Ring Problem
#include<cstdio>#include<iostream>#include<cstring>using namespace std;const int maxn = 1000;int prime[maxn];int A[maxn];int vis[maxn];int is_prime(int x)//生成素数{ for(int i = 2; i*i <= x; i原创 2017-05-20 09:55:47 · 207 阅读 · 0 评论 -
2017 计蒜之道 初赛 第一场 A. 阿里的新游戏
一道枚举题目, 枚举所有的组合,然后根据这些组合判断棋子在不在同一条线上#include<iostream>#include<cstring>#include<cstdio>#include<algorithm>using namespace std;struct node{ int x, y;};node ss[100], tt[4];int jj;int is_node原创 2017-05-21 00:00:43 · 338 阅读 · 0 评论