HDU 4801 Pocket Cube】的更多相关文章

题目链接 去年现场,虎哥1Y的,现在刷刷题,找找状态... 一共6种转法,把3个面放到顶部,左旋和右旋,感觉写的还不错....都写成常数了. #include <stdio.h> #include <math.h> #include <string.h> #include <queue> #include <algorithm> #define LL long long using namespace std; struct node { ];…
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…
1. 题目描述给定一个$2 \times 2 \times 2$的魔方,当某个面上的4个小块颜色均相同时,称这个面为complete.求对这个魔方进行$n \in [1,7]$次旋转(沿某个面顺时针或者逆时针)的过程中,求complete的面总和的最大值.魔方及索引如下图所示: 2. 基本思路及代码解法一(MLE):刚读过题,觉得挺简单的,时限10000ms还挺长的.需要搞清楚沿着某个面旋转后矩阵的元素是如何变化的.就想到可以进行状态压缩$6^24 < 2^63$,因此将cube表示的矩阵可以使…
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.…
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…
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…
题意:给了一个2*2的魔方..每步操作可以将任意一面翻转90度..现在问在N(<=7)步内.最多能翻出几面相同的. 直接打表模拟每种翻转情况 #include<cstdio> #include<cstring> #include<algorithm> #include<iostream> using namespace std; ][]= { {,,,,,,,,,,,,,,,,,,,,,,,}, //ok {,,,,,,,,,,,,,,,,,,,,,,…
http://acm.hdu.edu.cn/showproblem.php?pid=1220 一开始的做法是,先暴力算出一个面,就是n * n的面,能有多少对.记作face 然后从上开始算下来,最上一层,face个,然后第二层,有n * n * (up - 1)个. 递推下去,up是在第i层上面有多少个. #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #inc…
DIY Cube Time Limit: 2000/2000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 584    Accepted Submission(s): 284 Problem Description Mr. D is interesting in combinatorial enumeration. Now he want to find out the nu…
题目传送门 题意:魔方最多旋转n次,问最多能使多少面颜色相同 分析:6种状态(3种旋转方式*顺逆方向,其他对称的!),首先先打个表,然后很愉快的DFS.自己写的时候费劲脑汁,代码很长,还TLE了.... /************************************************ * Author :Running_Time * Created Time :2015/10/24 星期六 14:18:27 * File Name :K.cpp ****************…