Problem DescriptionThere is a strange lift.Thelift can stop can at every floor as you want, and there is a number Ki(0 <=Ki <= N) on every floor.The lift have just two buttons: up and down.When youat floor i,if you press the button "UP" , you
Place the RobotsTime Limit: 5 Seconds Memory Limit: 32768 KB Robert is a famous engineer. One day he was given a task by his boss. The background of the task was the following:Given a map consisting of square blocks. There were three kinds of
DescriptionEvery cow's dream is to becomethe most popular cow in the herd. In a herd of N (1 <= N <= 10,000) cows,you are given up to M (1 <= M <= 50,000) ordered pairs of the form (A, B)that tell you that cow A thinks that cow B is
Best RewardTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 406 Accepted Submission(s): 167Problem DescriptionAfter an uphill battle, General Li won a great victory. Now the head of state
Description (Special Judge)There is a famous joke-riddlefor children: Three turtles are crawlingalong a road. One turtle says: "There are two turtles ahead of me."The other turtle says: "There are two turtles behind me." The thirdturtle says: "There
Simpsons’ Hidden TalentsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1716 Accepted Submission(s): 619Problem DescriptionHomer: Marge, I just figured out a way to discover some of the
DescriptionJohn is going on a fishingtrip. He has h hours available (1 <= h <= 16), and there are n lakes inthe area (2 <= n <= 25) all reachable along a single, one-way road. Johnstarts at lake 1, but he can finish at any lake he wants.
PeriodTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1993 Accepted Submission(s): 978Problem DescriptionFor each prefix of a given string S with N characters (each character has an ASCII
Girls' researchTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 444 Accepted Submission(s): 148Problem DescriptionOne day, sailormoon girls are so delighted that they intend to research about
Problem DescriptionBefore ACM can do anything, abudget must be prepared and the necessary financial support obtained. The mainincome for this action comes from Irreversibly Bound Money (IBM). The ideabehind is simple. Whenever some ACM member has
OulipoTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 17128 Accepted: 6892DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from
DescriptionThe database of the Pentagon contains a top-secret information. We don't know what the information is — you know, it's top-secret, — but we know the format of its representation. It is extremely simple. We don't know why, but all the data
Problem DescriptionThere is going to be a partyto celebrate the 80-th Anniversary of the Ural State University. The Universityhas a hierarchical structure of employees. It means that the supervisorrelation forms a tree rooted at the rector V. E.
Power StringsTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 27359 Accepted: 11450DescriptionGiven two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of
Problem Description某國為了防禦敵國的飛彈襲擊,發展出一種飛彈攔截系統.但是這種飛彈攔截系統有一個缺陷:雖然它的第一發炮彈能夠到達任意的高度,但是以後每一發炮彈都不能超過前一發的高度.某天,雷達捕捉到敵國的飛彈來襲.由於該系統還在試用階段,所以只有一套系統,因此有可能不能攔截所有的飛彈.怎麼辦呢?多搞幾套系統唄!你說說倒蠻容易,成本呢?成本是個大問題啊.所以俺就到這裡來求救了,請協助計算一下最少需要多少套攔截系統. Input輸入若干組資料.每組資料包括:飛彈總個數(正整數),
Problem DescriptionACboy很喜歡玩一種戰略遊戲,在一個地圖上,有N座城堡,每座城堡都有一定的寶物,在每次遊戲中ACboy允許攻克M個城堡並獲得裡面的寶物。但由於地理位置原因,有些城堡不能直接攻克,要攻克這些城堡必須先攻克其他某一個特定的城堡。你能幫ACboy算出要獲得盡量多的寶物應該攻克哪M個城堡嗎? Input每個測試執行個體首先包括2個整數,N,M.(1 <= M <= N <=200);在接下來的N行裡,每行包括2個整數,a,b. 在第 i
Milking GridTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 4901 Accepted: 2043DescriptionEvery morning when they are milked, the Farmer John's cows form a rectangular grid that is R (1 <= R <= 10,000) rows by C (1 <= C <= 75)
Problem DescriptionMr Wang wants some boys to help him with a project. Because the project is rather complex, the more boys come, the better it will be. Of course there are certain requirements.Mr Wang selected a room big enough to hold the boys.
DescriptionOur Black Box represents aprimitive database. It can save an integer array and has a special i variable.At the initial moment Black Box is empty and i equals 0. This Black Boxprocesses a sequence of commands (transactions). There are two