
优先队列
文章平均质量分 80
keepcoral
这个作者很懒,什么都没留下…
展开
-
紫书uva 10603 优先队列+bfs
https://vjudge.net/problem/UVA-10603这个题目其实是暴力的一个典范,首先题目说了是最小倒水数,也就是总共次数中转移水的数量,bfs是找最小次数的,因此要用优先队列来改变优先级,将最小倒水数优先,然后是处理如果找不到合适的d,我们要把所有能够找到的值都存放在一个数组里面,然后遍历一次就可以了,我用的vis数组是三维的,用来表示第1,2,3个杯子的水量,和紫书上的略有...原创 2018-04-28 00:57:49 · 202 阅读 · 0 评论 -
poj 1456 Supermarket 单纯贪心||贪心+优先队列||贪心+并查集
A supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral number of time units starting from the...原创 2018-04-13 21:14:59 · 258 阅读 · 0 评论 -
2018年东北农业大学春季校赛 优先队列+bfs (莫名出bug题)
链接:https://www.nowcoder.com/acm/contest/93/H来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld题目描述 最近吃鸡游戏非常火,你们wyh学长也在玩这款游戏,这款游戏有一个非常重要的过程,就是要跑到安全区内,否则就会中毒持续消耗血量,我们这个问题简化如...原创 2018-04-05 16:28:57 · 260 阅读 · 0 评论 -
Codeforces 913D - Too Easy Problems(贪心+优先队列)
You are preparing for an exam on scheduling theory. The exam will last for exactly T milliseconds and will consist of n problems. You can either solve problem i in exactly ti milliseconds or ignore i...原创 2018-04-02 13:32:38 · 267 阅读 · 0 评论