HDOJ 1297 Children’s Queue
版权声明:来自: 码代码的猿猿的AC之路 http://blog.csdn.net/ck_boss https://blog.csdn.net/u012797220/article/details/35860567JAVA大数....Children’s QueueTime Limit: 2000/...
【HDOJ】1448 The Treasure
这就是个简单的bfs。真没什么好说的,三维的状态就可以了。每次预处理一下monster的位置,然后再恢复。 /* 1924 */ #include <iostream> #include <sstream> #include <string> #include &...
还是畅通工程 --HDOJ 1233
还是畅通工程Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 20997 Accepted Submission(s): 9362Pro...
leetcode N-Queens/N-Queens II, backtracking, hdu 2553 count N-Queens, dfs 分类: leetcode hdoj 2015-07-09 02:07 102人阅读 评论(0) 收藏
for the backtracking part, thanks to the video of stanford cs106b lecture 10 by Julie Zelenski for the nice explanation of recursion and backtracking,...
找规律/数位DP HDOJ 4722 Good Numbers
题目传送门 /* 找规律/数位DP:我做的时候差一点做出来了,只是不知道最后的 is_one () http://www.cnblogs.com/crazyapple/p/3315436.html 数位DP:http://blog.csdn.n...
hdoj:2070
Fibbonacci NumberTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 22530 Accepted Submission(...
【HDOJ】1107 武林
简单模拟,题目数据太弱太弱了。 /* 1107 */ #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <vector>...
hdoj1010 Temperor of the bone
Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 53106 Accepted Submissio...
HDOJ(HDU) 2088 Box of Bricks(平均值)
Problem Description Little Bob likes playing with his box of bricks. He puts the bricks one upon another and builds stacks of different height. “Look,...
HDOJ 1326. Box of Bricks 纯水题
Box of BricksTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5994 Accepted Submission(s): 2...
HDOJ 1326 Box of Bricks(简单题)
Problem Description Little Bob likes playing with his box of bricks. He puts the bricks one upon another and builds stacks of different height. Look, ...
【HDOJ】【1754】I Hate It
线段树这是一道线段树的裸题……带单点修改的RMQ为什么我会想到写这么一道傻逼题呢?是因为这样……aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABQYAAABVCAIAAACU464EAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMA...
【HDOJ】4351 Digital root
digital root = n==0 ? 0 : n%9==0 ? 9:n%9;可以简单证明一下n = a0*n^0 + a1*n^1 + ... + ak * n^kn%9 = a0+a1+..+ak然后,数学归纳易知结论是正确的。因此9个状态就够了,表示%9的结果。这里需要特殊处理0, 表示状...
【HDOJ】4366 Successor
基本思路是将树形结构转换为线性结构。然后,所求即为一个区间内大于abi的最大的loy指向的ID。将结点按照abi降序排序,注意abi可能相等。然后,使用线段树单点更新,区间查询可解。 /* 4366 */ #include <iostream> #include <sstream&...
【HDOJ】3686 Traffic Real Time Query System
这题做了几个小时,基本思路肯定是求两点路径中的割点数目,思路是tarjan缩点,然后以割点和连通块作为新节点见图。转化为lca求解。结合点——双连通分量与LCA。 /* 3686 */ #include <iostream> #include <sstream> #inclu...
【HDOJ】3473 Minimum Sum
划分树解。主席树解MLE。 /* 3473 */ #include <iostream> #include <sstream> #include <string> #include <map> #include <queue> #inclu...
【HDOJ】【3415】Max Sum of Max-K-sub-sequence
DP/单调队列优化呃……环形链求最大k子段和。首先拆环为链求前缀和……然后单调队列吧<_<,裸题没啥好说的……WA:为毛手写队列就会挂,必须用STL的deque?(写挂自己弱……sigh) //HDOJ 3415 #include<queue> #include<cma...
【HDOJ】【3530】Subsequence
DP/单调队列优化题解:http://www.cnblogs.com/yymore/archive/2011/06/22/2087553.html引用:首先我们要明确几件事情1.假设我们现在知道序列(i,j)是符合标准的,那么如果第j+1个元素不比(i,j)最大值大也不比最小值小,那么(i,j+1)...
HDOJ 4549 M斐波那契数列 费马小定理+矩阵高速幂
MF( i ) = a ^ fib( i-1 ) * b ^ fib ( i ) ( i>=3)mod 1000000007是质数 , 依据费马小定理 a^phi( p ) = 1 ( mod p ) 这里 p 为质数 且 a 比 p小 所以 a^( p - 1 ) = 1 ( mod...
HDOJ/HDU 1241 Oil Deposits(经典DFS)
Problem Description The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large re...