hdu4708 Rotation Lock Puzzle】的更多相关文章

Rotation Lock Puzzle Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 654 Accepted Submission(s): 190 Problem Description Alice was felling into a cave. She found a strange door with a number squar…
http://acm.hdu.edu.cn/showproblem.php?pid=4708 Rotation Lock Puzzle Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Problem Description Alice was felling into a cave. She found a strange door with a number square m…
Rotation Lock Puzzle Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1836    Accepted Submission(s): 580 Problem Description Alice was felling into a cave. She found a strange door with a numbe…
Rotation Lock Puzzle Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 290    Accepted Submission(s): 60 Problem Description Alice was felling into a cave. She found a strange door with a number s…
Rotation Lock Puzzle Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 695    Accepted Submission(s): 204 Problem Description Alice was felling into a cave. She found a strange door with a number…
Problem Description Alice was felling into a cave. She found a strange door with a number square matrix. These numbers can be rotated around the center clockwise or counterclockwise. A fairy came and told her how to solve this puzzle lock: “When the…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4708 题目大意:给定一个方形矩阵,边长为3-10的奇数.每一圈的数字可以沿着顺时针方向和逆时针方向旋转,求使得矩阵主对角线和反对角线和最大时的数以及需要旋转的最小步骤. Sample Input 5 9 3 2 5 9 7 4 7 5 4 6 9 3 9 3 5 2 8 7 2 9 9 4 1 9 0   Sample Output 72 1 分析:简单的模拟.分别计算每一圈旋转后的四个角的值最大需…
题意:给出一个n*n的矩阵,旋转每一圈数字,求出对角线可能的最大值,以及转到最大时的最小距离. 只要分析每一层就可以了,本来想用地址传递二维数组,发现行不通,改了一下就行了. 这里有个坑,比如: 1 1 9 9 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 很明显最大的就是将一个9转到矩阵角,而这里更新最大值时很容易把另一种情况屏蔽掉,从而错过了更少步骤达到最大值的方法. 代码: /* * Author: illuz <iilluzen[at]gmail.com> * Blo…
Lock Puzzle 题目大意:给你两个字符串一个s,一个t,长度<=2000,要求你进行小于等于6100次的shift操作,将s变成t, shift(x)表示将字符串的最后x个字符翻转后放到最前面. 思路:不会写,看了题解... 因为长度为3000,操作为6500,我们考虑每三次操作将一个字符放到最后,并保证其他字符的顺序不变,这样是可以实现的, 如果我们想要将第k个字符移到最后,我们只要shift(n-1-k) , shift(1) , shift(n-1),就能实现啦 . #includ…
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <vector> const int maxLength = 2005; char s[maxLength], t[maxLength]; int letterOfS[30]; int letterOfT[30]; std::vector<int> result;…