会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
颜威的博客
专注移动开发
博客园
首页
新随笔
联系
订阅
管理
2014年11月5日
POJ-2663-Tri Tiling
摘要: 解题报告:1、subproblems:2、A(n) = A(n-2) + 2 * B(n-1)3、B(n) = A(n-1) + D(n-1)4、D(n) = B(n-1)4、由此可得:A(n) = A(n-2) + 2 * B(n-1)A(n) = 3*A(n-2) + 2 * B(n-3)A(n...
阅读全文
posted @ 2014-11-05 14:33 颜威
阅读(219)
评论(0)
推荐(0)
2014年10月23日
UVa-712-S-Trees
摘要: AOAPC I: Beginning Algorithm Contests (Rujia Liu)::Volume 2. Data Structures::Binary Trees解题报告:1、题目太长了,差点失去耐心。:)2、其实无非就是顺着树走,找到叶子的值,不要被那个函数迷惑。3、往左走为0,...
阅读全文
posted @ 2014-10-23 13:24 颜威
阅读(106)
评论(0)
推荐(0)
2014年10月18日
POJ-1321-棋盘问题
摘要: 解题报告:1、逐行放置,则仅需考虑列是否冲突。2、注意在出口处恢复被修改的值。AC代码:#include #include using namespace std;int n, k, ans;int col[10];char chess[10][10];void dfs(int row, int n...
阅读全文
posted @ 2014-10-18 20:22 颜威
阅读(82)
评论(0)
推荐(0)
2014年10月15日
POJ-2488-A Knight's Journey
摘要: 解题报告:1、DFS遍历,并且记录走过的路径(先数字代替),不重复地全部走完。2、需要按照字典序输出,注意方向数组的方向顺序,并且从A1开始搜索。3、DFS的参数用于记录状态转移量(x,y)和递归的深度(step)。4、使用全局变量简化程序的设计。AC代码:#include #include #de...
阅读全文
posted @ 2014-10-15 21:46 颜威
阅读(249)
评论(0)
推荐(0)
2014年9月28日
UVa-409-Excuses, Excuses!
摘要: AOAPC I: Beginning Algorithm Contests (Rujia Liu)::Volume 1. Elementary Problem Solving::String// 409 - Excuses, Excuses!#include #include #include in...
阅读全文
posted @ 2014-09-28 15:42 颜威
阅读(194)
评论(0)
推荐(0)
2014年9月27日
UVa-674-Coin Change
摘要: AOAPC I: Beginning Algorithm Contests (Rujia Liu)::Volume 5. Dynamic Programming// 674 - Coin Change#include #include #define MAXN 7500using namespace...
阅读全文
posted @ 2014-09-27 12:28 颜威
阅读(125)
评论(0)
推荐(0)
2014年9月25日
UVa-10763-Foreign Exchange
摘要: AOAPC I: Beginning Algorithm Contests (Rujia Liu)::Volume 4. Algorithm Design// 10763 - Foreign Exchange#include #define MAXN 500000using namespace st...
阅读全文
posted @ 2014-09-25 17:09 颜威
阅读(181)
评论(0)
推荐(0)
UVa-10714-Ants
摘要: AOAPC I: Beginning Algorithm Contests (Rujia Liu)::Volume 4. Algorithm Design// 10714 - Ants#include #include using namespace std;int a[1000001];int m...
阅读全文
posted @ 2014-09-25 00:05 颜威
阅读(149)
评论(0)
推荐(0)
2014年9月24日
UVa-10341-Solve It
摘要: AOAPC I: Beginning Algorithm Contests (Rujia Liu)::Volume 4. Algorithm Design// 10341 - Solve It#include #include #define EPS 1e-7 // 精度要求苛刻...in...
阅读全文
posted @ 2014-09-24 22:54 颜威
阅读(131)
评论(0)
推荐(0)
2014年9月18日
UVa-133-The Dole Queue
摘要: AOAPC I: Beginning Algorithm Contests (Rujia Liu)::Volume 2. Data Structures::Lists// 133 - The Dole Queue#include #include typedef struct node{ int n...
阅读全文
posted @ 2014-09-18 10:19 颜威
阅读(162)
评论(0)
推荐(0)
下一页
公告