数据结构
mirror58229
C++ Java Python+ACM算法learning
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU 3791 二叉搜索树(数组实现)
Problem Description 判断两序列是否为同一二叉搜索树序列 Input 开始一个数n,(1 Output 如果序列相同则输出YES,否则输出NO Sample Input 2 567432 543267 576342 0 Sample Output YES NO原创 2016-08-01 19:17:33 · 1058 阅读 · 0 评论 -
HDU 1698 Just a Hook(线段树区间替换)
咸鱼区间线段树原创 2016-12-25 16:50:09 · 314 阅读 · 0 评论 -
线段树区间更新(以POJ 3468为例)
线段树区间更新的一点微小的工作~原创 2016-12-22 22:05:28 · 415 阅读 · 0 评论 -
HDU 1863 畅通工程(Kruskal算法)
畅通工程 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 26432 Accepted Submission(s): 11550 Problem Description 省政府“畅通工程”的目标是使全省任何两原创 2016-08-30 22:52:22 · 435 阅读 · 0 评论 -
HDU 1232 畅通工程(并查集)
#include using namespace std; int pre[1050]; int find(int x){ return pre[x]==x?x:pre[x]=find(pre[x]); //寻找根结点的递归 } int main(){ int m,n; int a,b; int f1,f2; int total; while(scanf("%d",&n)&&原创 2016-07-21 09:27:03 · 414 阅读 · 0 评论 -
HDU 1586 More is better(并查集)
并查集~原创 2016-12-02 20:11:24 · 524 阅读 · 0 评论 -
HDU 1272 小希的迷宫(并查集)
Problem Description 上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路原创 2016-08-11 00:46:51 · 399 阅读 · 0 评论 -
HDU 5326 Work(并查集)
Problem Description It’s an interesting experience to move from ICPC to work, end my college life and start a brand new journey in company. As is known to all, every stuff in a company has a title原创 2016-10-19 23:10:41 · 384 阅读 · 0 评论 -
HDU 2289 Cup(二分+圆台体积)
Problem Description The WHU ACM Team has a big cup, with which every member drinks water. Now, we know the volume of the water in the cup, can you tell us it height? The radius of the cup’s top and bo原创 2016-10-20 01:37:14 · 481 阅读 · 0 评论 -
HDU 1280 前m大的数(优先队列+栈)
前m大的数 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 17191 Accepted Submission(s): 5866 Problem Description 还记得Gardon给小希布置的那个作业原创 2016-10-10 20:15:53 · 484 阅读 · 0 评论 -
HDU 5929 Basic Data Structure(deque双向队列+找规律)
Basic Data Structure Time Limit: 7000/3500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 406 Accepted Submission(s): 115 Problem Description Mr. Fro原创 2016-10-07 17:45:50 · 744 阅读 · 0 评论 -
HDU 1082 Matrix Chain Multiplication(堆栈的简单运用)
Problem Description Matrix multiplication problem is a typical example of dynamical programming. Suppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D and E are matrices. Sinc原创 2016-08-01 21:01:31 · 407 阅读 · 0 评论 -
HDU 5524 Subtrees(完全二叉树)
Problem Description There is a complete binary tree with N nodes.The subtree of the node i has Ai nodes.How many distinct numbers are there of Ai? Input There are multiple test cases,原创 2016-08-01 21:35:17 · 527 阅读 · 0 评论 -
POJ 3349 Snowflake Snow Snowflakes(数字哈希)
Description You may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this is really true. Your program will read information about a collection of原创 2016-08-02 09:56:22 · 762 阅读 · 0 评论 -
POJ 2823 Sliding Window(优先队列)
Description An array of size n ≤ 10 6 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the原创 2016-08-05 21:31:31 · 488 阅读 · 0 评论 -
HDU 1166 敌兵布阵 (线段树)
Problem Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视原创 2016-08-06 00:42:03 · 499 阅读 · 0 评论 -
HDU 5818 Joint Stacks(优先队列+swap)
Problem Description A stack is a data structure in which all insertions and deletions of entries are made at one end, called the "top" of the stack. The last entry which is inserted is the first on原创 2016-08-11 00:35:22 · 646 阅读 · 0 评论 -
HDU 4006 The kth great number(优先队列)
Problem Description Xiao Ming and Xiao Bao are playing a simple Numbers game. In a round Xiao Ming can choose to write down a number, or ask Xiao Bao what the kth great number is. Because the numbe原创 2016-09-19 23:54:45 · 513 阅读 · 0 评论 -
HDU 4004 The Frog's Games(二分)
Problem Description The annual Games in frogs' kingdom started again. The most famous game is the Ironfrog Triathlon. One test in the Ironfrog Triathlon is jumping. This project requires the frog a原创 2016-09-20 00:47:44 · 591 阅读 · 0 评论
分享