搜索/回溯
文章平均质量分 91
synapse7
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Codeforces Round #147 (Div. 2) / 237B Young Table (搜索)
B. Young Table http://codeforces.com/problemset/problem/237%2FB time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output原创 2013-08-26 09:16:03 · 1103 阅读 · 0 评论 -
UVa 10717 Mint (DFS枚举4个数的lcm)
10717 - Mint Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=115&page=show_problem&problem=1658 The Royal Canadian Mint has commissioned a原创 2013-11-03 14:23:58 · 1267 阅读 · 0 评论 -
POJ 1979 Red and Black (DFS)
Red and Black http://poj.org/problem?id=1979 Time Limit: 1000MS Memory Limit: 30000K Description There is a rectangular room, covered with square tiles. Each tile is colored eit原创 2013-11-06 21:32:28 · 1319 阅读 · 0 评论 -
NWERC 2007 / UVa 12124 Assemble (二分搜索&最小值最大问题)
12124 - Assemble Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=456&page=show_problem&problem=3276 Recently your team noticed that the原创 2013-11-10 22:24:57 · 1351 阅读 · 0 评论 -
UVa 1267 Network (DFS&贪心)
1267 - Network Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=456&page=show_problem&problem=3708 Consider a tree network with n nodes w原创 2013-11-11 08:39:19 · 1211 阅读 · 0 评论 -
POJ 2251 Dungeon Master (BFS)
Dungeon Master http://poj.org/problem?id=2251 Time Limit: 1000MS Memory Limit: 65536K Description You are trapped in a 3D dungeon and need to find the quickest way out! The dung原创 2013-11-10 14:20:48 · 1392 阅读 · 0 评论 -
UVa 11210 Chinese Mahjong (模拟&枚举&回溯)
11210 - Chinese Mahjong Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=2151 Mahjong () is a game of Chinese origin usually played by原创 2013-10-13 21:19:55 · 984 阅读 · 0 评论 -
CERC 2004 / UVa 1335 Beijing Guards (二分&贪心&想法题)
1335 - Beijing Guards Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=456&page=show_problem&problem=4081 Beijing was once surrounded by原创 2013-11-11 12:21:48 · 1371 阅读 · 0 评论 -
UVa 10308 Roads in the North (树上的最长路)
10308 - Roads in the North Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=115&page=show_problem&problem=1249 思路:由于是一棵树,我们只要随便指定一个树根就开原创 2013-11-26 18:18:39 · 1710 阅读 · 2 评论 -
POJ 3126 / Northwestern Europe 2006 Prime Path (数论&BFS)
Prime Path http://poj.org/problem?id=3126 Time Limit: 1000MS Memory Limit: 65536K Description The ministers of the cabinet were quite upset by the message from the Chief of Secu原创 2013-08-25 13:56:44 · 1201 阅读 · 0 评论 -
UVa 167 The Sultan's Successors (八皇后问题)
167 - The Sultan's Successors Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=108&page=show_problem&problem=103 The Sultan of Nubia has n原创 2013-10-16 14:40:02 · 1596 阅读 · 0 评论 -
Codeforces Round #218 (Div. 2) / 371C Hamburgers (二分)
http://codeforces.com/contest/371/problem/C 直接二分能做的汉堡数,注意上界要开大一点。 完整代码: /*15ms,0KB*/ #include using namespace std; const long long mx = 1e13;///多开一位,因为结果可以略大于1e12 const char b[] = "BSC";原创 2014-03-12 12:15:33 · 1072 阅读 · 0 评论 -
Codeforces Beta Round #87 (Div. 2) / 116C Party (DFS&树的最大深度)
http://codeforces.com/problemset/problem/116/C 从树根DFS,看最大能递归几层。 /*30ms,300KB*/ #include using namespace std; const int mx = 2005; vector v[mx]; bool fa[mx]; int maxlen; void dfs(int i, int原创 2014-03-09 10:28:20 · 1383 阅读 · 0 评论 -
Codeforces Beta Round #87 (Div. 2) / 116D Lawnmower (讨论情况)
http://codeforces.com/problemset/problem/116/D /*30ms,0KB*/ #include const int mx = 155; char g[mx][mx]; int left[mx], right[mx]; int main() { int n, m, i, j, posy, dir; int cnt = -1; scanf原创 2014-03-09 10:38:40 · 1241 阅读 · 0 评论 -
UVa 200 Rare Order (拓扑排序)
200 - Rare Order Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=136 题意:给一列单词,这些单词是按一种未知的字典顺序排列的,要求输出这些字母原创 2013-11-18 12:28:07 · 2116 阅读 · 0 评论 -
UVa 331 Mapping the Swaps (DFS)
331 - Mapping the Swaps Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=108&page=show_problem&problem=267 Sorting an array can be done b原创 2013-10-29 08:31:28 · 1004 阅读 · 0 评论 -
Codeforces Round #196 (Div. 2) / 337A Puzzles (搜索)
A. Puzzles http://codeforces.com/contest/337/problem/A time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Th原创 2013-08-17 10:48:26 · 1542 阅读 · 0 评论 -
UVa 340 Master-Mind Hints (优化查找&复制数组)
学英语: 1. Match (i,j) is called strong when i =j, and is called weak otherwise. 当i=j时,匹配(i,j)被叫做强匹配,反之叫做弱匹配。 2. Two matches (i,j) and (p,q) are called independent when i = p if and only if j = q. A set of matches is called independent when all of its members原创 2013-09-30 00:22:56 · 2057 阅读 · 0 评论 -
UVa 439/HDU 1372/POJ 2243/ZOJ 1091 Knight Moves(BFS&纯数学方法)
439 - Knight Moves Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=105&page=show_problem&problem=380 http://acm.hdu.edu.cn/showproblem.php?原创 2013-08-03 19:35:48 · 1382 阅读 · 0 评论 -
UVa 524 Prime Ring Problem (数论&DFS)
524 - Prime Ring Problem Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=465 A ring is composed of n (even number) circl原创 2013-09-13 16:20:38 · 1388 阅读 · 0 评论 -
UVa 129 Krypton Factor (回溯好题)
129 - Krypton Factor Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=65 You have been employed by the organisers of a Super Krypton F原创 2013-10-14 21:59:31 · 1083 阅读 · 0 评论 -
UVa 10344 23 out of 5 (全排列枚举&回溯)
10344 - 23 out of 5 Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1285 Your task is to write a program t原创 2013-10-16 18:05:41 · 1176 阅读 · 0 评论 -
UVa 110 Meta-Loopless Sorts (递归&代码模拟&全排列)
110 - Meta-Loopless Sorts Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&page=show_problem&problem=46 Background Sorting holds an im原创 2013-09-25 18:13:32 · 1208 阅读 · 0 评论 -
UVa 10474 Where is the Marble? (二分查找&equal_range()的使用)
10474 - Where is the Marble? Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=108&page=show_problem&problem=1415 Raju and Meena love to pl原创 2013-10-16 14:10:06 · 1147 阅读 · 0 评论 -
UVa 10562 Undraw the Trees (二叉树先序遍历)
10562 - Undraw the Trees Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=104&page=show_problem&problem=1503 Professor Homer has been rep原创 2013-10-24 16:11:35 · 1316 阅读 · 0 评论 -
UVa 839 Not so Mobile (DFS二叉树)
839 - Not so Mobile Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=104&page=show_problem&problem=780 Before being an ubiquous communica原创 2013-10-24 19:31:40 · 1106 阅读 · 0 评论 -
UVa 639 Don't Get Rooked (DFS好题)
639 - Don't Get Rooked Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=108&page=show_problem&problem=580 In chess, the rook is a piece t原创 2013-10-25 08:51:48 · 1318 阅读 · 0 评论 -
UVa 699 The Falling Leaves (DFS遍历二叉树)
699 - The Falling Leaves Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=640 Each year, fall in the North Central regio原创 2013-10-26 22:47:34 · 1144 阅读 · 0 评论 -
UVa 140 Bandwidth (枚举全排列&剪枝搜索)
140 - Bandwidth Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=108&page=show_problem&problem=76 Given a graph (V,E) where V is a set of原创 2013-10-29 08:04:18 · 1198 阅读 · 0 评论 -
UVa 548 Tree (中序遍历&后序遍历&DFS)
548 - Tree Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=104&page=show_problem&problem=489 You are to determine the value of the leaf原创 2013-10-28 15:08:10 · 1049 阅读 · 0 评论 -
Codeforces Round #197 (Div. 2) / 339C Xenia and Weights (爆搜)
http://codeforces.com/contest/339/problem/C 爆搜水过,复杂度貌似是O(m)的? /*62ms,4KBm*/ #include int m, ans[1005]; ///ans从1开始 char s[15]; bool ok; ///O(m)复杂度? int dfs(int deep, int diff) /// diff表示重量之差 {原创 2014-03-14 16:24:46 · 1431 阅读 · 0 评论
分享