随笔分类 - UVa OJ
http://uva.onlinejudge.org/
摘要:DollarsNew Zealand currency consists of $100, $50, $20, $10, and $5 notes and $2, $1, 50c, 20c, 10c and 5c coins. Write a program that will determine, for any given amount, in how many ways that amount may be made up. Changing the order of listing does not increase the count. Thus 20c may be made up
阅读全文
摘要:Problem E: VacationThe ProblemYou are planning to take some rest and to go out on vacation, but you really don't know which cities you should visit. So, you ask your parents for help. Your mother says"My son, you MUST visit Paris, Madrid, Lisboa and London. But it's only fun in this ord
阅读全文
摘要:Problem BThe Twin TowersInput:standard inputOutput:standard outputOnce upon a time, in an ancient Empire, there were two towers of dissimilar shapes in two different cities. The towers were built by putting circular tiles one upon another. Each of the tiles was of the same height and had integral ra
阅读全文
摘要:2007/2008 ACM International Collegiate Programming ContestUniversity of Ulm Local ContestProblem F: Frequent valuesYou are given a sequence ofnintegersa1, a2, ... , anin non-decreasing order. In addition to that, you are given several queries consisting of indicesiandj(1 ≤ i ≤ j ≤ n). For each query
阅读全文
摘要:N(3N20000)ping pong players live along a west-east street(consider the street as a line segment). Each player has a unique skill rank. To improve their skill rank, they often compete with each other. If two players want to compete, they must choose a referee among other ping pong players and hold th
阅读全文
摘要:F. Spreading the WealthProblemA Communist regime is trying to redistribute wealth in a village. They have have decided to sit everyone around a circular table. First, everyone has converted all of their properties to coins of equal value, such that the total number of coins is divisible by the numbe
阅读全文
摘要:GCommando WarInput:Standard InputOutput:Standard Output“Waiting for orders we held in the wood, word from the front never cameBy evening the sound of the gunfire was miles awayAh softly we moved through the shadows, slip away through the treesCrossing their lines in the mists in the fields on our ha
阅读全文
摘要:Problem C: The Dragon of LoowaterOnce upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem.The shores of Rellau Creek in central Loowater had always been a prime breeding ground for geese. Due to the lack of predators, the geese population was out of control. The peo
阅读全文
摘要:Problem D: ShellSortHe made each turtle stand on another one's backAnd he piled them all up in a nine-turtle stack.And then Yertle climbed up. He sat down on the pile.What a wonderful view! He could see 'most a mile!The ProblemKing Yertle wishes to rearrange his turtle throne to place his hi
阅读全文
摘要:Parentheses BalanceYou are given a string consisting of parentheses()and[]. A string of this type is said to becorrect:(a)if it is the empty string(b)if A and B are correct, AB is correct,(c)if A is correct,(A)and[A]is correct.Write a program that takes a sequence of strings of this type and check t
阅读全文
摘要:Inscribed Circles and Isosceles TrianglesGiven two real numbersBthe width of the base of an isosceles triangle in inchesHthe altitude of the same isosceles triangle in inchesCompute to six significant decimal placesCthe sum of the circumferences of a series of inscribed circles stacked one on top of
阅读全文
摘要:Problem EThe Other Two TreesInput:standard inputOutput:standard outputTime Limit:2 secondsYou have a quadrilateral shaped land whose opposite fences are of equal length. You have four neighbors whose lands are exactly adjacent to your four fences, thatmeansyou have a common fence with all of them. F
阅读全文
摘要:Problem BCode RefactoringTime Limit: 2 seconds"Harry, my dream is a code waiting to bebroken. Break the code, solve the crime."Agent CooperSeveral algorithms in modern cryptography are based on the fact that factoring large numbers is difficult. Alicia and Bobby know this, so they have dec
阅读全文
摘要:Problem F: Factoring Large NumbersOne of the central ideas behind much cryptography is that factoring large numbers is computationally intensive. In this context one might use a 100 digit number that was a product of two 50 digit prime numbers. Even with the fastest projected computers this factoriz
阅读全文
摘要:Light, more lightThe ProblemThere is man named "mabu" for switching on-off light in our University. He switches on-off the lights in a corridor. Every bulb has its own toggle switch. That is, if it is pressed then the bulb turns on. Another press will turn it off. To save power consumption
阅读全文
摘要:Skew BinaryWhen a number is expressed in decimal, thek-th digit represents a multiple of 10k. (Digits are numbered from right to left, where the least significant digit is number 0.) For example,When a number is expressed in binary, thek-th digit represents a multiple of 2k. For example,Inskew binar
阅读全文
摘要:Big ChocolateMohammad has recently visitedSwitzerland. As he loves his friends very much, he decided to buy some chocolate for them, but as this fine chocolate is very expensive(You know Mohammad is a little BIT stingy!), he could only afford buying one chocolate, albeit a very big one (part of it c
阅读全文
摘要:ExponentiationProblems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxing experience for many computer systems.This problem requires that you write a program to compute the exact value ofRnwhereRis
阅读全文
摘要:Problem E: Automatic EditingSource file:autoedit.{c,cpp,java,pas}Input file:autoedit.inOutput file:autoedit.outText-processing tools likeawkandsedallow you to automatically perform a sequence of editing operations based on a script. For this problem we consider the specific case in which we want to
阅读全文
摘要:Immediate DecodabilityAn encoding of a set of symbols is said to beimmediatelydecodable 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 binary, that no two codes within a set of codes are the same, that each code has at leas
阅读全文

浙公网安备 33010602011771号