Raphael_W

随笔分类 -  UVa

UVa 401 Palindromes
摘要:PalindromesA 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 阅读全文

posted @ 2013-05-05 01:04 Raphael_W 阅读(130) 评论(0) 推荐(0)

UVa 457 Hangman Judge
摘要:Linear Cellular AutomataA biologist is experimenting with DNA modification of bacterial colonies being grown in a linear array of culture dishes. By changing the DNA, he is able ``program" the bacteria to respond to the population density of the neighboring dishes. Population is measured on a f 阅读全文

posted @ 2013-05-04 14:23 Raphael_W 阅读(157) 评论(0) 推荐(0)

UVa 694 The Collatz Sequence
摘要:The Collatz SequenceAn algorithm given by Lothar Collatz produces sequences of integers, and is described as follows:Step 1:Choose an arbitrary positive integer A as the first item in the sequence.Step 2:If A = 1 then stop.Step 3:If A is even, then replace A by A / 2 and go to step 2.Step 4:If A is. 阅读全文

posted @ 2013-05-03 23:11 Raphael_W 阅读(111) 评论(0) 推荐(0)

UVa 489 Hangman Judge
摘要:Hangman JudgeIn ``Hangman Judge,'' you are to write a program that judges a series of Hangman games. For each game, the answer to the puzzle is given as well as the guesses. Rules are the same as the classic game of hangman, and are given as follows:The contestant tries to solve to puzzle by 阅读全文

posted @ 2013-05-03 20:46 Raphael_W 阅读(184) 评论(0) 推荐(0)

UVa 488 Triangle Wave
摘要:Triangle WaveIn this problem you are to generate a triangular wave form according to a specified pair of Amplitude and Frequency.Input and OutputThe input begins with a single positive integer on a line by itself indicating the number of the cases following, each of them as described below. This lin 阅读全文

posted @ 2013-05-03 18:22 Raphael_W 阅读(116) 评论(0) 推荐(0)

UVa 445 Marvelous Mazes
摘要:Marvelous MazesYour mission, if you decide to accept it, is to create a maze drawing program. A maze will consist of the alphabetic characters A-Z, * (asterisk), and spaces.Input and OutputYour program will get the information for the mazes from the input file. This file will contain lines of charac 阅读全文

posted @ 2013-05-03 15:34 Raphael_W 阅读(148) 评论(0) 推荐(0)

UVa 490 Rotating Sentences
摘要:Rotating SentencesIn ``Rotating Sentences,'' you are asked to rotate a series of input sentences 90 degrees clockwise. So instead of displaying the input sentences from left to right and top to bottom, your program will display them from top to bottom and right to left.Input and OutputAs inp 阅读全文

posted @ 2013-05-02 11:50 Raphael_W 阅读(334) 评论(0) 推荐(0)

UVa 414 Machined Surfaces
摘要:Machined Surfaces An imaging device furnishes digital images of twomachined surfaces that eventually will be assembled in contact witheach other. The roughness of this final contact is to be estimated. A digital image is composed of the two characters, "X"and " " (space). There a 阅读全文

posted @ 2013-05-02 10:43 Raphael_W 阅读(135898) 评论(0) 推荐(0)

UVa 494 Kindergarten Counting Game
摘要:Kindergarten Counting GameEverybody sit down in a circle. Ok. Listen to me carefully.``Woooooo, you scwewy wabbit!''Now, could someone tell me how many words I just said?Input and OutputInput to your program will consist of a series of lines, each line containing multiple words (at least one 阅读全文

posted @ 2013-05-01 14:41 Raphael_W 阅读(154) 评论(0) 推荐(0)

UVa 458 The Decoder
摘要:The DecoderWrite a complete program that will correctly decode a set of characters into a valid message. Your program should read a given file of a simple coded set of characters and print the exact message that the characters contain. The code key for this simple coding is a one for one character s 阅读全文

posted @ 2013-05-01 14:15 Raphael_W 阅读(137) 评论(0) 推荐(0)

UVa 10300 Ecological Premium
摘要:Problem AEcological PremiumInput: standard inputOutput: standard outputTime Limit: 1 secondMemory Limit: 32 MBGerman farmers are given a premium depending on the conditions at their farmyard. Imagine the following simplified regulation: you know the size of each farmer's farmyard in square meter 阅读全文

posted @ 2013-05-01 13:50 Raphael_W 阅读(114) 评论(0) 推荐(0)

UVa 10071 Back to High School Physics
摘要:Problem BBack to High School PhysicsInput: standard inputOutput: standard outputA particle has initial velocity and constant acceleration. If its velocity after certain time is v then what will its displacement be in twice of that time?InputThe input will contain two integers in each line. Each line 阅读全文

posted @ 2013-05-01 00:55 Raphael_W 阅读(540) 评论(0) 推荐(0)

UVa 10055 Hashmat the Brave Warrior
摘要:Problem AHashmat the brave warrior Input: standard inputOutput: standard outputHashmat is a brave warrior who with his group of young soldiers moves from one place to another to fight against his opponents. Before fighting he just calculates one thing, the difference between his soldier number and t 阅读全文

posted @ 2013-05-01 00:26 Raphael_W 阅读(122) 评论(0) 推荐(0)

UVa 100 3n+1 Problem
摘要:1 #include <stdio.h> 2 #define MAXN 1000000 3 int a[MAXN] = { 0, 1, 2 }; 4 int getCycleLength(long long n) 5 { 6 if (n < MAXN && !a[n]) 7 return a[n] = getCycleLength(((n & 1) == 0) ? (n >> 1) : (3 * n + 1)) + 1; 8 else 9 if(n >= MAXN)10 return overBoundry(n);11 ... 阅读全文

posted @ 2013-04-26 15:12 Raphael_W 阅读(111) 评论(0) 推荐(0)

导航