算法竞赛-第七章
文章平均质量分 89
JeraKrs
本人目前就职于百度商业研发部,有需要内推的朋友简历可发我邮箱 jerakrs@qq.com
展开
-
uva 10603 Fill(隐式图搜索,哈希判重)
FILL There are three jugs with a volume of a, b and c liters. (a, b, and c are positive integers not greater than 200). The first and the second jug are initially empty, while the thirdis co原创 2013-08-12 21:47:03 · 1362 阅读 · 0 评论 -
uva 10391 Compound Words(stl map)
Compound WordsYou are to find all the two-word compound words in a dictionary. A two-word compound word is a word in the dictionary that is the concatenation of exactly two other words in the原创 2013-08-15 22:21:09 · 1018 阅读 · 0 评论 -
uva 11210 Chinese Mahjong(暴力搜索)
Chinese MahjongMahjong () is a game of Chinese origin usually played by four persons with tiles resembling dominoes and bearing various designs, which are drawn and discarded until one player原创 2013-08-17 21:23:41 · 2579 阅读 · 0 评论 -
uva 639 Don't Get Rooked(回溯)
Don't Get Rooked In chess, the rook is a piece that can move any number of squares vertically or horizontally. In this problem we will consider small chess boards (at most 44) that c原创 2013-07-20 13:10:05 · 1259 阅读 · 0 评论 -
uva 317 - Hexagon(规律推导)
题目连接:317 - Hexagon题目大意:在一个19个六边形组成的图形上玩一个游戏,给出9个数字, 分成3组, 分别可以填在左上角, 上, 有上角,因为对于小六边形来说, 对边的数是相同的, 然后这样9个数可以组成27个不同的小六边形, 现在要将在这27个小的六边形中选取19个填入图形中, 尽量使得的分最高,并且不可以重复使用小六边形。 得分的计算是对应图形的某一方向上, 如果原创 2013-09-02 23:59:12 · 1696 阅读 · 0 评论 -
uva 11198 Dancing Digits(隐式图搜索+哈细判重)
Dancing DigitsDigits like to dance. One day, 1, 2, 3, 4, 5, 6, 7 and 8 stand in a line to have a wonderful party. Each time, a male digit can ask a female digit to dance with him, or a female原创 2013-08-16 10:14:40 · 1202 阅读 · 0 评论 -
uva 10274 Fans and Gems(隐式图搜索+模拟)
Fans and GemsInput: Standard InputOutput: Standard OutputTomy's fond of a game called 'Fans and Gems' (also known as Gravnic). In the game, he can use fans to collect gems, but he's sati原创 2013-08-17 14:41:48 · 1636 阅读 · 0 评论 -
uva 310 L--system(隐式图搜索+字符串处理)
L-system A D0L (Deterministic Lindenmayer system without interaction) system consists of a finite set of symbols (the alphabet), a finite set P of productions and a starting string原创 2013-08-17 21:31:45 · 1907 阅读 · 7 评论 -
uva 704 Colour Hash(隐式图搜索+ 模拟)
Colour Hash This puzzle consists of two wheels. Both wheels can rotate both clock and counter-clockwise. They contain 21 coloured pieces, 10 of which are rounded triangles and 11 of wh原创 2013-08-17 11:41:09 · 1422 阅读 · 0 评论 -
uva 141 The Spot Game(STL set)
The Spot Game The game of Spot is played on an NxN board as shown below for N = 4. During the game, alternate players may either place a black counter (spot) in an empty square or remove o原创 2013-08-17 15:41:02 · 1367 阅读 · 0 评论 -
uva 188 Perfect Hash(进制转换 + 遍历)
Perfect Hash Perfect Software, Inc. has obtained a government contract to examine text flowing through a high-speed network for the occurrence of certain words. Your boss, Wally Perfect, h原创 2013-08-17 11:26:33 · 1732 阅读 · 0 评论 -
uva 165 Stamps (DFS)
Stamps The government of Nova Mareterrania requires that various legal documents have stamps attached to them so that the government can derive revenue from them. In terms of recent le原创 2013-08-04 23:53:58 · 1296 阅读 · 0 评论 -
uva 10125 Sumsets(搜索)
adjshfk原创 2013-08-15 22:35:24 · 981 阅读 · 0 评论 -
uva 110 Meta-Loopless Sorts(递归)
Meta-Loopless Sorts Background Sorting holds an important place in computer science. Analyzing and implementing various sorting algorithms forms an important part of the educatio原创 2013-08-11 14:03:22 · 1281 阅读 · 0 评论 -
uva 10887 Concatenation of Languages(STL set)
Concatenation of LanguagesInput File: Standard InputOutput: Standard Output A language is a set of strings. And the concatenation of two languages is the set of all strings that are formed by原创 2013-08-15 23:12:41 · 1433 阅读 · 0 评论 -
uva 529 Addition Chains(迭代深搜)
Addition Chains An addition chain for n is an integer sequence $"> with the following four properties:a0 = 1am = na012m-1mFor each k ( ) there exist two (not neccessarily diffe原创 2013-08-06 12:55:45 · 1410 阅读 · 0 评论 -
uva 519 Puzzle (II)(回溯)
Puzzle (II) Little Barborka has just started to learn how to solve a picture puzzle. She has started with a small one containing 15 pieces. Her daddy tries to solve the puzzle too. To原创 2013-08-08 09:16:40 · 1538 阅读 · 0 评论 -
uva 307 Sticks(DFS+ 剪枝)
Sticks George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how原创 2013-08-06 20:01:09 · 3923 阅读 · 0 评论 -
uva 502 DEL command(字符串处理)
DEL command It is required to find out whether it is possible to delete given files from MS-DOS directory executing the DEL command of MS-DOS operation system only once. There are no n原创 2013-08-11 10:24:35 · 1380 阅读 · 0 评论 -
uva 10642 Super Number(dfs)
Super NumberInput: Standard InputOutput: Standard OutputTime Limit: 3 Seconds Don't you think 162456723 very special? Look at the picture below if you are unable to find its speciality. (a |原创 2013-08-15 22:04:06 · 1322 阅读 · 0 评论 -
uva 10123 No Tipping(DFS+几何力矩+贪心)
No TippingAs Archimedes famously observed, if you put an object on a lever arm, it will exert a twisting force around the lever's fulcrum. This twisting is called torque and is equal to the object原创 2013-08-05 16:56:04 · 2081 阅读 · 0 评论 -
uva 10012 How Big Is It?(下一个排序 + DFS)
How Big Is It? Ian's going to California, and he has to pack his things, including his collection of circles. Given a set of circles, your program must find the smallest rectangular box原创 2013-08-04 23:40:19 · 1609 阅读 · 0 评论 -
uva 387 A Puzzling Problem (回溯)
A Puzzling Problem The goal of this problem is to write a program which will take from 1 to 5 puzzle pieces such as those shown below and arrange them, if possible, to form a square. A原创 2013-08-08 09:01:51 · 1335 阅读 · 0 评论 -
uva 140 Bandwidth (下一个序列+判断)
Bandwidth Given a graph (V,E) where V is a set of nodes and E is a set of arcs in VxV, and an ordering on the elements in V, then thebandwidth of a node v is defined as the maximum dis原创 2013-08-05 00:13:00 · 1672 阅读 · 1 评论 -
uva 10591 Happy Number(判重)
Description Problem CHappy NumberTime Limit1 Second Let the sum of the square of the digits of a positive integer S0 be represented by S1. In a simila原创 2013-08-15 22:53:52 · 1256 阅读 · 0 评论 -
uva 10282 Babelfish(STL map)
BabelfishYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.原创 2013-08-15 22:12:10 · 1953 阅读 · 0 评论 -
uva 10098 Generating Fast, Sorted Permutation
Generating Fast, Sorted PermutationInput: Standard InputOutput: Standard Output Generating permutation has always been an important problem in computer science. In this problem you will have原创 2013-07-18 10:44:20 · 1326 阅读 · 0 评论 -
uva 10344 23 out of 5(DFS)
23 Out of 5Input: standard inputOutput: standard outputTime Limit: 1 secondMemory Limit: 32 MBYour task is to write a program that can decide whether you can find an arithmetic expression co原创 2013-07-20 13:16:04 · 1239 阅读 · 0 评论 -
uva 729 The Hamming Distance Problem
The Hamming Distance Problem The Hamming distance between two strings of bits (binary integers) is the number of corresponding bit positions that differ. This can be found by using XOR原创 2013-07-18 10:48:57 · 1218 阅读 · 0 评论 -
uva 539 The Settlers of Catan
The Settlers of Catan Within Settlers of Catan, the 1995 German game of the year, players attempt to dominate an island by building roads, settlements and cities across its uncharted w原创 2013-07-16 14:06:09 · 1418 阅读 · 1 评论 -
uva 167 The Sultan's Successors(回溯)
The Sultan's Successors The Sultan of Nubia has no children, so she has decided that the country will be split into up to k separate parts on her death and each part will be inherited原创 2013-07-31 09:52:34 · 2173 阅读 · 0 评论 -
uva 208 Firetruck (DFS + 并查集)
Firetruck The Center City fire department collaborates with the transportation department to maintain maps of the city which reflects the current status of the city streets. On any given原创 2013-08-04 14:09:20 · 1240 阅读 · 0 评论 -
uva 146 ID Codes
ID Codes It is 2084 and the year of Big Brother has finally arrived, albeit a century late. In order to exercise greater control over its citizens and thereby to counter a chronic brea原创 2013-07-18 10:39:16 · 1111 阅读 · 0 评论 -
uva 10167 Birthday Cake
Problem G. Birthday Cake 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原创 2013-07-17 12:57:03 · 1284 阅读 · 0 评论 -
uva 331 Mapping the Swaps(DFS+回溯)
Mapping the Swaps Sorting an array can be done by swapping certain pairs of adjacent entries in the array. This is the fundamental technique used in the well-known bubble sort. If we l原创 2013-07-20 14:57:15 · 997 阅读 · 0 评论 -
uva 11205 The Broken Pedometer
The Broken Pedometer The ProblemA marathon runner uses a pedometer with which he is having problems. In the pedometer the symbols are represented by seven segments (or LEDs):But原创 2013-07-17 13:05:45 · 1208 阅读 · 0 评论 -
uva 11218 KTV(DFS)
KTVOne song is extremely popular recently, so you and your friends decided to sing it in KTV. The song has 3 characters, so exactly 3 people should sing together each time (yes, there are 3 mi原创 2013-08-01 21:20:26 · 1389 阅读 · 0 评论 -
uva 193 Graph Coloring(DFS)
Graph Coloring You are to write a program that tries to find an optimal coloring for a given graph. Colors are applied to the nodes of the graph and the only available colors are black原创 2013-08-04 13:42:04 · 1409 阅读 · 0 评论 -
uva 10001 Garden of Eden (DFS)
Garden of Eden Cellular automata are mathematical idealizations of physical systems in which both space and time are discrete, and the physical quantities take on a finite set of discret原创 2013-08-05 00:02:02 · 1208 阅读 · 2 评论 -
uva 10085 The most distant state(八数码)
The Most Distant StateInput: standard inputOutput: standard output The 8-puzzle is a square tray in which eight square tiles are placed. The remaining ninth square is uncovered. Each tile has原创 2013-08-12 21:58:31 · 1465 阅读 · 0 评论