
数据结构
文章平均质量分 63
sunshine668
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
UVA 11995 I Can Guess the Data Structure!
Description Problem I I Can Guess the Data Structure! There is a bag-like data structure, supporting two operations: 1 x Throw an element x into the bag. 2 Take out an element from th原创 2014-04-03 15:44:31 · 429 阅读 · 0 评论 -
根据二叉树先序中序序列输出后序
#include #include #include #include #include using namespace std; #define inf 0x3f3f3f3f typedef struct node { char x; struct node *lc,*rc; }node,*tree; char pre[100],in[100],post[100]; v原创 2016-03-13 19:49:41 · 1284 阅读 · 0 评论 -
链式前向星 模板
#include #include #include const int maxn = 10005; const int maxm = 1000005;//edge using namespace std; int n; struct node { int to,next; // int value ,from, }; node edge [maxm]; int box[原创 2014-10-17 16:16:07 · 539 阅读 · 0 评论 -
栈的应用
判断回文串:原创 2014-11-02 15:26:46 · 384 阅读 · 0 评论 -
hdu 1022 Train Problem I
Problem Description As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is t原创 2014-10-04 14:51:58 · 325 阅读 · 0 评论 -
hdu 2094 产生冠军 拓扑排序
Problem Description 有一群人,打乒乓球比赛,两两捉对撕杀,每两个人之间最多打一场比赛。 球赛的规则如下: 如果A打败了B,B又打败了C,而A与C之间没有进行过比赛,那么就认定,A一定能打败C。 如果A打败了B,B又打败了C,而且,C又打败了A,那么A、B、C三者都不可能成为冠军。 根据这个规则,无需循环较量,或许就能确定冠军。你的任务就是面对一群比赛选手,在经过了若干原创 2014-08-04 15:38:05 · 502 阅读 · 0 评论 -
hdu 2647 Reward 拓扑排序
Problem Description Dandelion's uncle is a boss of a factory. As the spring festival is coming , he wants to distribute rewards to his workers. Now he has a trouble about how to distribute the reward原创 2014-08-04 14:52:06 · 423 阅读 · 0 评论 -
hdu 1811Rank of Tetris 拓扑+并查集
Problem Description 自从Lele开发了Rating系统,他的Tetris事业更是如虎添翼,不久他遍把这个游戏推向了全球。 为了更好的符合那些爱好者的喜好,Lele又想了一个新点子:他将制作一个全球Tetris高手排行榜,定时更新,名堂要比福布斯富豪榜还响。关于如何排名,这个不用说都知道是根据Rating从高到低来排,如果两个人具有相同的Rating,那就按这几个人的RP原创 2014-08-04 19:49:22 · 361 阅读 · 0 评论 -
hdu 1285 确定比赛名次 拓扑排序
Problem Description 有N个比赛队(1 Input 输入有若干组,每组中的第一行为二个数N(1 Output 给出一个符合要求的排名。输出时队伍号之间有空格,最后一名后面没有空格。 其他说明:符合条件的排名可能不是唯一的,此时要求输出时编号小的队伍在前;输入数据保证是正确的,即输入数据确保一定能有一个符合要求的排名。 S原创 2014-08-04 14:27:43 · 380 阅读 · 0 评论 -
Genealogical tree 拓扑排序
Description The system of Martians' blood relations is confusing enough. Actually, Martians bud when they want and where they want. They gather together in different groups, so that a Martian can原创 2014-07-05 21:56:13 · 380 阅读 · 0 评论 -
优先队列
例子: #include #include #include #include using namespace std; //定义比较结构 struct cmp1{ bool operator ()(int &a,int &b){ return a>b;//最小值优先 } }; struct cmp2{ bool operator ()(int &a,转载 2014-07-24 10:12:43 · 354 阅读 · 0 评论 -
poj 3253Fence Repair
Description Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of wood, each having some integer len原创 2014-07-24 09:39:40 · 314 阅读 · 0 评论 -
poj 3750小孩报数问题
Description 有N个小孩围成一圈,给他们从1开始依次编号,现指定从第W个开始报数,报到第S个时,该小孩出列,然后从下一个小孩开始报数,仍是报到S个出列,如此重复下去,直到所有的小孩都出列(总人数不足S个时将循环报数),求小孩出列的顺序。 Input 第一行输入小孩的人数N(N 接下来每行输入一个小孩的名字(人名不超过15个字符) 最后一行输入W,S (W Outp原创 2014-07-23 09:55:42 · 1527 阅读 · 0 评论 -
UVA 11991 Easy Problem from Rujia Liu?
Description Problem E Easy Problem from Rujia Liu? Though Rujia Liu usually sets hard problems for contests (for example, regional contests like Xi'an 2006, Beijing 2007 and Wuhan 2009, o原创 2014-04-03 15:28:58 · 439 阅读 · 0 评论 -
先序建二叉树,中序遍历
#include #include #include using namespace std; typedef struct node { char x; struct node* lc,* rc; }node,*tree; char s[1000]; int m; void build(tree &t) { int l=strlen(s); if(m>=l) re原创 2016-02-29 20:30:23 · 456 阅读 · 0 评论