这题说的是给了一个 平面 然后又很多的长方体柱子 问这个 容器的 容积是什么,排序后 然后 进行 并查集 判断是否 可以有比他小的高度依靠他算体积,通过并查集去判断他的子集的个数。#include #include #include #include using namespace std;cons...
分类:
其他好文 时间:
2014-06-18 23:35:37
阅读次数:
217
绝好的贪心题把马按照从大到小排序。若田忌的快马比王的快马快,直接赢若田忌的快马比王的快马慢,则用最慢的马和王比若快马相等,则转向慢马。若田忌的慢马比王的慢马快,则赢,指针移位。否则,比较田忌的慢马与王的快马,若相等,直接和。否则,让慢马输给王的快马(只有这种情况)想想,应该是按上面的解答的。这题的贪...
分类:
其他好文 时间:
2014-06-18 13:46:52
阅读次数:
212
/* 啥也不说了,直接套模板。。。 */ 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define N 500000 7 using namespace std; 8 9 class A...
分类:
其他好文 时间:
2014-06-18 12:53:46
阅读次数:
152
Problem Description
FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean.
The warehouse has N rooms. The i-th room con...
分类:
其他好文 时间:
2014-06-17 22:47:38
阅读次数:
300
HDU 2095 find your present (2)题目描述:Problem DescriptionIn the new year party, everybody will get a "special present".Now it's your turn to get your spe...
分类:
其他好文 时间:
2014-06-17 14:12:54
阅读次数:
217
题目链接:
http://acm.hdu.edu.cn/showproblem.php?pid=1518
题目为:
Square
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 7839 Accepted Submi...
分类:
其他好文 时间:
2014-06-16 22:34:36
阅读次数:
279
Wireless Password
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 4022 Accepted Submission(s): 1196
Problem Description
Liyuan lives...
分类:
其他好文 时间:
2014-06-16 20:46:46
阅读次数:
309
很经典的题目,而且是标准的线段树增加lazy标志的入门题目。
做了好久线段树,果然是practice makes perfect, 这次很畅快,打完一次性AC了。
标志的线段树函数。
主要是:
更新的时候只更新到需要的节点,然后最后的时候一次性把所以节点都更新完毕。
这也是线段树常用的技术。
#include
const int SIZE = 100005;
struct Node...
分类:
其他好文 时间:
2014-06-16 20:38:39
阅读次数:
182
快放暑假了,训练又要开始了。先从熟悉的图论开始做吧。题意:一张有向图中有若干起点一个终点,让你算最短路,方法很简单只需人为加一个起点指向所有起点让后距离为0即可。代码如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #...
分类:
其他好文 时间:
2014-06-15 13:14:57
阅读次数:
136