Ekka and his friend Dokka decided to buy a cake. They both love cakes and that's why they want to share the cake after buying it. As the name suggeste ...
分类:
其他好文 时间:
2018-03-06 17:08:07
阅读次数:
161
http://codeforces.com/problemset/problem/938/D 题意:n个城市,每个城市都要举办场演唱会,票价是a[i],此外还有m条双向有权边连接各个城市,求从每个城市出发,看一场演唱会再返回的最小花费。 样例:in: 4 2 out: 6 14 1 25 1 2 4 ...
分类:
其他好文 时间:
2018-03-04 18:05:30
阅读次数:
186
A friend of yours has taken the job of security officer at the Star-Buy Company, a famous depart- ment store. One of his tasks is to install a video s ...
分类:
其他好文 时间:
2018-03-04 14:42:45
阅读次数:
162
题目名称 buy slide divide 输入 buy.in slide.in divide.in 输出 buy.out slide.out divide.out 每个测试点时限 1秒 1秒 1秒 内存限制 256MB 256MB 256MB 测试点数目 10 10 10 每个测试点分值 10 1 ...
分类:
其他好文 时间:
2018-03-03 19:33:08
阅读次数:
183
倒序 处理,线段树保存有多少空位 cpp include include using namespace std; int n, ans[200005], uu[200005], vv[200005]; struct SGT{ int sum[800005]; void build(int o, i ...
分类:
其他好文 时间:
2018-03-03 18:10:38
阅读次数:
112
传送门:CodeForces - 938D 题意:n个城市,m条路,每条路都有自己的花费,每个城市看演唱会也有自己的花费,问从每一个城市到另一个城市(或就在自己城市)看演唱会的最小花费 题解:迪杰特斯拉,跑多源(每个源有权值)最短路。和一般的跑法不一样,要先给每个dis[]赋值成源的权值然后扔进di ...
分类:
其他好文 时间:
2018-03-03 15:29:51
阅读次数:
168
题目链接:Buy a Ticket 题意: 给出n个点m条边,每个点每条边都有各自的权值,对于每个点i,求一个任意j,使得2×d[i][j] + a[j]最小。 题解: 这题其实就是要我们求任意两点的最短路,但是从点的个数上就知道这题不可以用floyd算法,其实多元最短路可以用dijkstra算。@ ...
分类:
其他好文 时间:
2018-03-03 12:26:30
阅读次数:
120
Buy a Ticket 题意要求:求出每个城市看演出的最小费用, 注意的一点就是车票要来回的。 题解:dijkstra 生成优先队列的时候直接将在本地城市看演出的费用放入队列里, 然后直接跑就好了, dis数组存的是, 当前情况下的最小花费是多少。 代码: ...
分类:
其他好文 时间:
2018-03-02 22:19:27
阅读次数:
165
On the way home, Karen decided to stop by the supermarket to buy some groceries. She needs to buy a lot of goods, but since she is a student her budge ...
分类:
其他好文 时间:
2018-02-27 23:27:30
阅读次数:
212
这场比赛题目还行,但是被一道数学题卡了 A - Supermarket CodeForces - 919A We often go to supermarkets to buy some fruits or vegetables, and on the tag there prints the pr ...
分类:
其他好文 时间:
2018-02-21 23:37:38
阅读次数:
377