
回溯
文章平均质量分 84
SPZn_up
这个作者很懒,什么都没留下…
展开
-
uva 639 Don't Get Rooked (暴力回溯 )
uva 639 Don't Get RookedIn 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) tha原创 2015-01-27 16:16:17 · 798 阅读 · 0 评论 -
uva 165 Stamps (回溯)
uva 165 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 rec原创 2015-03-03 19:33:22 · 597 阅读 · 0 评论 -
uva 10422 Knights in FEN(DFS + 回溯)
uva 10422 Knights in FENThere are black and white knights on a 5 by 5 chessboard. There are twelve of each color, and there is one square that is empty. At any time, a knight can move into an原创 2015-02-12 22:46:42 · 666 阅读 · 0 评论 -
uva 519 Puzzle (II)(回溯)
uva 519 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 m原创 2015-02-10 19:29:09 · 554 阅读 · 0 评论 -
uva 10123 No Tipping(逆向思维+力矩)
uva 10123 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 t原创 2015-02-08 15:16:31 · 807 阅读 · 0 评论 -
uva 11218 KTV(DFS+回溯)
uva 11218 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, ther原创 2015-02-05 16:12:19 · 756 阅读 · 0 评论 -
uva 307 Sticks(回溯剪枝)
uva 307 SticksGeorge 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 m原创 2015-02-04 14:35:01 · 1014 阅读 · 0 评论 -
uva 331 Mapping the Swaps (回溯)
uva 331 Mapping the SwapsSorting 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 li原创 2015-02-02 17:17:11 · 673 阅读 · 0 评论 -
uva 208 Firetruck (回溯)
uva 208 FiretruckThe 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 give原创 2015-02-01 20:13:50 · 538 阅读 · 0 评论 -
uva 193 Graph Coloring(回溯)
uva 193 Graph ColoringYou 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 bl原创 2015-02-01 12:01:26 · 1019 阅读 · 0 评论 -
uva 539 The Settlers of Catan(回溯)
uva 539 The Settlers of CatanWithin 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 wilder原创 2015-01-29 11:12:14 · 599 阅读 · 0 评论 -
uva 10344 23 out of 5 (DFS)
uva 10344 23 out of 5 Your task is to write a program that can decide whether you can find an arithmetic expression consisting of five given numbers(1For this problem we will only consid原创 2015-01-29 12:06:46 · 693 阅读 · 0 评论 -
uva 301 Transportation(回溯)
uva 301 TransportationRuratania is just entering capitalism and is establishing new enterprising activities in many fields including transport. The transportation company TransRuratania is sta原创 2015-01-29 11:05:53 · 759 阅读 · 0 评论 -
uva 216 Getting in Line (暴力枚举)
uva 216 Getting in Line Computer networking requires that the computers in the network be linked. This problem considers a ``linear" network in which the computers are chained together so原创 2015-01-27 13:05:19 · 1017 阅读 · 0 评论 -
hdu 5339 Untitled(回溯)
hdu 5339 Untitled题目大意:给出n个数字的序列,和一个数a,在n中有m个数b1,...,bmb1,...,bm使得__a %b1%b2%...%bm = 0__a %b1%b2%...%bm = 0,求最小的m。解题思路:回溯。#include <cstdio>#include <cstring>#include <algorithm>#include <cmath>#inc原创 2015-08-02 10:34:33 · 473 阅读 · 0 评论