摘要: 地址:http://acm.hit.edu.cn/hoj/problem/view?id=1999add :push一个数字query:输出当前队列最小的数delete:删除最小的数完全是优先队列的功能,头文件#include优先队列内部具有排序功能,输出优先级高的数字,数字大的为优先级则 priority_queueq若数字小为优先级则:priority_queue, greater >q;本题就是输出小的#include #include #include #include #include #include #include #include #include #include # 阅读全文
posted @ 2013-09-04 22:23 SunnySnail 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hit.edu.cn/hoj/problem/view?id=1191题意:对某个包含某些特定数字(0~9)的数,求包含这些数字且比已知数大的最小数(就是生成下一个排列,若是所有排列中最后一个,则输出no successorstl: bool next_permutation(begin, end);//改变区间内元素的顺序,产生下一个排列。 bool prev_permutation(begin, end);//产生前一个排列。#include #include #include #include #include #include #include #i... 阅读全文
posted @ 2013-09-04 10:13 SunnySnail 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Ferry LoadingMy Tags(Edit)Source:UVATime limit: 1 secMemory limit: 32 MSubmitted: 222,Accepted: 127Before bridges were common, ferries were used to transport cars across rivers. River ferries, unlike their larger cousins, run on a guide line and are powered by the river's current. Cars drive ont 阅读全文
posted @ 2013-08-16 11:44 SunnySnail 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 1787: [Ahoi2008]Meet 紧急集合Time Limit:20 SecMemory Limit:162 MBSubmit:698Solved:282[Submit][Status]DescriptionInputOutputSample Input6 4 1 2 2 3 2 4 4 5 5 6 4 5 6 6 3 1 2 4 4 6 6 6 Sample Output 5 2 2 5 4 1 6 0 HINT题意:一些点和联通它们的边,三个人在站在不同的点上,要集合到同一点上去,问最小的总步数。三个人,两个两个算lca,有两对是相同的,那个不同的点便是要求的,算出三个点到所求出的 阅读全文
posted @ 2013-08-15 18:40 SunnySnail 阅读(622) 评论(0) 推荐(0) 编辑
摘要: Gibonacci SequenceMy Tags(Edit)Source:XiaoETime limit: 1 secMemory limit: 64 MSubmitted: 284,Accepted: 122As we know, the Fibonacci sequence is the sequence of numbers such that every element is equal to the sum of the two previous elements, except for the first two elements f(0) and f(1) which are 阅读全文
posted @ 2013-08-14 22:45 SunnySnail 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Collecting BugsTime Limit:10000MSMemory Limit:64000KTotal Submissions:1696Accepted:769Case Time Limit:2000MSSpecial JudgeDescriptionIvan is fond of collecting. Unlike other people who collect post stamps, coins or other material stuff, he collects software bugs. When Ivan gets a new program, he clas 阅读全文
posted @ 2013-08-14 17:13 SunnySnail 阅读(152) 评论(0) 推荐(0) 编辑
摘要: LOOPSTime Limit: 15000/5000 MS (Java/Others)Memory Limit: 125536/65536 K (Java/Others)Total Submission(s): 1131Accepted Submission(s): 465Problem DescriptionAkemi Homura is a Mahou Shoujo (Puella Magi/Magical Girl).Homura wants to help her friend Madoka save the world. But because of the plot of the 阅读全文
posted @ 2013-08-14 14:37 SunnySnail 阅读(208) 评论(0) 推荐(0) 编辑
摘要: Fibonacci Problem AgainMy Tags(Edit)Source:HCPC 2005 FALLTime limit: 1 secMemory limit: 32 MSubmitted: 380,Accepted: 137As we know , the Fibonacci numbers are defined as follows:""""Given two numbers a and b , calculate. """"InputThe input contains several tes 阅读全文
posted @ 2013-08-13 16:34 SunnySnail 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 炮兵阵地Time Limit:2000MSMemory Limit:65536KTotal Submissions:15742Accepted:5957Description司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),也可能是平原(用"P"表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示:如果在地图中的灰色所标识的平原上部署一支炮兵部队,则图中的黑色的网格表示它能够攻击到的区域:沿 阅读全文
posted @ 2013-08-09 21:02 SunnySnail 阅读(232) 评论(0) 推荐(0) 编辑
摘要: LabyrinthMy Tags(Edit)Source:ACM ICPC Central European Regional 1999Time limit: 5 secMemory limit: 32 MSubmitted: 797,Accepted: 337The northern part of the Pyramid contains a very large and complicated labyrinth. The labyrinth is divided into square blocks, each of them either filled by rock, or fre 阅读全文
posted @ 2013-08-06 15:20 SunnySnail 阅读(264) 评论(0) 推荐(0) 编辑