A - Secrete Master Plan【ccpc】
来源:互联网 发布:开源视频网站 php 编辑:程序博客网 时间:2024/05/19 19:58
Description
Master Mind KongMing gave Fei Zhang a secrete master plan stashed in a pocket. The plan instructs how to deploy soldiers on the four corners of the city wall. Unfortunately,
when Fei opened the pocket he found there are only four numbers written in dots on a piece of sheet. The numbers form a
direction to hold the sheet. What a pity!
Given two secrete master plans. The first one is the master's original plan. The second one is the plan opened by Fei. As KongMing had many pockets to hand out, he might give
Fei the wrong pocket. Determine if Fei receives the right pocket.
Input
The first line of the input gives the number of test cases,
Output
For each test case, output one line containing Case #x: y
, where POSSIBLE
” or “IMPOSSIBLE
”
(quotes for clarity).
Sample Input
4
1 2
3 4
1 2
3 4
1 2
3 4
3 1
4 2
1 2
3 4
3 2
4 1
1 2
3 4
4 3
2 1
Sample Output
Case #1: POSSIBLE
Case #2: POSSIBLE
Case #3: IMPOSSIBLE
Case #4: POSSIBLE
判断一个矩阵旋转后能否与另一个矩阵重合
#include<cstdio>#include<cstdlib>#include<cstring>#include<algorithm>int map1[5][5];int map2[5][5];using namespace std;int main(){int t,i,j,k=1;scanf("%d",&t);while(t--){scanf("%d%d%d%d%d%d%d%d",&map1[1][1],&map1[1][2],&map1[2][1],&map1[2][2],&map2[1][1],&map2[1][2],&map2[2][1],&map2[2][2]);int flag=0;if(map1[1][1]==map2[1][1]&&map1[1][2]==map2[1][2]&&map1[2][1]==map2[2][1]&&map1[2][2]==map2[2][2])flag=1;else if(map1[1][1]==map2[1][2]&&map1[1][2]==map2[2][2]&&map1[2][1]==map2[1][1]&&map1[2][2]==map2[2][1])flag=1;else if(map1[1][1]==map2[2][2]&&map1[1][2]==map2[2][1]&&map1[2][1]==map2[1][2]&&map1[2][2]==map2[1][1])flag=1;else if(map1[1][1]==map2[2][1]&&map1[1][2]==map2[1][1]&&map1[2][1]==map2[2][2]&&map1[2][2]==map2[1][2])flag=1;if(flag==1){printf("Case #%d: POSSIBLE\n",k++);}else{printf("Case #%d: IMPOSSIBLE\n",k++);}}return 0;}
- A - Secrete Master Plan【ccpc】
- 2015南阳CCPC A - Secrete Master Plan
- 2015 CCPC Secrete Master Plan
- ccpc Secrete Master Plan(水模拟)
- 【HDU5540 2015 CCPC 南阳国赛A】【水题】Secrete Master Plan 矩形旋转
- HDU5540 Secrete Master Plan(水题)(2015CCPC)
- Secrete Master Plan HDU
- HDU5540-Secrete Master Plan
- The 2015 China Collegiate Programming Contest A - Secrete Master Plan
- UESTC 1215 Secrete Master Plan
- HDU 5540 Secrete Master Plan
- hdu 5540/Secrete Master Plan
- Secrete Master Plan (模拟)
- HDU5540 Secrete Master Plan(模拟)
- HDU 5540 Secrete Master Plan
- CDOJ 1215--Secrete Master Plan【水题】
- 杭电5540 Secrete Master Plan
- hdu5540 Secrete Master Plan--矩阵旋转
- listview嵌套gridview,并实现grid元素部分显示以及点击展开与折叠
- Emergence
- 构造方法
- Oracle实战——表的创建与约束
- 发斯蒂芬撒的撒的撒的发
- A - Secrete Master Plan【ccpc】
- 深入解读缓存(三)——Memcache缓存
- BestCoder Round #61 (div.2) 1002
- HDU 5523 Game(就是情况比较多,讨论全了就可以了)——BestCoder Round #61(div.1 div.2)
- linux常用基本命令
- Spring notes 1
- 继续让脑细胞嗨起来
- LightOJ - 1122 Digit Count(DP)
- UDK BaseTools