点击打开链接 题目大意是有一个分割机,可以把一串数字分割成若干个数字之后求和,题目输入一个数字上界和待分割的数字,让我们求出分割后数字之和在不超过给定max的情况下的最大值,并且给出分割方案,如果没有分割方案,则输出error,如果有多种方案则输出rejected. 这是个搜索题,深搜就可以求解,但是有一些剪枝的方案,题目讨论区说貌似不剪枝也能过,没试过,我一开始就写了有剪枝的,下面说一下一些剪枝方案: 假设题目输入格式为max number 1,如果number各个位相加以后仍然大于max,则…
Shredding Company Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 6173   Accepted: 3361 Description You have just been put in charge of developing a new shredder for the Shredding Company Although a "normal" shredder would just shre…
题意:给定一幅图,图上有两种点T,P.......一只跳鼠在一个T点作为起始点,它想通过图上的路到达某个P点,P点满足如下要求: (1).到达P点的途中路径权值为k的倍数 (2).尽量让路径权值取最小 (3).权值相同时,P点取更小的 此题一波三折,一开始反向建图,以为记忆化搜索能过.....TLE了,以为是枚举了是P的点浪费了时间:然后正向建图,从起点开始,也是TLE了,然后发现此题记忆化搜索影响不大,于是剪枝 v < vis[e][v % k] 的值才能继续搜索........剪枝完秒过,看…
DFS. /* 1539 */ #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <vector> using namespace std; #define INF 0xfffffff ]; ]; int ans; int t, len; bool flag; vector<int> tb; void dfs(int…
题目大意:给你一个8*8的棋盘,上面有四个棋子,给你一个初始排布,一个目标排布,每次移动,可以把一个棋子移动到一个相邻的空位,或者跨过1个相邻的棋子,在保证棋子移动不超过8次的情况下,问能否把棋盘上的棋子由初始排布变成目标排布 8*8的棋盘,刚好不爆ull,状压那些位置有棋子 然后从初始状态开始,暴搜出当前状态下,移动一个棋子之后所有可能到达的状态 直接搜,总状态数是8^8,此外还有常数,会爆 由于给定了目标排布,考虑meet in middle 从起始状态和目标状态各搜4步即可 为了防止爆栈,…
POJ 1416 Shredding Company Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 5231   Accepted: 2964 Description You have just been put in charge of developing a new shredder for the Shredding Company Although a "normal" shredder would…
题目传送门:http://poj.org/problem?id=1416 Shredding Company Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 6860   Accepted: 3710 Description You have just been put in charge of developing a new shredder for the Shredding Company Although a "…
Shredding Company Time Limit: 5000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 445    Accepted Submission(s): 124 Problem Description You have just been put in charge of developing a new shredder for the Sh…
Shredding Company Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 4713   Accepted: 2714 Description You have just been put in charge of developing a new shredder for the Shredding Company Although a "normal" shredder would just shre…
Shredding Company Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 5379   Accepted: 3023 Description You have just been put in charge of developing a new shredder for the Shredding Company Although a "normal" shredder would just shre…