12 2016 档案

摘要:BC: C 1003 1004 codeforces:Codeforces Round #385 (Div. 2) D E 北航:几个题都值得一做 其他:补完矩阵快速幂,然后水了道经典质数背包。 唉。又没做BZOJ。 阅读全文
posted @ 2016-12-19 00:38 cxhscst2 阅读(105) 评论(0) 推荐(0)
摘要:题目链接 Alyona and a tree 比较考验我思维的一道好题。 首先,做一遍DFS预处理出$t[i][j]$和$d[i][j]$。$t[i][j]$表示从第$i$个节点到离他第$2^{j}$近的祖先,$d[i][j]$表示从$i$开始到$t[i][j]$的路径上的路径权值总和。 在第一次D 阅读全文
posted @ 2016-12-15 20:26 cxhscst2 阅读(282) 评论(0) 推荐(0)
摘要:枚举第一行第一个格子的状态(有雷或者无雷,0或1),然后根据第一个格子推出后面所有格子的状态。推出之后判断解是否可行即可。 #include using namespace std;#define REP(i,n) for(int i(0); i = (b); -... 阅读全文
posted @ 2016-12-15 20:18 cxhscst2 阅读(135) 评论(0) 推荐(0)
摘要:非常简单的DP题。类似背包的操作,按照音量改变值进行状态转移即可。 #include using namespace std;#define REP(i,n) for(int i(0); i = (b); --i)#define for_edge(i,x) ... 阅读全文
posted @ 2016-12-15 20:15 cxhscst2 阅读(159) 评论(0) 推荐(0)
摘要:差不多可以说是树链剖分的模板题了,直接维护即可。 #include using namespace std;#define REP(i,n) for(int i(0); i = (b); --i)#define for_edge(i,x) ... 阅读全文
posted @ 2016-12-15 20:11 cxhscst2 阅读(122) 评论(0) 推荐(0)