
递归
文章平均质量分 79
01的世界
有时,失去了才懂得珍惜
展开
-
例题 6-11 四分树 UVa 297
Quadtrees A quadtree is a representation format used to encode images. The fundamental idea behind the quadtree is that any image can be split into four quadrants. Each quadrant may agai原创 2015-09-18 12:22:04 · 450 阅读 · 0 评论 -
例题6-4 破损的键盘 UVa 11988
题意:字符'['表示句首,就是光标移到了句首,’】‘表示句尾分析:这题看到有人用双端队列,把[加入队首,】加入队尾,再按照队列中的顺序输出#include #include #include #include #include using namespace std;char str[100010];int main(){ // freopen("f.txt","r",原创 2015-09-16 08:58:26 · 785 阅读 · 0 评论 -
例题6-9 天平 UVa 839 递归
Not soMobile Before being an ubiquous communications gadget, amobile was just a structure made of strings and wiressuspending colourfull things. This kind of mobile is usually foundhanging over crad原创 2015-09-18 10:32:55 · 388 阅读 · 0 评论 -
例题 6-12 油田 UVa 572 用dfs求连通块
572 - Oil DepositsTime limit: 3.000 secondsOil DepositsThe GeoSurvComp geologic survey company is responsible fordetecting underground oil deposits. GeoSurvComp works with onelarge r原创 2015-09-18 22:25:04 · 684 阅读 · 0 评论 -
hdu 3652 数位DP+dfs记忆化搜所
题目:点击打开链接题意:求小于n且是13的倍数而且含有'13'.参考这个:点击打开链接#include #include #include #include using namespace std;int bit[15],dp[15][15][3];int dfs(int pos,int mod,int have,int lim){ int num,i,原创 2015-08-27 20:46:17 · 335 阅读 · 0 评论 -
例题 7-5 困难的串 UVa129
题目:点击打开链接题意:书上195页有详细解释#include#include#include#include#includeusing namespace std;int cnt ,n , L;char s[1000];int dfs(int cur){ if (cnt++ == n) { for (int i = 0; i < cur; i原创 2015-08-23 17:05:30 · 596 阅读 · 0 评论