01 2017 档案

摘要:题目链接 Subway Innovation 首先不难想到所求的k个点一定是连续的,那么假设先选最前面的k个点,然后在O(1)内判断第2个点到第k+1个点这k个点哪个更优。 判断的时候用detla[i]来记录信息。令delta[k+1]+delta[k+2]+......+delta[k+x] = 阅读全文
posted @ 2017-01-31 20:47 cxhscst2 阅读(360) 评论(0) 推荐(0)
摘要:题目链接 Vessels 这道题我做得有点稀里糊涂啊==TLE了几发之后改了一行就A了。 具体思路就是记fi为若第i个容器已经盛不下水了,那么接下来盛水的那个容器。 hi为若现在要给i号容器加水,当前真正被加水的那个容器。 这样就大大降低了时间复杂度。 阅读全文
posted @ 2017-01-31 20:36 cxhscst2 阅读(295) 评论(0) 推荐(0)
摘要:题目链接 Hamburgers 二分答案,贪心判断即可。 阅读全文
posted @ 2017-01-31 20:25 cxhscst2 阅读(675) 评论(0) 推荐(0)
摘要:题目链接 Fox Dividing Cheese 思路:求出两个数a和b的最大公约数g,然后求出a/g,b/g,分别记为c和d。 然后考虑c和d,若c或d中存在不为2,3,5的质因子,则直接输出-1(根据题目要求) 计算出c = (2 ^ a2) * (3 ^ a3) * (5 ^ a5) d = 阅读全文
posted @ 2017-01-31 20:23 cxhscst2 阅读(258) 评论(0) 推荐(0)
摘要:题目链接 K-Periodic Array 简单题,直接模拟即可。 阅读全文
posted @ 2017-01-31 20:15 cxhscst2 阅读(280) 评论(0) 推荐(0)
摘要:题目链接:k-th divisor 求出N的第K大因子,满足N <= 10^15,K <= 10^9 直接暴力…… 阅读全文
posted @ 2017-01-29 12:55 cxhscst2 阅读(389) 评论(0) 推荐(0)
摘要:Out the cruel 2016. 阅读全文
posted @ 2017-01-28 22:25 cxhscst2 阅读(250) 评论(0) 推荐(0)
摘要:题目链接 松鼠的新家 差不多可以说是树链剖分的模板题了,直接维护即可。 阅读全文
posted @ 2017-01-26 23:51 cxhscst2 阅读(237) 评论(0) 推荐(0)
摘要:题目链接 Lesha and array splitting 设s[i][j]为序列i到j的和,当s[i][j]≠0时,即可从i跳到j+1.目标为从1跳到n+1,所以按照题意暴力即可。 阅读全文
posted @ 2017-01-26 23:39 cxhscst2 阅读(261) 评论(0) 推荐(0)
摘要:题目链接 Alyona and a tree 弄了好几个小时终于Accepted了,之后发现这个题是Div1的。 比较考验我思维的一道好题。 首先,做一遍DFS预处理出t[i][j]和d[i][j]。t[i][j]表示从第i个节点到离他第2^j近的祖先,d[i][j]表示从i开始到t[i][j]的路 阅读全文
posted @ 2017-01-26 23:36 cxhscst2 阅读(572) 评论(0) 推荐(0)
摘要:题目链接 Print Check 注意到行数加列数最大值只有几千,那么有效的操作数只有几千,那么把这些有效的操作求出来依次模拟就可以了。 阅读全文
posted @ 2017-01-26 23:26 cxhscst2 阅读(261) 评论(0) 推荐(0)
摘要:题目链接 Weak Pair 题意十分明确, 就是求出符合题意的有序点对个数。 首先对ai离散,离散之后的结果用rk[i]表示,然后进行二分预处理得到f[i],其中f[i]的意义为:其他的点和i这个节点满足weakpair要求的权值最大名次(名次权值小的排在前面)。 然后就开始跑一遍DFS,树状数组 阅读全文
posted @ 2017-01-26 21:23 cxhscst2 阅读(217) 评论(0) 推荐(0)
摘要:G. New Roads time limit per test: 2 seconds memory limit per test:256 megabytes input:standard input output:standard output G. New Roads time limit pe 阅读全文
posted @ 2017-01-26 21:16 cxhscst2 阅读(272) 评论(0) 推荐(0)
摘要:非常简单的DP题。类似背包的操作,按照音量改变值进行状态转移即可。 阅读全文
posted @ 2017-01-26 19:36 cxhscst2 阅读(234) 评论(0) 推荐(0)
摘要:枚举第一行第一个格子的状态(有雷或者无雷,0或1),然后根据第一个格子推出后面所有格子的状态。推出之后判断解是否可行即可。 阅读全文
posted @ 2017-01-26 19:31 cxhscst2 阅读(193) 评论(0) 推荐(0)
摘要:大力搜,状态用一个16位的数字表示。 阅读全文
posted @ 2017-01-26 19:28 cxhscst2 阅读(341) 评论(0) 推荐(0)
摘要:E. Pretty Song time limit per test:1 second time limit per test:1 second memory limit per test:256 megabytes memory limit per test:256 megabytes input 阅读全文
posted @ 2017-01-25 00:04 cxhscst2 阅读(320) 评论(0) 推荐(0)
摘要:寒假各种练习赛的一些回放和总结 阅读全文
posted @ 2017-01-24 23:51 cxhscst2 阅读(226) 评论(0) 推荐(0)
摘要:1.18 打第一场比赛找找感觉…… 第一场基本没什么问题,花了2.5hAK,如果不作死读错题的话可能1.5h就AK了。 1.19 Codeforces Round #392 (Div. 2) 本来想好好地打一场,结果再次狗带... 阅读全文
posted @ 2017-01-20 20:02 cxhscst2 阅读(112) 评论(0) 推荐(0)
摘要:E. Pretty Song ... 阅读全文
posted @ 2017-01-18 23:49 cxhscst2 阅读(206) 评论(0) 推荐(0)
摘要:Weak Pair Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 26... 阅读全文
posted @ 2017-01-13 10:06 cxhscst2 阅读(188) 评论(0) 推荐(0)
摘要:大力搜,状态用一个16位的数字表示。 #include using namespace std;#define rep(i,a,b) for(int i(a); i Q;int main(){ rep(i, 1, 8) scanf("%s", st[i] + 1)... 阅读全文
posted @ 2017-01-13 10:01 cxhscst2 阅读(175) 评论(0) 推荐(0)
摘要:G. New Roads ... 阅读全文
posted @ 2017-01-11 14:26 cxhscst2 阅读(181) 评论(0) 推荐(0)
摘要:设s[i][j]为序列i到j的和,当s[i][j]≠0时,即可从i跳到j+1.目标为从1跳到n+1,所以按照题意暴力即可。 #include using namespace std;#define rep(i,a,b) for(int i(a); i = (b); ... 阅读全文
posted @ 2017-01-11 14:22 cxhscst2 阅读(168) 评论(0) 推荐(0)