2013年3月16日

摘要: Problem II Can Guess the Data Structure!There is a bag-like data structure, supporting two operations:1 xThrow an element x into the bag.2Take out an element from the bag.Given a sequence of operations with return values, you're going to guess the data structure. It is a stack (Last-In, First-Ou 阅读全文
posted @ 2013-03-16 14:30 aries__liu 阅读(680) 评论(0) 推荐(0) 编辑

2013年3月15日

摘要: I Think I Need a HouseboatTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5929Accepted Submission(s): 1761Problem DescriptionFred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the lan 阅读全文
posted @ 2013-03-15 19:24 aries__liu 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 圆桌会议Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2179Accepted Submission(s): 1490Problem DescriptionHDU ACM集训队的队员在暑假集训时经常要讨论自己在做题中遇到的问题.每当面临自己解决不了的问题时,他们就会围坐在一张圆形的桌子旁进行交流,经过大家的讨论后一般没有解决不了的问题,这也只有HDU ACM集训队特有的圆桌会议,有一天你也可以进来体会一下哦:),在一天在讨论的时候,Eddy想 阅读全文
posted @ 2013-03-15 19:22 aries__liu 阅读(257) 评论(0) 推荐(0) 编辑
摘要: HangOverTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7186Accepted Submission(s): 2884Problem DescriptionHow far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We 阅读全文
posted @ 2013-03-15 11:01 aries__liu 阅读(259) 评论(0) 推荐(0) 编辑

2013年3月13日

摘要: Frogs' NeighborhoodTime Limit:5000MSMemory Limit:10000KTotal Submissions:5599Accepted:2419Special JudgeDescription未名湖附近共有N个大小湖泊L1,L2, ...,Ln(其中包括未名湖),每个湖泊Li里住着一只青蛙Fi(1 ≤i≤N)。如果湖泊Li和Lj之间有水路相连,则青蛙Fi和Fj互称为邻居。现在已知每只青蛙的邻居数目x1,x2, ...,xn,请你给出每两个湖泊之间的相连关系。Input第一行是测试数据的组数T(0 ≤T≤ 20)。每组数据包括两行,第一行是整数N(2 阅读全文
posted @ 2013-03-13 21:37 aries__liu 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Help with IntervalsTime Limit:6000MSMemory Limit:131072KTotal Submissions:7745Accepted:1789Case Time Limit:2000MSDescriptionLogLoader, Inc. is a company specialized in providing products for analyzing logs. While Ikki is working on graduation design, he is also engaged in an internship at LogLoader. 阅读全文
posted @ 2013-03-13 21:35 aries__liu 阅读(193) 评论(0) 推荐(0) 编辑
摘要: As Easy As A+BTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 26401Accepted Submission(s): 11218Problem DescriptionThese days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of co 阅读全文
posted @ 2013-03-13 21:23 aries__liu 阅读(399) 评论(0) 推荐(0) 编辑
摘要: Big NumberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18525Accepted Submission(s): 8292Problem DescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, 阅读全文
posted @ 2013-03-13 21:12 aries__liu 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Ignatius and the Princess IIITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8447Accepted Submission(s): 6009Problem Description"Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says.& 阅读全文
posted @ 2013-03-13 21:09 aries__liu 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Least Common MultipleTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 21158Accepted Submission(s): 7899Problem DescriptionThe least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the nu 阅读全文
posted @ 2013-03-13 09:18 aries__liu 阅读(176) 评论(0) 推荐(0) 编辑
摘要: Rightmost DigitTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 22887Accepted Submission(s): 8739Problem DescriptionGiven a positive integer N, you should output the most right digit of N^N.InputThe input contains several test cases. The first line 阅读全文
posted @ 2013-03-13 08:40 aries__liu 阅读(175) 评论(0) 推荐(0) 编辑

2013年3月12日

