Description
Imagine you are standing inside a two-dimensional maze composed of square cells which may or may not be filled with rock. You can move north, south, east or west one cell at a step. T...
分类:
其他好文 时间:
2014-07-08 21:04:29
阅读次数:
347
旋转可以分为n种置换,对应的不同等价类分别是gcd(n,i)个i=0时不动,有n个
翻转分为奇偶讨论,奇数时有n种置换,每种有n/2+1个
偶数时有n种置换,一半是n/2+1个,一半是n/2个
#include
#include
#include
#include
#include
#include
using namespace std;
typedef long long ll;...
分类:
其他好文 时间:
2014-07-08 19:05:15
阅读次数:
163
最小生成树+BFS
题意是说在迷宫之中找出连接所有点的最小生成树,其他杂项完全不理会,我理解题意就花了好久。
我用的Kruskal,输入的时候给每个点标号,然后BFS 每个点,找出最近的所有边,接下来就是模版的Kruskal。
因为是迷宫,所以只能用BFS去搜与它相通的每个点的最短路。
不过数据有点坑,建议数组开大一点,我提交的时候RE一次,绝对不止100个...
分类:
其他好文 时间:
2014-07-08 18:34:52
阅读次数:
240
Description
During winter, the most hungry and severe time, Holedox sleeps in its lair. When spring comes, Holedox wakes up, moves to the exit of its lair, comes out, and begins its new life.
Hol...
分类:
其他好文 时间:
2014-07-08 17:28:54
阅读次数:
256
Description
During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Generally speaking, villages connected by tunnels lay in a...
分类:
其他好文 时间:
2014-07-08 16:51:42
阅读次数:
506
Description
Let’s play a puzzle using eight cubes placed on a 3 × 3 board leaving one empty square.
Faces of cubes are painted with three colors. As a puzzle step, you can roll one of the cubes ...
分类:
其他好文 时间:
2014-07-08 16:27:42
阅读次数:
220
Radar Installation
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 50740
Accepted: 11394
Description
Assume the coasting is an infinite straight line. Land...
分类:
其他好文 时间:
2014-07-08 15:17:58
阅读次数:
186
The Pilots Brothers' refrigerator
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 18040
Accepted: 6841
Special Judge
Description
The game “The Pilots...
分类:
其他好文 时间:
2014-07-08 12:54:14
阅读次数:
131
题目要求任选几个自然数,使得他们的和是n的倍数。
由鸽巢原理如果我们只选连续的数,一定能得到解。
首先预处理前缀和模n下的sum,如果发现sum[i]==sum[j] 那么(sum[j]-sum[i])%n一定为0,直接输出i+1~j就够了。
为什么一定会有解,因为sum从1~n有n个数,而模n下的数只有0~n-1,把n个数放入0~n-1个数里,怎么也会有重复,所以这种构造方法一定没问题。
...
分类:
其他好文 时间:
2014-07-08 10:47:19
阅读次数:
260
DP 一直是心中痛,不多说了,这个暑假就坑在这上了。
这暑假第一道DP题,01背包问题。
题意是说物品有 重量和价值 ,但你能承受的重量有限,问你能带的最大价值。
这题数组开大点,虽然不知道有啥坑点,但是我数组开得大,直接1A了。
#include
#include
#include
#include
#include
#include
#include
#incl...
分类:
其他好文 时间:
2014-07-08 10:33:09
阅读次数:
229