上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 17 下一页

2015年7月23日

摘要: 八数码问题,用的A*解决,但是数据太强A不了。。。TLE只能在POJ上先过一发了。#include #include #include #include #include #include #include #include #include using namespace std... 阅读全文
posted @ 2015-07-23 15:58 JeremyGuo 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 首先就是f(n)=g(n)+h(n)这个h(n)就是估价函数,然后每次更新一下g(n)然后用康托展开,搞一下判重就好了。#include #include #include #include #include using namespace std;const int MAXVIS... 阅读全文
posted @ 2015-07-23 13:37 JeremyGuo 阅读(387) 评论(0) 推荐(0) 编辑
摘要: 先找连通图,然后检查是否是二分图注意如果是在线的算法记得要清空Color数组因为存在一种情况儿子中含有两个连通图,那么自己儿子中就会存在一个割点已经被染了色,就有可能存在冲突。#include #include #include #include #include #include... 阅读全文
posted @ 2015-07-23 11:08 JeremyGuo 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 直接搜索从0开始一直到1,然后搜索过程中只能有一个分母大于m所以,如果当前是sum,已经枚举了k个那么sum+n−km>1这种情况显然不成立,还有就是当sum+n−k+1ak−1#include #include #define MAXN 10using namespace std... 阅读全文
posted @ 2015-07-23 08:37 JeremyGuo 阅读(143) 评论(0) 推荐(0) 编辑

2015年7月22日

摘要: 其实就是枚举每一个邮票的面值记得保持严格递增,然后DP判断每一次最多能够凑出1-哪个面值的邮票,然后下限显然就是前面一张邮票的面值+1,上限是当前能够凑出的邮票的面值+1因为显然如果当前最大为n那么如果这张面值为n+2那么显然n+1不能由原来的组合构成(原来只能弄出n)那么现在新加... 阅读全文
posted @ 2015-07-22 15:49 JeremyGuo 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 题目http://blog.csdn.net/JeremyGJY/article/details/50611568 首先把每一个式子上的字母按照从右到左,从上到下的顺序存储下来,依次枚举每一个字母分别代表哪一个数字,然后每一次check一下当前的方案是否可行,只用考虑当前一列三个数... 阅读全文
posted @ 2015-07-22 15:19 JeremyGuo 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 实际上就是另f(Dep,Sum)表示当前已经算到了第i位,然后当前得到的值是Sum的所有的方案数量,那么可以发现∑xDep−1=1Mf(Dep−1,Sum−kDep×xPDepDep)=f(Dep,Sum)=∑xDep+1=1Mf(Dep+1,Sum+kDep+1×xPDep+1D... 阅读全文
posted @ 2015-07-22 15:15 JeremyGuo 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 就是按照一个点作为根然后再这上面搞一下寻找割点,如果找到了,判断另一个点是不是在当前的割点的子树中(是相对于当前子树而言是一个割点)。如果在,那么就更新ans为最小值就行了#include #include #include #include #include using name... 阅读全文
posted @ 2015-07-22 09:11 JeremyGuo 阅读(155) 评论(0) 推荐(0) 编辑

2015年7月21日

摘要: 就是纯暴力,每次枚举起点中点和向后移动的步数,加上if(dif(now) + 3 * (u-1) > 3 * maxd) return false;优化dif(now)表示每一位的后面是否是正确的#include #include #include using namespace ... 阅读全文
posted @ 2015-07-21 09:38 JeremyGuo 阅读(151) 评论(0) 推荐(0) 编辑

2015年7月17日

摘要: 其实就是枚举一下每一次左边的用那些右边的用那些,处理一下当前所有组合的左端点和又短点就行了#include #include #include #include #include using namespace std;const int MAXN = 6;typedef pair... 阅读全文
posted @ 2015-07-17 22:27 JeremyGuo 阅读(139) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 17 下一页

导航