摘要: Big NumberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3386Accepted Submission(s): 2305Problem DescriptionAs we know, Big Number is always troublesome. But it's really important in our ACM. And today, your task is to write a program to calcu 阅读全文
posted @ 2013-03-12 22:01 aries__liu 阅读(198) 评论(0) 推荐(0) 编辑
摘要: Eddy's research ITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4452Accepted Submission(s): 2680Problem DescriptionEddy's interest is very extensive, recently he is interested in prime number. Eddy discover the all number owned can be divi 阅读全文
posted @ 2013-03-12 21:21 aries__liu 阅读(150) 评论(0) 推荐(0) 编辑
摘要: A hard puzzleTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 21925Accepted Submission(s): 7696Problem Descriptionlcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how to know the a^b.everybody objects to this BT problem,s 阅读全文
posted @ 2013-03-12 16:19 aries__liu 阅读(807) 评论(0) 推荐(0) 编辑
摘要: 最小公倍数Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 24145Accepted Submission(s): 13180Problem Description给定两个正整数,计算这两个数的最小公倍数。Input输入包含多组测试数据,每组只有一行,包括两个不大于1000的正整数.Output对于每个测试用例,给出这两个数的最小公倍数,每个实例输出一行。Sample Input10 14Sample Output70SourcePOJ 1 # 阅读全文
posted @ 2013-03-12 14:35 aries__liu 阅读(183) 评论(0) 推荐(0) 编辑
摘要: Easier Done Than Said?Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5021Accepted Submission(s): 2535Problem DescriptionPassword security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords a 阅读全文
posted @ 2013-03-12 14:32 aries__liu 阅读(254) 评论(0) 推荐(0) 编辑
摘要: Word AmalgamationTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1834Accepted Submission(s): 854Problem DescriptionIn millions of newspapers across the United States there is a word game called Jumble. The object of this game is to solve a riddle, 阅读全文
posted @ 2013-03-12 14:29 aries__liu 阅读(281) 评论(0) 推荐(0) 编辑

2013年3月11日

摘要: A. Word Capitalizationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputCapitalization is writing a word with its first letter as a capital letter. Your task is to capitalize the given word.Note, that during capitalization all the letters except th 阅读全文
posted @ 2013-03-11 20:34 aries__liu 阅读(287) 评论(0) 推荐(0) 编辑

2013年3月10日

摘要: B. T-primestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWe know that prime numbers are positive integers that have exactly two distinct positive divisors. Similarly, we'll call a positive integertТ-prime, ifthas exactly three distinct posi 阅读全文
posted @ 2013-03-10 16:36 aries__liu 阅读(406) 评论(0) 推荐(0) 编辑
摘要: C -DragonsTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 230ADescriptionKirito is stuck on a level of the MMORPG he is playing now. To move on in the game, he's got to defeat allndragons that live on this level. Kirito and the dragons havest 阅读全文
posted @ 2013-03-10 16:30 aries__liu 阅读(238) 评论(0) 推荐(0) 编辑
摘要: A -TeamTime Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 231ADescriptionOne day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during program 阅读全文
posted @ 2013-03-10 16:28 aries__liu 阅读(417) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4484题目思路: 直接模拟即可 1 #include <iostream> 2 #include <cstdio> 3 #include <cstdlib> 4 #include <cstring> 5 using namespace std; 6 int cal(int n) { 7 int Max = n; 8 while (n!=1) { 9 if ((n&1) == 0) {10 n /= 2;11 } else {12 n = n * 阅读全文
posted @ 2013-03-10 16:21 aries__liu 阅读(367) 评论(0) 推荐(0) 编辑
摘要: CastingTime Limit:3000ms,Special Time Limit:7500ms,Memory Limit:65536KBTotal submit users:23,Accepted users:23Problem 12598 :No special judgementProblem descriptionCasting around for problems leads us to combine modular arithmetic with different integer bases, particularly the problem of computing v 阅读全文
posted @ 2013-03-10 16:16 aries__liu 阅读(200) 评论(0) 推荐(0) 编辑
摘要: MysteryTime Limit:1000ms,Special Time Limit:2500ms,Memory Limit:65536KBTotal submit users:19,Accepted users:18Problem 12606 :No special judgementProblem descriptionInputThe first line of input contains a single integer P, (1 ≤ P ≤ 1000), which is the number of data sets that follow. Each data set co 阅读全文
posted @ 2013-03-10 16:14 aries__liu 阅读(242) 评论(0) 推荐(0) 编辑

2013年3月8日

摘要: Function Run FunTime Limit:1000MSMemory Limit:10000KTotal Submissions:13896Accepted:7233DescriptionWe all love recursion! Don't we?Consider a three-parameter recursive function w(a, b, c):if a <= 0 or b <= 0 or c <= 0, then w(a, b, c) returns:1if a > 20 or b > 20 or c > 20, the 阅读全文
posted @ 2013-03-08 13:38 aries__liu 阅读(259) 评论(0) 推荐(0) 编辑

2013年3月5日

摘要: Mayor's postersTime Limit:1000MSMemory Limit:65536KTotal Submissions:31053Accepted:9019DescriptionThe citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has finally 阅读全文
posted @ 2013-03-05 15:40 aries__liu 阅读(162) 评论(0) 推荐(0) 编辑

2013年3月4日

摘要: A Simple Problem with IntegersTime Limit:5000MSMemory Limit:131072KTotal Submissions:40260Accepted:11693Case Time Limit:2000MSDescriptionYou haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interv 阅读全文
posted @ 2013-03-04 19:14 aries__liu 阅读(268) 评论(0) 推荐(0) 编辑
摘要: Just a HookTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10792Accepted Submission(s): 5328Problem DescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecu 阅读全文
posted @ 2013-03-04 01:36 aries__liu 阅读(491) 评论(0) 推荐(0) 编辑

