LA 6621 /ZOJ 3736 Pocket Cube 打表+暴力】的更多相关文章

这道题是长沙区域赛的一道简单题,当时题目在ZOJ重现的时候就做了一次,但是做的好复杂,用的BFS暴力,而且还没打表,最后还是莫名其妙的爆栈错误,所以就一直没弄出来,昨天做到大白书上例题05年东京区域赛的一道类似题 Colored Cubes,这类题都需要脑补一下立方体的旋转总共有几种状态,然后用函数或者手工打表来记叙每一次变化之后的立方体变化 这道题从编号开始就给了我们很大便利,从0-23,读入数据也是按照这个来,很方便.我是手工打的表,说实话,魔方的转动还是有点复杂,我还真不知道用函数怎么打出…
题目传送门 题意:魔方最多旋转n次,问最多能使多少面颜色相同 分析:6种状态(3种旋转方式*顺逆方向,其他对称的!),首先先打个表,然后很愉快的DFS.自己写的时候费劲脑汁,代码很长,还TLE了.... /************************************************ * Author :Running_Time * Created Time :2015/10/24 星期六 14:18:27 * File Name :K.cpp ****************…
K - Pocket Cube Time Limit:10000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 4801 Description Pocket Cube is a 3-D combination puzzle. It is a 2 × 2 × 2 cube, which means it is constructed by 8 mini-cubes.…
ZOJ 2477 Magic Cube(魔方) Time Limit: 2 Seconds      Memory Limit: 65536 KB This is a very popular game for children. In this game, there's a cube, which consists of 3 * 3 * 3 small cubes. We can unwrap the cube, it will become like this: 这是个有名的儿童游戏.游戏…
Pocket Cube http://acm.hdu.edu.cn/showproblem.php?pid=5983 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2852    Accepted Submission(s): 1066 Problem Description The Pocket Cube, also known as…
Pocket Cube 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5292 Description Pocket Cube is the 2×2×2 equivalent of a Rubik's Cube(3×3×3). The cube consists of 8 pieces, all corners. (from wiki) It was a Pocket Cube. Unfortunately, the Cube fell to t…
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 47 Accepted Submission(s): 12 Problem Description The Pocket Cube, also known as the Mini Cube or the Ice Cube, is the 2 × 2 × 2 equivalence of a Ru…
1. 题目描述给定一个$2 \times 2 \times 2$的魔方,当某个面上的4个小块颜色均相同时,称这个面为complete.求对这个魔方进行$n \in [1,7]$次旋转(沿某个面顺时针或者逆时针)的过程中,求complete的面总和的最大值.魔方及索引如下图所示: 2. 基本思路及代码解法一(MLE):刚读过题,觉得挺简单的,时限10000ms还挺长的.需要搞清楚沿着某个面旋转后矩阵的元素是如何变化的.就想到可以进行状态压缩$6^24 < 2^63$,因此将cube表示的矩阵可以使…
A - Magic Number Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Status Practice ZOJ 3622 Appoint description:   Description A positive number y is called magic number if for every positive integer x it satisfies tha…
ZOJ:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=312 POJ:http://poj.org/problem?id=1595 题目大意: 给你两个数n和c,如果1~n(包括1和n)之间的素数个数为偶数个,则输出中间c*2个素数否则输出中间c*2-1个素数. 思路: 呀呀呀,玩了一天了,A道水题洗洗睡吧. 直接筛选素数打表. 注意c比1~n的个数大的情况要把1~n中所以素数输出. OK,然后这题1也算素数.. #incl…