摘要: 题目链接 BZOJ4540 考虑莫队算法。 这题难在$[l, r]$到$[l, r+1]$的转移。 根据莫队算法的原理,这个时候答案应该加上 $cal(l, r+1) + cal(l+1, r+1) + cal(l+2, r+1) + ... + cal(r+1, r+1)$ $cal(l, r)$ 阅读全文
posted @ 2017-10-05 23:50 cxhscst2 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 题目链接 Codefores_Gym_101164 Solved 6/11 Penalty 1652 Problem A Problem B Problem C Problem D Problem E Problem F 预处理出一个pre数组 pre[i]表示i位字母数以内用掉多少个字母 然后就可 阅读全文
posted @ 2017-10-05 17:59 cxhscst2 阅读(631) 评论(0) 推荐(0) 编辑
摘要: 题目链接 Flights for Regular Customers 首先按照$d$的大小升序排序 然后分成$m$个时刻,每条路径一次处理过来。 $can[i][j]$表示当前时刻$i$能否走到$j$ $can$通过上一条路径后的$can$和当前的可行路径矩阵的$d$次幂得到。 这由$floyd$求 阅读全文
posted @ 2017-10-05 00:58 cxhscst2 阅读(461) 评论(0) 推荐(0) 编辑