上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 33 下一页
摘要: Balancing ActTime Limit:1000MSMemory Limit:65536KTotal Submissions:8048Accepted:3322DescriptionConsider a tree T with N (1 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 10 vectorQ[20002];11 int num[20002];12 int dp[20002][2];13 //DP[I][0] 统计子节点的最大个数14 //. 阅读全文
posted @ 2014-03-14 09:42 芷水 阅读(165) 评论(0) 推荐(0) 编辑
摘要: ComputerTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2679Accepted Submission(s): 1373Problem DescriptionA school bought the first computer some time ago(so this computer's id is 1). During the recent years the school bought N-1 new computers 阅读全文
posted @ 2014-03-13 12:32 芷水 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 1 一维哈希 2 const int MAX=100007; 3 bool Hash[MAX]; 4 int idx[MAX]; 5 int val[MAX]; 6 7 void Insert(int id,int num) 8 { 9 int k=num%MAX;10 while(Hash[k] && val[k]!=num)11 {12 k++;13 if(k==MAX) k=k-MAX;14 }15 if(!Hash[k])16 {17 Hash[k]=1;18 idx[k... 阅读全文
posted @ 2014-03-12 19:57 芷水 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 魔咒词典Time Limit: 8000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9381Accepted Submission(s): 2405Problem Description哈利波特在魔法学校的必修课之一就是学习魔咒。据说魔法世界有100000种不同的魔咒,哈利很难全部记住,但是为了对抗强敌,他必须在危急时刻能够调用任何一个需要的魔咒,所以他需要你的帮助。给你一部魔咒词典。当哈利听到一个魔咒时,你的程序必须告诉他那个魔咒的功能;当哈利需要某个功能但不知道该用什 阅读全文
posted @ 2014-03-12 19:55 芷水 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 1356: CatchTime Limit: 2 SecMemory Limit: 128 MBSubmit: 96Solved: 40[Submit][Status][Web Board]DescriptionA thief is running away!We can consider the city where he locates as an undirected graph in which nodes stand for crosses and edges stand for streets. The crosses are labeled from 0 to N–1. The 阅读全文
posted @ 2014-03-10 21:59 芷水 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 1365: Play with ChainTime Limit: 5 SecMemory Limit: 128 MBSubmit: 21Solved: 5[Submit][Status][Web Board]DescriptionYaoYao is fond of playing his chains. He has a chain containing n diamonds on it. Diamonds are numbered from 1 to n.At first, the diamonds on the chain is a sequence: 1, 2, 3, …, n.He w 阅读全文
posted @ 2014-03-10 18:03 芷水 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 龟兔赛跑Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10119Accepted Submission(s): 3818Problem Description据说在很久很久以前,可怜的兔子经历了人生中最大的打击——赛跑输给乌龟后,心中郁闷,发誓要报仇雪恨,于是躲进了杭州下沙某农业园卧薪尝胆潜心修炼,终于练成了绝技,能够毫不休息得以恒定的速度(VR m/s)一直跑。兔子一直想找机会好好得教训一下乌龟,以雪前耻。最近正值HDU举办50周年校庆,社 阅读全文
posted @ 2014-03-09 18:31 芷水 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Beauty ContestTime Limit:3000MSMemory Limit:65536KTotal Submissions:26087Accepted:8044DescriptionBessie, Farmer John's prize cow, has just won first place in a bovine beauty contest, earning the title 'Miss Cow World'. As a result, Bessie will make a tour of N (2 2 #include 3 #include 4 阅读全文
posted @ 2014-03-04 21:13 芷水 阅读(276) 评论(0) 推荐(0) 编辑
摘要: Space AntTime Limit:1000MSMemory Limit:10000KTotal Submissions:2830Accepted:1815DescriptionThe most exciting space discovery occurred at the end of the 20th century. In 1999, scientists traced down an ant-like creature in the planet Y1999 and called it M11. It has only one eye on the left side of it 阅读全文
posted @ 2014-03-03 21:47 芷水 阅读(136) 评论(0) 推荐(0) 编辑
摘要: WallTime Limit:1000MSMemory Limit:10000KTotal Submissions:28112Accepted:9383DescriptionOnce upon a time there was a greedy King who ordered his chief Architect to build a wall around the King's castle. The King was so greedy, that he would not listen to his Architect's proposals to build a b 阅读全文
posted @ 2014-03-03 18:39 芷水 阅读(132) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 33 下一页