数据结构
defense881
Noting is impossiable!Believe in yourself!
展开
-
Fractal poj 2083
C - Fractal(3.4.1)Time Limit:1000MS Memory Limit:30000KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionA fractal is an object or quantity that displays self-similarity,原创 2014-07-16 10:29:12 · 529 阅读 · 0 评论 -
uva 10158 War(并查集的简单应用)
Problem B: War点击打开题目链接 A war is beinglead between two countries, A and B. As a loyal citizen of C, you decide tohelp your country’s espionage by attending the peace-talks taking place t原创 2014-07-28 09:49:33 · 859 阅读 · 0 评论 -
zoj 2714 Windows Message Queue(优先队列、简单的二叉堆处理)
Windows Message QueueTime Limit: 2 Seconds Memory Limit: 65536 KB Message queue is the basic fundamental of windows system. For each process, the system maintains a message queue. I原创 2014-08-03 11:43:24 · 777 阅读 · 0 评论 -
poj 3253 Fence Repair(哈夫曼树)
Fence Repair点击打开题目链接Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 26151 Accepted: 8450DescriptionFarmer John wants to repair a small length of the原创 2014-08-05 09:38:07 · 560 阅读 · 0 评论 -
图的存储结构 (转)
图的存储结构 2009-04-18 19:58:21| 分类:编程 |举报|字号 订阅8.2 图的存储结构 图的存储结构除了要存储图中各个顶点的本身的信息外,同时还要存储顶点与顶点之间的所有关系(边的信息),因此,图的结构比较复杂,很难以数据元素在存储区中的物理位置来表示元素之间的关系,但也正是由于其任意的特性,故物理表示方法很多。常用转载 2014-08-05 15:30:43 · 920 阅读 · 0 评论 -
poj 3349 Snowflake Snow Snowflakes(hash表)
SnowflakeSnowSnowflakesTime Limit: 4000MS Memory Limit: 65536KTotal Submissions: 30772 Accepted: 8120DescriptionYou may have heard that no two snowflakes are原创 2014-07-30 16:27:27 · 844 阅读 · 0 评论 -
poj 1611The Suspects(简单的并查集求集合元素)
The Suspects点击打开题目链接Time Limit: 1000MS Memory Limit: 20000KTotal Submissions: 22109 Accepted: 10746DescriptionSevere acute respiratory syndrome (SARS), an atypi原创 2014-07-30 17:05:56 · 587 阅读 · 0 评论 -
poj 1470 Closest Common Ancestors(简单的LCA算法)
Closest Common AncestorsTime Limit: 2000MS Memory Limit: 10000KTotal Submissions: 15120 Accepted: 4817DescriptionWrite a program that takes as input a rooted tr原创 2014-07-30 20:37:12 · 1414 阅读 · 0 评论 -
F - Ride to School(2.1.2)
F - Ride to School(2.1.2)Time Limit:1000MS Memory Limit:30000KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionMany graduate students of Peking University are living in Wanl原创 2014-07-15 09:27:57 · 612 阅读 · 0 评论 -
poj 1094Sorting It All Out(拓扑排序)
Sorting It All OutTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 27599 Accepted: 9557DescriptionAn ascending sorted sequence of distinct values is on原创 2014-08-07 14:08:36 · 715 阅读 · 0 评论 -
poj 1270&& uva 124 Following Orders(拓扑排序、DFS)
Following Orders点击打开题目链接Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 3756 Accepted: 1483DescriptionOrder is an important concept in mathematics and原创 2014-08-06 20:01:39 · 1116 阅读 · 0 评论 -
poj 2499 Binary Tree(水题)
Binary TreeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6023 Accepted: 2794DescriptionBackgroundBinary trees are a common data structure in computer原创 2014-07-31 20:26:40 · 788 阅读 · 0 评论 -
poj 2255 Tree Recovery(二叉树的遍历)
Tree Recovery点击打开题目链接Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 11333 Accepted: 7107DescriptionLittle Valentine liked playing with binary trees v原创 2014-08-01 11:04:43 · 641 阅读 · 0 评论 -
poj 2942&&uva 3523 Knights of the Round Table(图的连通性)
Knights of the Round TableTime Limit: 7000MS Memory Limit: 65536KTotal Submissions: 9663 Accepted: 3129DescriptionBeing a knight is a very attractive career: search原创 2014-08-10 18:42:47 · 870 阅读 · 0 评论 -
poj 1258 Agri-Net(最小生成树 prime算法)
Agri-Nethttp://poj.org/problem?id=1258Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 40013 Accepted: 16283DescriptionFarmer John has been elected may原创 2014-08-11 16:10:35 · 734 阅读 · 0 评论 -
poj 1308 &&HDU 1325 Is It A Tree?(并查集、树的定义)
Is It A Tree?Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 21912 Accepted: 7483DescriptionA tree is a well-known data structure that is either empty原创 2014-08-12 11:17:34 · 765 阅读 · 0 评论 -
poj 2240 Arbitrage(最短路径)
Arbitrage点击打开题目链接Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 15931 Accepted: 6706DescriptionArbitrage is the use of discrepancies in currency exch原创 2014-09-11 15:02:53 · 791 阅读 · 0 评论 -
poj 1789Truck History(最小生成树 prime)
Truck History点击打开题目链接Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 18736 Accepted: 7234DescriptionAdvanced Cargo Movement, Ltd. uses trucks of diffe原创 2014-09-03 13:30:57 · 531 阅读 · 0 评论 -
poj 2309 BST(水)
BST点击打开题目链接Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8546 Accepted: 5185DescriptionConsider an infinite full binary search tree (see the figure原创 2014-08-01 14:55:52 · 569 阅读 · 0 评论 -
poj 2236 Wireless Network(并查集)
Wireless NetworkTime Limit: 10000MS Memory Limit: 65536KTotal Submissions: 15990 Accepted: 6750DescriptionAn earthquake takes place in Southeast Asia. The ACM (原创 2014-07-28 11:55:56 · 646 阅读 · 0 评论 -
uva 10608 Friends(求并查集集合中元素个数)
Friends There is a town with N citizens. It is known that some pairsof people are friends. According to the famous saying that “The friends of myfriends are my friends, too” it follows that if A a原创 2014-07-27 10:53:15 · 1519 阅读 · 0 评论 -
poj 2080 Calendar
A - CalendarTime Limit:1000MS Memory Limit:30000KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionA calendar is a system for measuring time, from hours and minutes, to原创 2014-07-16 16:00:36 · 614 阅读 · 0 评论 -
poj 1504 Adding Reversed Numbers(简单字符串的处理)
Adding Reversed NumbersTime Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmitStatusDescriptionThe Antique Comedians of Malidinesia prefer comedies to tragedies.原创 2014-07-16 17:03:44 · 768 阅读 · 0 评论 -
poj 1281 MANAGER(简单模拟题)
MANAGERTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 2504 Accepted: 899DescriptionOne of the programming paradigm in parallel processing is the prod原创 2014-07-16 20:24:42 · 1432 阅读 · 0 评论 -
zoj 1256 What Day Is It?
What Day Is It?Time Limit: 2 Seconds Memory Limit: 65536 KB The calendar now in use evolved from the Romans. Julius Caesar codified a calendar system that came to be known as the Ju原创 2014-07-17 12:01:23 · 1338 阅读 · 0 评论 -
poj 1060 Modular multiplication of polynomials
Modular multiplication of polynomialsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 4032 Accepted: 1842DescriptionConsider polynomials whose coeffici原创 2014-07-17 17:53:22 · 964 阅读 · 0 评论 -
poj 3461 Oulipo(KMP 字符串匹配算法)
Oulipo点击打开题目链接Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 22354 Accepted: 8922DescriptionThe French author Georges Perec (1936–1982) once wrote原创 2014-07-18 18:21:01 · 699 阅读 · 0 评论 -
poj 2503 Babelfish(广义索引类线性表:快排+二分)
BabelfishTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 31543 Accepted: 13583DescriptionYou have just moved from Waterloo to a big city. The people h原创 2014-07-20 15:58:22 · 707 阅读 · 0 评论 -
括号匹配(栈练习)
Problem A: 括号匹配(栈和队列)Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 8 Solved: 7[Submit][Status][Web Board]Description假设一个算术表达式中可以包含三种括号:圆括号“(”和“)”,方括号“[”和“]”和花括号“{”和“ ”,且这三种括号可按任意的次序嵌套使原创 2014-06-11 17:07:05 · 1624 阅读 · 0 评论 -
回文字符串判断(栈练习)
Problem B: 回文(栈和队列)Time Limit: 1 Sec Memory Limit: 1000 MBSubmit: 68 Solved: 20[Submit][Status][Web Board]Description 假设称正读和反读都相同的字符序列为“回文”,例如,‘abba‘ 和 ‘abcba‘是回文,‘abcde‘ 和 ‘ababab‘ 则不原创 2014-06-11 17:22:16 · 7095 阅读 · 0 评论 -
Ultra-QuickSort(归并排序记录逆序数)
Ultra-QuickSort点击打开题目链接Time Limit: 7000MS Memory Limit: 65536KTotal Submissions: 39951 Accepted: 14413DescriptionIn this problem, you have to analyze a particul原创 2014-07-21 20:13:32 · 699 阅读 · 0 评论 -
uva 246 5185 10-20-30
10-20-30 A simple solitaire card game called 10-20-30 uses a standard deck of 52playing cards in which suit is irrelevant. The value of a face card (king,queen, jack) is 10. The value of a原创 2014-07-22 14:56:32 · 947 阅读 · 0 评论 -
uva 133 The Dole Queue(约瑟夫变形)
The Dole Queue In a serious attempt to downsize (reduce) the dole queue, The NewNational Green Labour Rhinoceros Party has decided on the followingstrategy. Every day all dole applicants w原创 2014-07-24 09:09:31 · 708 阅读 · 0 评论 -
poj 1363 Rails(栈)
RailsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 24568 Accepted: 9628DescriptionThere is a famous railway station in PopPush City. Country there is in原创 2014-07-24 19:03:28 · 621 阅读 · 0 评论 -
并查集(转)
并查集并查集(Union-find Sets)是一种非常精巧而实用的数据结构,它主要用于处理一些不相交集合的合并问题。一些常见的用途有求连通子图、求最小生成树的 Kruskal 算法和求最近公共祖先(Least Common Ancestors, LCA)等。使用并查集时,首先会存在一组不相交的动态集合 S={S1,S2,⋯,Sk},一般都会使用一个整数表示集合中的一个元素。每个集转载 2014-07-25 15:44:56 · 459 阅读 · 0 评论 -
poj 1330 Nearest Common Ancestors(简单的树初探)
Nearest Common AncestorsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 17568 Accepted: 9304DescriptionA rooted tree is a well-known data structure in原创 2014-07-24 19:10:43 · 677 阅读 · 0 评论 -
POJ 2524 Ubiquitous Religions(简单的并查集)
Ubiquitous Religions点击打开题目链接Time Limit: 5000MS Memory Limit: 65536KTotal Submissions: 23669 Accepted: 11654DescriptionThere are so many different religions in t原创 2014-07-27 10:29:02 · 748 阅读 · 0 评论 -
poj 1577 Falling Leaves(二叉搜索树的简单操作(建立、插入))
Falling Leaves点击打开题目链接Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 3941 Accepted: 2181DescriptionFigure 1Figure 1 shows a graphical represe原创 2014-08-01 18:57:52 · 1560 阅读 · 0 评论 -
HDU 1754 I Hate It(简单线段树-单点更新,区间询问)
I Hate ItTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 45602 Accepted Submission(s): 17898Problem Description很多学校流行一种比较的习惯。老师们很原创 2015-04-28 10:31:36 · 494 阅读 · 0 评论