随笔分类 -  UVA

摘要:Physics teachers in high school often think that problems given as text are more demanding than pure computations. After all, the pupils have to read and understand the problem first!So they don't state a problem like ``U=10V, I=5A, P=?" but rather like ``You have an electrical circuit that 阅读全文
posted @ 2013-03-15 15:47 WingWing111 阅读(188) 评论(0) 推荐(0)
摘要:BackgroundLucy and Lily are twins. Today is their birthday. Mother buys a birthday cake for them.Now we put the cake onto a Descartes coordinate. Its center is at (0,0), and the cake's length of radius is 100.There are 2N (N is a integer, 1 #include #include #include #include #include #include . 阅读全文
posted @ 2013-03-15 09:19 WingWing111 阅读(234) 评论(0) 推荐(0)
摘要:“Oh God”, Lara Croft exclaims, “it’sone of these dumb riddles again!”In Tomb Raider XIV, Lara is, as ever, gunning her way through ancient Egyptian pyramids, prehistoric caves and medival hallways. Now she is standing in front of some important Germanic looking doorway and has to solve a linguistic 阅读全文
posted @ 2013-03-13 00:51 WingWing111 阅读(219) 评论(0) 推荐(0)
摘要:Given ambyngrid of letters, (), and a list of words, find the location in the grid at which the word can be found. A word matches a straight, uninterrupted line of letters in the grid. A word can match the letters in the grid regardless of case (i.e. upper and lower case letters are to be treated as 阅读全文
posted @ 2013-03-12 17:03 WingWing111 阅读(268) 评论(0) 推荐(0)
摘要:A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string"ABCDEDCBA"is a palindrome because it is the same when the string is read from left to right as when the string is read from right to left.A mirrored string is a string for w 阅读全文
posted @ 2013-03-11 22:46 WingWing111 阅读(180) 评论(0) 推荐(0)
摘要:It is easy to see that for every fraction in the form(k> 0), we can always find two positive integersxandy,x≥y, such that:.Now our question is: can you write a program that counts how many such pairs ofxandythere are for any givenk?InputInput contains no more than 100 lines, each giving a value o 阅读全文
posted @ 2013-03-08 22:03 WingWing111 阅读(289) 评论(0) 推荐(0)
摘要:Write a program that finds and displays all pairs of 5-digit numbers that between them use the digits0through9once each, such that the first number divided by the second is equal to an integerN, where. That is,abcde / fghij =Nwhere each letter represents a different digit. The first digit of one of 阅读全文
posted @ 2013-03-07 17:15 WingWing111 阅读(438) 评论(0) 推荐(0)
摘要:Little Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital letters in the nodes.This is an example of one of her creations: D / \ ... 阅读全文
posted @ 2013-03-05 17:15 WingWing111 阅读(159) 评论(0) 推荐(0)
摘要:BackgroundTrees are fundamental in many branches of computer science. Current state-of-the art parallel computers such as Thinking Machines' CM-5 are based onfat trees. Quad- and octal-trees are fundamental to many algorithms in computer graphics.This problem involves building and traversing bin 阅读全文
posted @ 2013-03-05 16:37 WingWing111 阅读(232) 评论(0) 推荐(0)
摘要:A number ofKballs are dropped one by one from the root of a fully binary tree structure FBT. Each time the ball being dropped first visits a non-terminal node. It then keeps moving down, either follows the path of the left subtree, or follows the path of the right subtree, until it stops at one of t 阅读全文
posted @ 2013-03-05 04:48 WingWing111 阅读(236) 评论(0) 推荐(0)
摘要:Problem B: Throwing cards away IGiven is an ordered deck ofncards numbered 1 tonwith card 1 at the top and cardnat the bottom. The following operation is performed as long as there are at least two cards in the deck:Throw away the top card and move the card that is now on the top of the deck to the 阅读全文
posted @ 2013-03-04 03:49 WingWing111 阅读(649) 评论(0) 推荐(0)
摘要:In these days you can more and more often happen to see programs which perform some useful calculations being executed rather then trivial screen savers. Some of them check the system message queue and in case of finding it empty (for examples somebody is editing a file and stays idle for some time) 阅读全文
posted @ 2013-03-03 18:21 WingWing111 阅读(156) 评论(0) 推荐(0)
摘要:One of the famous proofs of modern mathematics is Georg Cantor's demonstration that the set of rational numbers is enumerable. The proof works by using an explicit enumeration of rational numbers as shown in the diagram below.In the above diagram, the first term is 1/1, the second term is 1/2, t 阅读全文
posted @ 2013-03-03 16:59 WingWing111 阅读(159) 评论(0) 推荐(0)
摘要:In millions of newspapers across the United States there is a word game calledJumble. The object of this game is to solve a riddle, but in order to find the letters that appear in the answer it is necessary to unscramble four words. Your task is to write a program that can unscramble words.InputThe 阅读全文
posted @ 2013-03-03 03:48 WingWing111 阅读(228) 评论(0) 推荐(0)
摘要:Children are taught to add multi-digit numbers from right-to-left one digit at a time. Many find the "carry" operation - in which a 1 is carried from one digit position to be added to the next - to be a significant challenge. Your job is to count the number of carry operations for each of 阅读全文
posted @ 2013-03-03 03:13 WingWing111 阅读(166) 评论(0) 推荐(0)