2013年3月2日

摘要: Buy TicketsTime Limit:4000MSMemory Limit:65536KTotal Submissions:9404Accepted:4513DescriptionRailway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…The Lunar New Year was approaching, but unluckily the Little Cat still had schedules go 阅读全文
posted @ 2013-03-02 21:01 aries__liu 阅读(232) 评论(0) 推荐(0) 编辑
摘要: BillboardTime Limit: 20000/8000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5912Accepted Submission(s): 2682Problem DescriptionAt the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is the 阅读全文
posted @ 2013-03-02 19:25 aries__liu 阅读(200) 评论(0) 推荐(0) 编辑
摘要: Minimum Inversion NumberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5892Accepted Submission(s): 3587Problem DescriptionThe inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j and ai 阅读全文
posted @ 2013-03-02 18:00 aries__liu 阅读(185) 评论(0) 推荐(0) 编辑

2013年2月27日

摘要: Find the ClonesTime Limit:5000MSMemory Limit:65536KTotal Submissions:6265Accepted:2328DescriptionDoubleville, a small town in Texas, was attacked by the aliens. They have abducted some of the residents and taken them to the a spaceship orbiting around earth. After some (quite unpleasant) human exper 阅读全文
posted @ 2013-02-27 23:50 aries__liu 阅读(310) 评论(0) 推荐(0) 编辑
摘要: IMMEDIATE DECODABILITYTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 9229Accepted: 4375DescriptionAn encoding of a set of symbols is said to be immediately decodable if no code for one symbol is the prefix of a code for another symbol. We will assume for this problem that all codes are in 阅读全文
posted @ 2013-02-27 19:05 aries__liu 阅读(201) 评论(0) 推荐(0) 编辑
摘要: BabelfishTime Limit:3000MSMemory Limit:65536KTotal Submissions:26498Accepted:11378DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.InputInput consists of 阅读全文
posted @ 2013-02-27 00:28 aries__liu 阅读(186) 评论(0) 推荐(0) 编辑

2013年2月26日

摘要: 题目链接:http://poj.org/problem?id=2001题目大意: 给一系列单词,找出么每个单词的最小缩写,使得这些缩写不出现歧义。还有,完全相同的优先级比前缀的优先级高,意思就是,如果一个单词的缩写就是这个单词本身,那么它不能代表以它为前缀的单词,而仅仅代表它本身。题目思路: 第一道字典树题目,写代码还是要认真,出一些写错误是最吃亏的。减少错误的办法就是,第一,多敲代码,敲熟练一点儿,孰能生巧。第二,写代码的过程中要养成习惯,就是先把问题想透彻,再写,一边写一边思考。 1 #include <iostream> 2 #include <cstdio> 3 阅读全文
posted @ 2013-02-26 23:29 aries__liu 阅读(334) 评论(0) 推荐(0) 编辑

2013年2月15日

摘要: C. Secrettime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Greatest Secret Ever consists ofnwords, indexed by positive integers from1ton. The secret needs dividing betweenkKeepers (let's index them by positive integers from1tok), thei-th Ke 阅读全文
posted @ 2013-02-15 17:14 aries__liu 阅读(768) 评论(0) 推荐(0) 编辑
摘要: A. Beautiful Yeartime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt seems like the year of 2013 came only yesterday. Do you know a curious fact? The year of 2013 is the first year after the old 1987 with only distinct digits.Now you are suggested 阅读全文
posted @ 2013-02-15 16:10 aries__liu 阅读(512) 评论(0) 推荐(0) 编辑
摘要: B. Prime Matrixtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou've got ann × mmatrix. The matrix consists of integers. In one move, you can apply a single transformation to the matrix: choose an arbitrary element of the matrix and inc 阅读全文
posted @ 2013-02-15 16:06 aries__liu 阅读(1353) 评论(0) 推荐(1) 编辑

2013年1月30日

摘要: 题目链接:http://poj.org/problem?id=2752 1 #include <iostream> 2 #include <cstdlib> 3 #include <cstdio> 4 #include <cstring> 5 #define N 400000 6 using namespace std; 7 8 char s[N]; 9 int next[N], a[N];10 void getnext(char *p, int *next)11 {12 int i = 0, j = -1, len = strlen(p);13 阅读全文
posted @ 2013-01-30 20:51 aries__liu 阅读(206) 评论(0) 推荐(0) 编辑

2013年1月23日

摘要: B. Queue at the Schooltime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDuring the break the schoolchildren, boys and girls, formed a queue ofnpeople in the canteen. Initially the children stood in the order they entered the canteen. However, after 阅读全文
posted @ 2013-01-23 10:23 aries__liu 阅读(364) 评论(0) 推荐(0) 编辑