ICPC-Ad Hoc
有关Ad Hoc的题解
海岛Blog
专注于程序设计及其竞赛,专注于集成电路EDA设计
展开
-
UVA10945 Mother bear【Ad Hoc】
Unforunately for our lazy “heroes”, the nuts were planted by an evil bear known as… Dave, and they’ve fallen right into his trap. Dave is not just any bear, he’s a talking bear, but he can only unders...原创 2019-07-20 13:25:57 · 420 阅读 · 0 评论 -
UVA12136 LA4202 Schedule of a Married Man【Ad Hoc】
Last year we set a problem on bachelor arithmetic which made some bachelors really unhappy. So to even things up, we are making a problem on the tough schedule of a married man. &nbs...原创 2019-03-24 21:24:56 · 292 阅读 · 0 评论 -
UVA10894 Save Hridoy【Ad Hoc】
It would have been great if all the banners with good words could inspire us all. Then we could only make large banners with good words on them to make this world beautiful. With all the good wishes o...原创 2018-08-07 23:26:48 · 428 阅读 · 0 评论 -
POJ2664 HDU1144 ZOJ2548 UVA10919 Prerequisites?【Ad Hoc】
Prerequisites?Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 4014 Accepted: 2519 DescriptionFreddie the frosh has chosen to take k courses. To meet the degree requi...原创 2018-08-07 22:57:30 · 370 阅读 · 0 评论 -
POJ2612 ZOJ1862 UVA10279 Mine Sweeper【Ad Hoc+模拟】
Mine SweeperTime Limit:1000MS Memory Limit:65536K Total Submissions:7153 Accepted:2769 DescriptionThe game Minesweeper is played on an n by n grid. In this grid are hidden ...原创 2018-08-06 12:08:15 · 835 阅读 · 0 评论 -
POJ2339 ZOJ1921 UVA10443 Rock, Scissors, Paper【Ad Hoc】
Rock, Scissors, PaperTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 4301 Accepted: 2490DescriptionBart's sister Lisa has created a new civilization on a two-dimensional grid. At the outset ...原创 2018-05-30 10:32:08 · 934 阅读 · 0 评论 -
SPOJ-TEST Life, the Universe, and Everything【Ad Hoc】
Your program is to use the brute-force approach in order to find the Answer to Life, the Universe, and Everything. More precisely... rewrite small numbers from input to output. Stop processing input a...原创 2018-05-30 08:00:33 · 507 阅读 · 0 评论 -
UVA10515 Powers Et Al.【数学+Ad Hoc】
计算n^m 的最后一位Finding the exponent of any number can be very troublesome as it grows exponentially. But in this problem you will have to do a very simple task. Given two non-negative numbers m and n, you...原创 2018-05-30 07:46:47 · 460 阅读 · 0 评论 -
POJ2361 ZOJ1908 UVA10363 Tic Tac Toe【Ad Hoc】
Tic Tac ToeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2385 Accepted: 903DescriptionTic Tac Toe is a child's game played on a 3 by 3 grid. One player, X, starts by placing an X at an uno...原创 2018-05-29 08:52:05 · 1110 阅读 · 0 评论 -
POJ2943 UVALive3524 The Cow Doctor【bitset+枚举】
The Cow DoctorTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 1601 Accepted: 528DescriptionTexas is the state having the largest number of cows in the US: according to the 2005 report of the...原创 2018-05-04 21:41:09 · 737 阅读 · 0 评论 -
POJ2608 ZOJ1858 UVA10260 Soundex【编码】
SoundexTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9825 Accepted: 4893DescriptionSoundex coding groups together words that appear to sound alike bas原创 2018-01-31 10:36:43 · 867 阅读 · 0 评论 -
POJ2573 ZOJ1877 Bridge【贪心】
BridgeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4148 Accepted: 1420 Special JudgeDescriptionn people wish to cross a bridge at night. A group原创 2018-02-07 08:48:38 · 1002 阅读 · 0 评论 -
POJ2538 ZOJ1884 UVA10082 WERTYU【输入输出+水题】
WERTYUTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9449 Accepted: 4515DescriptionA common typing error is to place the hands on the keyboard one ro原创 2016-07-29 08:41:36 · 1514 阅读 · 0 评论 -
POJ2234 Matches Game【Nim博弈】
Matches GameTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 11069 Accepted: 6469DescriptionHere is a simple game. In this game, there are several piles of matches and two players. The two pl...原创 2018-05-03 00:27:07 · 639 阅读 · 0 评论 -
POJ1852 UVa10714 ZOJ2376 Ants【水题】
AntsTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 18360 Accepted: 7736DescriptionAn army of ants walk on a horizontal pole of length l cm, each with a原创 2017-05-18 16:33:53 · 1284 阅读 · 1 评论 -
HDU1014 POJ1597 UVALive5492 UVA408 ZOJ1314 Uniform Generator【随机函数+水题】
Uniform GeneratorTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 5584 Accepted: 2607DescriptionComputer simulations often require random numbers. One wa原创 2017-11-14 08:12:54 · 982 阅读 · 1 评论 -
UVALive5429 UVA382 POJ1528 HDU1323 ZOJ1284 Perfection【整除+水题】
PerfectionTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 13162 Accepted: 6021DescriptionFrom the article Number Theory in the 1994 Microsoft Encarta: `原创 2016-08-10 09:49:36 · 1154 阅读 · 0 评论 -
UVA993 Product of digits【水题+字符串排序+不排序】
For a given non-negative integer number N, find the minimal natural Q such that the product of alldigits of Q is equal N.InputThe first line of input contains one positive integer number, which is原创 2018-01-20 21:35:16 · 719 阅读 · 5 评论 -
POJ3359 UVA1209 LA3173 Wordfish【Ad Hoc】
WordfishTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 1082 Accepted: 535DescriptionYou have been tasked to infiltrate a tight-lipped society for fun and profit: the ACM ICPC regional...原创 2019-03-24 22:23:44 · 434 阅读 · 0 评论 -
UVA11800 Determine the Shape【几何】
A toy company recently found that toys like revolver, machine guns, fighting planes are making children violent and destroying the peace of the world. The parents also began to avoid these toys and in...原创 2019-03-24 23:11:28 · 360 阅读 · 0 评论 -
UVA11727 Cost Cutting【Ad Hoc】
Company XYZ have been badly hit by recession and is taking a lot of cost cutting measures. Some of these measures include giving up office space, going open source, reducing incentives, cutting on lux...原创 2019-03-25 01:50:02 · 400 阅读 · 0 评论 -
UVA11221 Magic square palindromes.【Ad Hoc】
A magic square palindrome is a sentence whose characters can be divided in a K ×K square table with the property that the original sentence can be read from the table in four different ways:• Start f...原创 2019-07-20 12:52:41 · 421 阅读 · 1 评论 -
UVA11309 Counting Chaos【Ad Hoc】
Wolfgang Puck’s rival, Emeril Lagasse (“BAM!”), recently set the world culinary record in the category of smallest souffl´e measuring in at a mere 2 cm! Wolfgang, not to be outdone, decided that he wo...原创 2019-07-15 06:20:40 · 330 阅读 · 0 评论 -
UVA12239 LA4806 Bingo!【Ad Hoc】
Albert, Charles and Mary invented a new version of the classical game Bingo. In traditional Bingo the game is presided over by a non-player known as the caller. At the beginning of the game each playe...原创 2019-07-14 18:27:45 · 399 阅读 · 0 评论 -
UVA11459 HDU3168 Snakes and Ladders【Ad Hoc】
Snakes and Ladders is a board game played on a 10 by 10 grid. The squares of the grid are numbered 1 to 100. Each player has a token which is placed on the square numbered 1 at the beginning of the ga...原创 2019-07-14 16:29:49 · 326 阅读 · 0 评论 -
UVA10530 POJ2328 ZOJ1926 Guessing Game【Ad Hoc】
Stan and Ollie are playing a guessing game. Stan thinks of a number between 1 and 10 and Ollie guesses what the number might be. After each guess, Stan indicates whether Ollie’s guess is too high, too...原创 2019-07-14 06:36:35 · 383 阅读 · 0 评论 -
UVA10849 Move the bishop【国际象棋】
Consider you have a chess board with N × N squares, 1 ≤ N ≤ 100.000.000. There is only a piece onthe board: the bishop. The position of the bishop is given by a pair of numbers 1 ≤ r, c ≤ N; r is the...原创 2019-07-13 19:37:27 · 774 阅读 · 0 评论 -
UVA353 LA5247 Pesky Palindromes【回文】
A palindrome is a sequence of one or more characters that reads the same from the left as it does from the right. For example, Z, TOT and MADAM are palindromes, but ADAM is not. &nbs...原创 2019-04-24 23:15:36 · 866 阅读 · 0 评论 -
UVA947 Master Mind Helper【Game】
Master Mind was invented around 1970/71 by Mordecai Meirowitz, an Israeli Postmaster/Telecommunications expert. His idea was at first turned down by many of the leading toy companies, but he persisted...原创 2019-04-24 22:21:20 · 683 阅读 · 1 评论 -
UVA11942 Lumberjack Sequencing【Ad Hoc】
Another tale of lumberjacks?. Let see … The lumberjacks are rude, bearded workers, while foremen tend to be bossy and simpleminded. The foremen like to harass the lumberjacks b...原创 2019-03-30 07:08:24 · 451 阅读 · 0 评论 -
UVA11764 Jumping Mario【Ad Hoc】
Mario is in the final castle. He now needs to jump over few walls and then enter the Koopa’s Chamber where he has to defeat the monster in order to save the princess. For this problem, we are only con...原创 2019-03-30 06:39:32 · 676 阅读 · 0 评论 -
POJ2501 ZOJ1890 UVA10281 Average Speed【水题】
Average SpeedTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5207 Accepted: 2328DescriptionYou have bought a car in order to drive from Waterloo to a big city. The odometer on their ca...原创 2019-03-23 09:46:23 · 535 阅读 · 0 评论 -
POJ2691 ZOJ1844 UVA10141 Request for Proposal【最值】
Request for ProposalTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 615 Accepted: 287DescriptionWhen government, military, or commercial agencies wish to make a major purchase, they fi...原创 2019-03-22 17:49:34 · 375 阅读 · 0 评论 -
UVA10683 The decadary watch【Ad Hoc】
In the first years following the French Revolution, intellectuals were set to outroot the society from the traditions and superstitions the dark ages of the royalty. Some of these contributions have h...原创 2019-03-26 09:08:19 · 361 阅读 · 0 评论 -
UVA10703 Free spots【暴力】
Write a program, that, given a board, and a list of rectangular sub-portions of the board, returns the number of positions that belong to no sub-portion.InputThe input consists of a series of test s...原创 2019-03-26 08:11:22 · 1391 阅读 · 0 评论 -
UVA11332 Summing Digits【数根】
For a positive integer n, let f(n) denote the sum of the digits of n when represented in base 10. It is easy to see that the sequence of numbers n, f(n), f(f(n)), f(f(f(n))), . . . eventually becomes ...原创 2019-03-26 07:46:16 · 760 阅读 · 0 评论 -
UVA11044 Searching for Nessy【水题】
The Loch Ness Monsteris a mysterious and unidentified animal said to inhabit Loch Ness, a large deep freshwater loch near the city of Inverness in northern Scotland. Nessie is usually categorized as a...原创 2019-03-25 03:07:28 · 500 阅读 · 0 评论 -
UVA11498 Division of Nlogonia【Ad Hoc】
After centuries of hostilities and skirmishes between the four nations living in the land generally known as Nlogonia, and years of negotiations involving diplomats, politicians and the armed forces o...原创 2019-03-25 02:11:50 · 492 阅读 · 0 评论 -
UVA944 Happy Numbers【数学】
Let the sum of the squares of the digits of a positive integer s0 be represented by s1. In a similar way, let the sum of the squares of the digits of s1 be represented by s2, and so on. If si = 1 for ...原创 2018-02-17 23:11:02 · 669 阅读 · 0 评论 -
UVA494 Kindergarten Counting Game【输入输出+水题】
Everybody 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?InputInput to your program will consist of a s...原创 2016-08-17 09:02:13 · 1242 阅读 · 0 评论