摘要:Closest Common AncestorsTime Limit: 2000MSMemory Limit: 10000KTotal Submissions: 11659Accepted: 3848DescriptionWrite a program that takes as input a rooted tree and a list of pairs of vertices. For each pair (u,v) the program determines the closest common ancestor of u and v in the tree. The closest
阅读全文
摘要:Nearest Common AncestorsTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 12478Accepted: 6652DescriptionA rooted tree is a well-known data structure in computer science and engineering. An example is shown below: In the figure, each node is labeled with an integer from {1, 2,...,16}. Node 8 .
阅读全文
摘要:Charlie's ChangeTime Limit: 1000MSMemory Limit: 30000KTotal Submissions: 2215Accepted: 575DescriptionCharlie is a driver of Advanced Cargo Movement, Ltd. Charlie drives a lot and so he often buys coffee at coffee vending machines at motorests. Charlie hates change. That is basically the setup of
阅读全文
摘要:Dollar DayzTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 2275Accepted: 934DescriptionFarmer John goes to Dollar Days at The Cow Store and discovers an unlimited number of tools on sale. During his first visit, the tools are selling variously for $1, $2, and $3. Farmer John has exactly $5
阅读全文
摘要:Treats for the CowsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 3689Accepted: 1844DescriptionFJ has purchased N (1 <= N <= 2000) yummy treats for the cows who get money for giving vast amounts of milk. FJ sells one treat per day and wants to maximize the money he receives over a gi
阅读全文
摘要:Space ElevatorTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 6422Accepted: 2965DescriptionThe cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have K (1 <= K <= 400) different types of blocks with which to build t
阅读全文
摘要:Balanced LineupTime Limit: 5000MSMemory Limit: 65536KTotal Submissions: 24349Accepted: 11348Case Time Limit: 2000MSDescriptionFor 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 som
阅读全文
摘要:Cash MachineTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 20470Accepted: 7162DescriptionA Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly N distinct bill denominations, say Dk, k=
阅读全文
摘要:RelocationTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 1106Accepted: 447DescriptionEmma and Eric are moving to their new house they bought after returning from their honeymoon. Fortunately, they have a few friends helping them relocate. To move the furniture, they only have two compact c
阅读全文
摘要:Cow ExhibitionTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 6899Accepted: 2437Description"Fat and docile, big and dumb, they look so stupid, they aren't much fun..." - Cows with Guns by Dana Lyons The cows want to prove to the public that they are both smart and fun. In orde
阅读全文
摘要:Charm Bracelet Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 13977 Accepted: 6381 Description Bessie has gone to the mall's jewelry store
阅读全文
摘要:AsteroidsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 297Accepted: 65Special JudgeDescriptionAssociation of Collision Management (ACM) is planning to perform the controlled collision of two asteroids. The asteroids will be slowly brought together and collided at negligible speed. ACM exp
阅读全文
摘要:Ultimate WeaponTime Limit: 2000MSMemory Limit: 131072KTotal Submissions: 1441Accepted: 713DescriptionIn year 2008 of the Cosmic Calendar, the Aliens send a huge armada towards the Earth seeking after conquest. The humans now depend on their ultimate weapon to retain their last hope of survival. The
阅读全文
摘要:Power NetworkTime Limit: 2000MSMemory Limit: 32768KTotal Submissions: 18609Accepted: 9833DescriptionA power network consists of nodes (power stations, consumers and dispatchers) connected by power transport lines. A node u may be supplied with an amount s(u) >= 0 of power, may produce an amount 0
阅读全文
摘要:Matrix Chain MultiplicationTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 1678Accepted: 1080DescriptionSuppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D and E are matrices. Since matrix multiplication is associative, the order in which multiplications are performed is
阅读全文
摘要:Leonardo's NotebookTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 1514Accepted: 645Description— I just bought Leonardo's secret notebook! Rare object collector Stan Ucker was really agitated but his friend, special investigator Sarah Kepticwas unimpressed. — How do you know it is g
阅读全文
摘要:CARDSTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 1033Accepted: 544DescriptionAlice and Bob have a set of N cards labelled with numbers 1 ... N (so that no two cards have the same label) and a shuffle machine. We assume that N is an odd integer. The shuffle machine accepts the set of car
阅读全文
摘要:CipherTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 16995Accepted: 4445DescriptionBob and Alice started to use a brand-new encoding scheme. Surprisingly it is not a Public Key Cryptosystem, but their encoding and decoding is based on secret keys. They chose the secret key at their last me
阅读全文
摘要:Cow SortingTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 4753Accepted: 1734DescriptionFarmer John's N (1 ≤ N ≤ 10,000) cows are lined up to be milked in the evening. Each cow has a unique "grumpiness" level in the range 1...100,000. Since grumpy cows are more likely to damag
阅读全文
摘要:Line beltTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1820Accepted Submission(s): 683Problem DescriptionIn a two-dimensional plane there are two line belts, there are two segments AB and CD, lxhgww's speed on AB is P and on CD is Q, he can m
阅读全文