HDOJ 1528 Card Game Cheater
版权声明:来自: 码代码的猿猿的AC之路 http://blog.csdn.net/ck_boss https://blog.csdn.net/u012797220/article/details/35236457简单二分图匹配....Card Game CheaterTime Limit: 200...
【HDOJ】1009 FatMouse' Trade
这道题目是一道非常简单的贪心,但是我却修改了1h+。原因就是qsort的comp有bug。其实还是题目中的数据可以为0。除数为0真的要慎重啊。后来改为结构体,加一层循环选取最大值,果然ac啊。wa了几次,测试数据都过,还是wa。无语。这道题目一定要注意数据类型,double型。#include &l...
【HDOJ】1601 Galactic Import
Dijkstra。 /* 1601 */ #include <cstdio> #include <cstring> #include <cstdlib> #define INF 999999 char buf[]; int map[][]; bool visit[...
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...