上一页 1 2 3 4 5 6 ··· 12 下一页
摘要: /*ID: neverchanjePROG:LANG: C++11*/#include#include#include#include#include#include#include#include#include#define INF 0Xfffffffff#define st_size (1>c... 阅读全文
posted @ 2014-05-24 11:09 neverchanje 阅读(256) 评论(0) 推荐(0) 编辑
摘要: hdu1021int main(n){ for(;~scanf("%d",&n);) if(n-2)%4==0) puts("yes"); else puts("no"); return 0;}View Codenefu115 方法跟上... 阅读全文
posted @ 2014-05-21 19:27 neverchanje 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 节约状态数,排除一些情况:poj3254 最多12*12的网格,按行递推的话至多有2^12次方的状态数 dp(i,S) = sum( dp(i-1,S') ) 前提是 S与S'不冲突 即(S&S'=0) 但是这样枚举S和S'就需要 2^24,这样就过大了 可以发现,一行中两两不相邻的时候有 S... 阅读全文
posted @ 2014-05-19 18:53 neverchanje 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 嵌套矩形先对矩形的长从大到小排列,长相同对宽从大到小排列(可证明不能不对宽排列),然后求LISdp[i] = max( dp[j] ) + w[i] ( j#include#include#include#include#include#include#include#include#include... 阅读全文
posted @ 2014-05-14 10:42 neverchanje 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 自己学校OJ上题目的结题报告在网上很难找,所以好歹先贴几个地址:http://acm.seu.edu.cn/oj校赛题: 特殊的树 这题貌似只能Kruskal,不能prim,虽然同是贪心,但前者每次取最短边,而后者每次取总权值增加最小的边#include#include#include#inclu... 阅读全文
posted @ 2014-04-08 23:56 neverchanje 阅读(590) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 12 下一页