2013年3月9日

UVA1388 - Graveyard

摘要: GraveyardProgramming contests became so popular in the year 2397 that the governor of New Earck -- the largest human-inhabited planet of the galaxy -- opened a special Alley of Contestant Memories (ACM) at the local graveyard. The ACM encircles a green park, and holds the holographic statues of famo 阅读全文

posted @ 2013-03-09 15:07 仗剑奔走天涯 阅读(468) 评论(0) 推荐(0) 编辑

USACO3.3.4--Home on the Range

摘要: Home on the RangeFarmer John grazes his cows on a large, square field N (2 <= N <= 250) miles on a side (because, for some reason, his cows will only graze on precisely square land segments). Regrettably, the cows have ravaged some of the land (always in 1 mile square increments). FJ needs to 阅读全文

posted @ 2013-03-09 02:32 仗剑奔走天涯 阅读(215) 评论(0) 推荐(0) 编辑

2013年3月8日

UVA1368 - DNA Consensus String

摘要: DNA Consensus String Figure 1.DNA (Deoxyribonucleic Acid) is the molecule which contains the genetic instructions. It consists of four different nucleotides, namely Adenine, Thymine, Guanine, and Cytosine as shown in Figure 1. If we represent a n... 阅读全文

posted @ 2013-03-08 21:08 仗剑奔走天涯 阅读(368) 评论(0) 推荐(0) 编辑

SGU112 - a^b-b^a

摘要: 112. ab-batime limit per test: 0.5 sec.memory limit per test: 4096 KBYou are given natural numbers a and b. Find ab-ba.InputInput contains numbers a and b (1≤a,b≤100).OutputWrite answer to output.Sample Input2 3Sample Output-1题解:高精度乘法和高精度减法。水水的。。。不过第五个数据WA了,不知道为什么,是用函数memcmp去判断两个数组所代表的数的大小,莫名其妙的出错了, 阅读全文

posted @ 2013-03-08 19:18 仗剑奔走天涯 阅读(221) 评论(0) 推荐(0) 编辑

SGU102 - Coprimes

摘要: 102. Coprimestime limit per test: 0.5 sec.memory limit per test: 4096 KBFor given integer N (1<=N<=104) find amount of positive numbers not greater than N that coprime with N. Let us call two positive integers (say, A and B, for example) coprime if (and only if) their greatest common divisor i 阅读全文

posted @ 2013-03-08 03:32 仗剑奔走天涯 阅读(134) 评论(0) 推荐(0) 编辑

SGU101 - Domino

摘要: 101. Dominotime limit per test: 0.5 sec.memory limit per test: 4096 KBDominoes – game played with small, rectangular blocks of wood or other material, each identified by a number of dots, or pips, on its face. The blocks usually are called bones, dominoes, or pieces and sometimes men, stones, or eve 阅读全文

posted @ 2013-03-08 03:06 仗剑奔走天涯 阅读(291) 评论(0) 推荐(0) 编辑

2013年3月7日

UVA10020 - Minimal coverage

摘要: Minimal coverageThe ProblemGiven several segments of line (int the X axis) with coordinates [Li,Ri]. You are to choose the minimal amount of them, such they would completely cover the segment [0,M].The InputThe first line is the number of test cases, followed by a blank line.Each test case in the in 阅读全文

posted @ 2013-03-07 16:25 仗剑奔走天涯 阅读(302) 评论(0) 推荐(0) 编辑

UVA10026 - Shoemaker's Problem

摘要: Shoemaker's ProblemShoemaker has N jobs (orders from customers) which he must make. Shoemaker can work on only one job in each day. For each ithjob, it is known the integer Ti(1<=Ti<=1000), the time in days it takes the shoemaker to finish the job. For each day of delay before starting to 阅读全文

posted @ 2013-03-07 02:12 仗剑奔走天涯 阅读(237) 评论(0) 推荐(0) 编辑

2013年3月6日

UVA10970 - Big Chocolate

摘要: Problem GBig 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 bu... 阅读全文

posted @ 2013-03-06 23:40 仗剑奔走天涯 阅读(194) 评论(0) 推荐(0) 编辑

UVA1339 - Ancient Cipher

摘要: Ancient Roman empire had a strong government system with various departments, including a secret service department. Important documents were sent between provinces and the capital in encrypted form to prevent eavesdropping. The most popular ciphers in those times were so calledsubstitution cipheran 阅读全文

posted @ 2013-03-06 16:28 仗剑奔走天涯 阅读(506) 评论(0) 推荐(0) 编辑

UVA10340 - All in All

摘要: Problem EAll in AllInput:standard inputOutput:standard outputTime Limit:2 secondsMemory Limit:32 MBYou have devised a new encryption technique which encodes a message by inserting between its characters randomly generated strings in a clever way. Because of pending patent issues we will not discuss 阅读全文

posted @ 2013-03-06 14:06 仗剑奔走天涯 阅读(136) 评论(0) 推荐(0) 编辑

UVA11039 - Building designing

摘要: Building designingAn architect wants to design a very high building. The building will consist of some floors, and each floor has a certain size. The size of a floor must be greater than the size of the floor immediately above it. In addition, the designer (who is a fan of a famous Spanish football 阅读全文

posted @ 2013-03-06 02:37 仗剑奔走天涯 阅读(302) 评论(0) 推荐(0) 编辑

UVA11636 - Hello World!

摘要: Problem AHello World!Input:Standard InputOutput:Standard OutputWhen you first made the computer to print the sentence“Hello World!”, you felt so happy, not knowing how complex and interesting the world of programming and algorithm will turn out to be. Then you did not know anything about loops, so t 阅读全文

posted @ 2013-03-06 01:29 仗剑奔走天涯 阅读(250) 评论(0) 推荐(0) 编辑

UVA11300 - Spreading the Wealth

摘要: 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 阅读全文

posted @ 2013-03-06 00:48 仗剑奔走天涯 阅读(210) 评论(0) 推荐(0) 编辑

2013年3月1日

UVA11729 - Commando War

摘要: 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 阅读全文

posted @ 2013-03-01 21:57 仗剑奔走天涯 阅读(212) 评论(0) 推荐(0) 编辑

导航