Brute Force
文章平均质量分 69
wintermelon27
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #243 (Div. 2) C. Sereja and Swaps
A. Sereja and Swaps time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output As usual, Sereja has array a, its elemen原创 2014-04-28 14:15:51 · 1012 阅读 · 0 评论 -
UVA 562 CD (DP+DFS)
CD Time Limit: 3000ms Memory Limit: 131072KB This problem will be judged on UVA. Original ID: 624 64-bit integer IO format: %lld Java class name: Main Prev Submit Status Statist原创 2014-08-29 19:59:19 · 675 阅读 · 0 评论 -
LA 3621 / POJ 3134 Power Calculus (迭代加深搜索)
题目链接:http://poj.org/problem?id=3134 题目大意:给出x和正整数n(1 解法:n比较小,迭代加深搜索,浅层内求出解,加上剪枝就OK了。 迭代加深搜索学习资料: http://www.nocow.cn/index.php/Translate:USACO/More_Search_Techniques Code: /* W原创 2015-05-29 01:15:12 · 1010 阅读 · 1 评论 -
POJ 3139 / LA 3693 Balancing the Scale (枚举,状态压缩)
传送门:http://poj.org/problem?id=3139 题目大意:给出16个不大于1024数,每个数只使用一次,求使得下列等式成立的方案数。 x1 * 4 + x2 * 3 + x3 * 2 + x4 = x5 + x6 * 2 + x7 * 3 + x8 * 4 y1 * 4 + y2 * 3 + y3 * 2 + y4 = y5 + y6 * 2 + y原创 2015-06-01 15:04:13 · 927 阅读 · 0 评论 -
HDU 1043 Eight (经典八数码问题,BFS+状态枚举+伪哈希)
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1043题目大意:经典的八数码问题,给定状态,求移回原始按顺序的序列的操作序列。思路:从状态”12345678x“开始BFS下去,逐渐扩展,遍历所有可能得到的状态,顺便记录每个状态结点的父子关系,为后面输出操作序列作准备,判重为了方便,用了一个效率不太好的STL map,搞了点伪哈希,把9!个状态映射成从1到原创 2015-06-09 15:36:26 · 915 阅读 · 0 评论