
贪心
哆啦AC梦
软件工程
展开
-
poj-1328-Radar Installation
DescriptionAssume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, loc原创 2015-07-28 16:53:52 · 460 阅读 · 0 评论 -
HDU 5813 Elegant Construction(构造)
题目链接:点击打开链接题目大意:给定n个点,和n个整数,n个整数代表标号为i的顶点要和其他第ni个点相连,输出一个合法地图。题目解析:将顶点按能到达的点数从小到大排序,排好序之后每个点只能往前面的点连边. 因而如果存在一个排在第i位的点,要求到达的点数大于i-1,则不可行;否则就可以按照上述方法构造出图. 复杂度O(N^2).#include #include #include原创 2016-08-10 08:34:16 · 481 阅读 · 0 评论 -
HDU 5818 Joint Stacks(模拟 || 优先队列 || 左式堆)
题目链接:点击打开链接题目大意:给定T个操作,A栈和B栈,操作包含三种,一种是push,即向A栈或B栈中加入一个新元素,一种是pop即输出A栈或B栈的栈顶元素,最后一个是merge,即合并两个栈,并保留第一个栈清空第二个栈(即如果输入merge B A为保留B,清空A)。题目解析:比赛的时候自己想到去模拟一下,时间复杂度肯定没问题,就是调试可能会耗点时间,于是让队友现行上模板用左式堆过掉了原创 2016-08-10 08:26:04 · 437 阅读 · 0 评论 -
codeforces AIM Tech Round 3 (Div. 2) B. Checkpoints
题目链接:点击打开链接题目大意:给定x轴上的一些整数点,问从m点出发到n-1个点至少要走多少米?题目解析:读完题目之后感觉想暴力一发,就是从m走到最右边再走回来走到最左边,这样相当于走了两遍m的右半部分,再算上另一半一共两种答案,去一个最小值就好了。超时了,想了好半天发现自己思维定式了,把给定的所有点都过一遍只留下一个边界就可以,所以问题转换为从m到两个边界的问题,所以排序之后取四种情况的原创 2016-08-29 19:42:24 · 703 阅读 · 0 评论 -
Codeforces Round #363 (Div. 2) B. One Bomb
B. One Bombtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a description of a depot. It原创 2016-07-20 08:31:32 · 338 阅读 · 0 评论 -
HDU 5753 Permutation Bo(多校3 --- 1002)
Permutation BoTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 339 Accepted Submission(s): 203Special JudgeProblem Description原创 2016-07-27 09:43:05 · 632 阅读 · 0 评论 -
HDU 5752 Sqrt Bo(多校3--1001)
Sqrt BoTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 493 Accepted Submission(s): 227Problem DescriptionLet's define the f原创 2016-07-27 09:15:33 · 429 阅读 · 0 评论 -
Codeforces Round #364 (Div. 2) C. They Are Everywhere (窗口滑动)
C. They Are Everywheretime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSergei B., the young coach of Pokemo原创 2016-07-25 15:40:19 · 467 阅读 · 0 评论 -
POJ 1328 Radar Installation(贪心)
Radar InstallationTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 75586 Accepted: 16939DescriptionAssume the coasting is an infinite straight line. Land原创 2016-07-25 08:26:14 · 328 阅读 · 0 评论 -
POJ 3258 River Hopscotch (二分)
River HopscotchTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 11291 Accepted: 4837DescriptionEvery year the cows hold an event featuring a peculiar ver原创 2016-07-25 07:50:05 · 377 阅读 · 0 评论 -
Codeforces 377 A. Maze(搜索技巧)
A. MazeTime Limit: 2000msMemory Limit: 262144KB64-bit integer IO format: %I64d Java class name: (Any)Submit StatusPavel loves grid mazes. A grid maze is an n × m rectang原创 2016-08-08 16:20:15 · 410 阅读 · 0 评论