摘要:
题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1698Just a HookDescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for...
阅读全文
posted @ 2015-06-03 22:38
GadyPu
阅读(157)
推荐(0)
摘要:
题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1029Ignatius and the Princess IVDescriptionOK, you are not too bad, em... But you can never pass the nex...
阅读全文
posted @ 2015-06-01 21:15
GadyPu
阅读(142)
推荐(0)
摘要:
题目连接http://poj.org/problem?id=3061SubsequenceDescriptionA sequence of N positive integers (10 2 #include 3 #include 4 #include 5 #include 6 using std...
阅读全文
posted @ 2015-06-01 20:01
GadyPu
阅读(396)
推荐(0)
摘要:
题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5249KPIDescription你工作以后, KPI 就是你的全部了. 我开发了一个服务,取得了很大的知名度。数十亿的请求被推到一个大管道后同时服务从管头拉取请求。让我们来定义每个请求都有一个重要值。我的...
阅读全文
posted @ 2015-05-31 19:19
GadyPu
阅读(356)
推荐(0)
摘要:
题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1047Integer InquiryDescriptionOne of the first users of BIT's new supercomputer was Chip Diller. He exte...
阅读全文
posted @ 2015-05-31 15:18
GadyPu
阅读(182)
推荐(0)
摘要:
题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1042N!DescriptionGiven an integer N(0 ≤ N ≤ 10000), your task is to calculate N!InputOne N in one line, ...
阅读全文
posted @ 2015-05-31 15:07
GadyPu
阅读(169)
推荐(0)
摘要:
题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1002A + B Problem IIDescriptionI have a very simple problem for you. Given two integers A and B, your jo...
阅读全文
posted @ 2015-05-31 14:37
GadyPu
阅读(133)
推荐(0)
摘要:
自己写的大数模板,参考了小白书上的写法,只是实现了加减乘法,不支持负数,浮点数。。除法还没写o(╯□╰)o以后再慢慢更吧。。其实除法我用(xie)的(bu)少(lai),乘法写过fft,这模板还是很鸡肋的。。 1 #include 2 #include 3 #include 4 #inclu...
阅读全文
posted @ 2015-05-31 14:30
GadyPu
阅读(200)
推荐(0)
摘要:
题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1004Let the Balloon RiseDescriptionContest time again! How excited it is to see balloons floating around...
阅读全文
posted @ 2015-05-30 10:43
GadyPu
阅读(137)
推荐(0)
摘要:
题目连接http://acm.hdu.edu.cn/showproblem.php?pid=4027Can you answer these queries?DescriptionProblem DescriptionA lot of battleships of evil are arranged...
阅读全文
posted @ 2015-05-29 22:51
GadyPu
阅读(169)
推荐(0)
摘要:
题目连接http://poj.org/problem?id=2823Sliding WindowDescriptionAn array of sizen≤ 106is given to you. There is a sliding window of sizekwhich is moving fr...
阅读全文
posted @ 2015-05-29 20:24
GadyPu
阅读(206)
推荐(0)
摘要:
题目连接http://acm.hdu.edu.cn/showproblem.php?pid=3074Minimum Inversion NumberDescriptionTired of playing computer games, alpc23 is planning to play a gam...
阅读全文
posted @ 2015-05-29 17:09
GadyPu
阅读(125)
推荐(0)
摘要:
题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1394Minimum Inversion NumberDescriptionThe inversion number of a given number sequence a1, a2, ..., an i...
阅读全文
posted @ 2015-05-29 16:36
GadyPu
阅读(257)
推荐(0)
摘要:
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=5199简单题,stl水之。。。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using s...
阅读全文
posted @ 2015-05-28 22:18
GadyPu
阅读(181)
推荐(0)
摘要:
原题链接:http://ac.jobdu.com/problem.php?pid=1521水题,如下。。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using std::cin; 8 usi...
阅读全文
posted @ 2015-05-27 22:08
GadyPu
阅读(175)
推荐(0)
摘要:
原题链接:http://ac.jobdu.com/problem.php?pid=1348归并排序求逆序对。。。 1 #include 2 #include 3 #include 4 #include 5 #include 6 typedef unsigned long long ull; 7 co...
阅读全文
posted @ 2015-05-27 21:01
GadyPu
阅读(147)
推荐(0)
摘要:
原题链接:http://ac.jobdu.com/problem.php?pid=1407线段树,区间更新,查询区间最小值。注意区间更新,查询的时候,区间$\begin{align*}[L,R] \end{align*}$$\begin{align*}L \end{align*}$都可能大于$\be...
阅读全文
posted @ 2015-05-27 14:56
GadyPu
阅读(254)
推荐(0)
摘要:
原题链接:http://ac.jobdu.com/problem.php?pid=1349二分。。 1 #include 2 #include 3 #include 4 #include 5 using std::lower_bound; 6 using std::upper_bound; 7 co...
阅读全文
posted @ 2015-05-27 12:57
GadyPu
阅读(158)
推荐(0)
摘要:
原题链接:http://ac.jobdu.com/problem.php?pid=1554由数列的前缀和:$\begin{align*}\Large{} S_n &=\Large{}\sum_{i=1}^{n}{{a_i}} \ \ \ \ i=1,2,3...n\end{align*}$由于:$\...
阅读全文
posted @ 2015-05-27 09:52
GadyPu
阅读(280)
推荐(0)
摘要:
原题链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1798线段树区间更新: 1. 区间同同时加上一个数 2. 区间同时乘以一个数 1 #include 2 #include 3 #include 4 #include 5 #define lc ...
阅读全文
posted @ 2015-05-25 21:26
GadyPu
阅读(151)
推荐(0)
摘要:
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=3172并查集的运用。。。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using std::map; 7 using std::str...
阅读全文
posted @ 2015-05-25 21:00
GadyPu
阅读(140)
推荐(0)
摘要:
原题链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1012线段树,单点更新。。 1 #include 2 #include 3 #include 4 #include 5 #define lc root r || pos = r) {20 ...
阅读全文
posted @ 2015-05-24 21:53
GadyPu
阅读(135)
推荐(0)
摘要:
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=5233简单题,stl水之。。。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using std::multiset; 7 struct...
阅读全文
posted @ 2015-05-24 13:53
GadyPu
阅读(122)
推荐(0)
摘要:
原题链接:http://poj.org/problem?id=2153简单题,map,平衡树均可。。map: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using std::cin; 8 using std...
阅读全文
posted @ 2015-05-22 20:47
GadyPu
阅读(224)
推荐(0)
摘要:
原题链接:http://acdream.info/problem?pid=1738树套树裸题,如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define lc root> 1; 13 struct Node {...
阅读全文
posted @ 2015-05-21 22:06
GadyPu
阅读(287)
推荐(0)
摘要:
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=5210简单题如下: 1 #include 2 #include 3 #include 4 #include 5 using std::sort; 6 const int Max_N = 1010; 7 i...
阅读全文
posted @ 2015-05-21 22:01
GadyPu
阅读(149)
推荐(0)
摘要:
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1622小白书上的题。。。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using std::queue; 8 u...
阅读全文
posted @ 2015-05-18 20:36
GadyPu
阅读(232)
推荐(0)
摘要:
原题链接:http://ac.jobdu.com/problem.php?pid=1528小白书上的做法,不过这个还要简单些。。。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using std::max; 7 const int...
阅读全文
posted @ 2015-05-18 16:12
GadyPu
阅读(135)
推荐(0)
摘要:
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1058优先队列的应用,如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using st...
阅读全文
posted @ 2015-05-17 20:00
GadyPu
阅读(114)
推荐(0)
摘要:
原题链接:http://www.lydsy.com/JudgeOnline/problem.php?id=2761简单题, 练习一下stl。。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using std:...
阅读全文
posted @ 2015-05-17 16:35
GadyPu
阅读(177)
推荐(0)
摘要:
原题链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=18696方法很多,我用的是快排+二分,练习一下stl lower_bound这个函数。。。 1 #include 2 #include 3 #include 4 #in...
阅读全文
posted @ 2015-05-16 17:21
GadyPu
阅读(140)
推荐(0)
摘要:
红黑树(Red Black Tree) 是一种自平衡二叉查找树红黑树和AVL树类似,都是在进行插入和删除操作时通过特定操作保持二叉查找树的平衡,从而获得较高的查找性能。它虽然是复杂的,但它的最坏情况运行时间也是非常良好的,并且在实践中是高效的: 它可以在O(log n)时间内做查找,插入和删除,...
阅读全文
posted @ 2015-05-15 21:39
GadyPu
阅读(603)
推荐(0)
摘要:
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1305字典树裸题,如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 const int Max_N = 100000; 7 stru...
阅读全文
posted @ 2015-05-07 16:27
GadyPu
阅读(158)
推荐(0)
摘要:
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1113字符串简单题:stl水过如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #inc...
阅读全文
posted @ 2015-05-07 16:20
GadyPu
阅读(144)
推荐(0)
摘要:
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2275题意:n个操作Push 入容器Pop弹出一个 满足 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #incl...
阅读全文
posted @ 2015-05-06 20:50
GadyPu
阅读(412)
推荐(0)
摘要:
原题链接:http://poj.org/problem?id=2418简单题。。平衡树,写了个模板。。动态分配内存确实很慢。。。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using std:...
阅读全文
posted @ 2015-05-05 20:02
GadyPu
阅读(210)
推荐(0)
摘要:
原题链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=20911简单题如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using...
阅读全文
posted @ 2015-05-05 16:56
GadyPu
阅读(219)
推荐(0)
摘要:
原题链接:http://ac.jobdu.com/problem.php?pid=1544RMQ线段树。。。如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 using std::min; 7 const int Max_N =...
阅读全文
posted @ 2015-05-04 21:43
GadyPu
阅读(193)
推荐(0)
摘要:
原题链接:http://ac.jobdu.com/problem.php?pid=1525字符串简单题,注意开有结尾有空格的情况否则pe or wa 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #includ...
阅读全文
posted @ 2015-05-04 21:42
GadyPu
阅读(136)
推荐(0)
摘要:
原题链接:http://ac.jobdu.com/problem.php?pid=1530字符串简单题,看似O(n^2)的复杂度10000的数据量会tle,其实最长不重复子串不超过26个嘛。。。如下: 1 #include 2 #include 3 #include 4 #include 5 #in...
阅读全文
posted @ 2015-05-04 21:39
GadyPu
阅读(273)
推荐(0)