
前缀和
文章平均质量分 84
sortmin
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #354 (Div. 2) - C. Vasya and String
C. Vasya and String题目链接:http://codeforces.com/problemset/problem/676/CDescriptionHigh school student Vasya got a string of length n as a birthday presen...原创 2018-02-25 15:42:01 · 174 阅读 · 0 评论 -
POJ 2018 Best Cow Fences
Best Cow FencesDescriptionFarmer John's farm consists of a long row of N (1 <= N <= 100,000)fields. Each field contains a certain number of cows, 1 <= ncows...原创 2018-03-24 23:25:40 · 335 阅读 · 0 评论 -
AtCoder Regular Contest 093(AtCoder Beginner Contest 092)题解
AtCoder Regular Contest 093C题题意:给定N个点,求每次去掉一个点后,依次走过剩余每个点的距离和,最后需要返回起点。C题题解:用一个数组B记录每个点和前面的点的距离,然后预处理出去掉当前点可以少走的距离,设k是当前点的前一个点和后一个点的距离,那么去掉当前点可以少走的距离就是b[i]+b[i+1]-k,那么结果就是所有和减去每个点可以少走的距...原创 2018-03-26 00:54:14 · 391 阅读 · 1 评论