![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构基础
Kefault
这个作者很懒,什么都没留下…
展开
-
二叉树建立 以及 bfs层次遍历
Problem description: 输入一颗二叉树,你的任务是按从上到下、从左到右的顺序输出各个节点的值。每个节点都按照从根节点到他的移动序列给出(L表示左,R表示右)。在输入中,每个节点的左括号和有括号之间没有空格,相邻节点之间有一个空格。每棵树的输入用括号()结束。 注意:如果从根到某个叶节点的路径上有的节点没有在输入中给出或者给出了超过一次,应当输出-1。借点数不原创 2013-08-08 13:55:55 · 1108 阅读 · 0 评论 -
hdu 5057 Argestes and Sequence
Argestes and SequenceTime Limit: 5000/2500 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 511 Accepted Submission(s): 127Problem DescriptionArgest原创 2014-09-30 20:03:00 · 1085 阅读 · 0 评论 -
acdream 1427 Nice Sequence
Nice SequenceTime Limit: 12000/6000MS (Java/Others)Memory Limit: 128000/64000KB (Java/Others)SubmitStatisticNext ProblemProblem Description Let us consider the sequence a1, a2,.原创 2014-10-07 11:43:44 · 1250 阅读 · 0 评论 -
hdu 4970 Killing Monsters
Killing MonstersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 160 Accepted Submission(s): 86Problem DescriptionKingdom Ru原创 2014-08-19 18:55:53 · 1004 阅读 · 0 评论 -
poj 2182 Lost Cows
Lost CowsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9201 Accepted: 5917DescriptionN (2 <= N <= 8,000) cows have unique brands in the range 1..N.原创 2014-08-15 18:26:45 · 606 阅读 · 0 评论 -
poj 2352 Stars
StarsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 32548 Accepted: 14221DescriptionAstronomers often examine star maps where stars are represented b原创 2014-08-16 13:22:33 · 802 阅读 · 0 评论 -
hdu 4893 Wow! Such Sequence!
Wow! Such Sequence!Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1894 Accepted Submission(s): 585Problem DescriptionRecent原创 2014-07-30 18:08:34 · 653 阅读 · 0 评论 -
poj 2418 Hardwood Species
Hardwood SpeciesTime Limit: 10000MS Memory Limit: 65536KTotal Submissions: 18603 Accepted: 7361DescriptionHardwoods are the botanical group of trees that have b原创 2014-08-16 14:37:00 · 748 阅读 · 0 评论 -
poj 2777 Count Color(线段树)
Count ColorTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 35248 Accepted: 10622DescriptionChosen Problem Solving and Program design as an optional co原创 2014-08-15 11:49:11 · 775 阅读 · 0 评论 -
poj 3468 A Simple Problem with Integers(线段树)
A Simple Problem with IntegersTime Limit: 5000MS Memory Limit: 131072KTotal Submissions: 61636 Accepted: 18840Case Time Limit: 2000MSDescriptionYou have N原创 2014-08-15 10:59:22 · 742 阅读 · 0 评论 -
hdu 1698 Just a Hook(线段树)
Just a HookTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 17481 Accepted Submission(s): 8731Problem DescriptionIn the game o原创 2014-08-15 09:54:18 · 587 阅读 · 0 评论 -
poj 2886 Who Gets the Most Candies?(线段树+约瑟夫环+反素数)
Who Gets the Most Candies?Time Limit: 5000MS Memory Limit: 131072KTotal Submissions: 9934 Accepted: 3050Case Time Limit: 2000MSDescriptionN children are s原创 2014-08-13 20:43:35 · 908 阅读 · 0 评论 -
hdu 2795 Billboard(线段树)
BillboardTime Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10890 Accepted Submission(s): 4827Problem DescriptionAt the entranc原创 2014-08-13 19:51:27 · 771 阅读 · 0 评论 -
poj 2828 Buy Tickets
Buy TicketsTime Limit: 4000MS Memory Limit: 65536KTotal Submissions: 13277 Accepted: 6595DescriptionRailway tickets were difficult to buy around the Lunar New Y原创 2014-08-13 20:16:09 · 778 阅读 · 0 评论 -
hdu 1394 Minimum Inversion Number(线段树)
Minimum Inversion NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10853 Accepted Submission(s): 6676Problem Description原创 2014-08-13 19:40:57 · 686 阅读 · 0 评论 -
poj 1703 Find them, Catch them
Find them, Catch themTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 31412 Accepted: 9677DescriptionThe police office in Tadu City decides to say ends原创 2014-08-12 11:54:46 · 762 阅读 · 0 评论 -
codeforces 204B- Little Elephant and Cards
DescriptionThe Little Elephant loves to play with color cards.He has n cards, each has exactly two colors (the color of the front side and the color of the back side). Ini原创 2014-03-14 19:31:15 · 1372 阅读 · 0 评论 -
poj 3264 Balanced Lineup
DescriptionFor the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows.原创 2013-09-22 10:49:38 · 864 阅读 · 0 评论 -
树链剖分学习
最近学习树链剖分,在网上搜了很多文章,这里推荐一篇博客:点击打开链接。 这篇博客讲的很仔细,在了解了基本原理之后,可以学习一下kuangbin大大的模板:定义部分:struct Edge{ int to,next;}edge[2*maxn];//树的边int head[maxn],tot;//邻接表int top[maxn];//节点所在重链的最原创 2014-10-09 21:10:48 · 1237 阅读 · 2 评论