A
来源:互联网 发布:虚拟机安装mac os 编辑:程序博客网 时间:2024/05/16 19:29
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 2×2 2×2 matrix, but Fei didn't know the correct 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.
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.
(starting from 1) and
41 23 41 23 41 23 43 14 21 23 43 24 11 23 44 32 1
Case #1: POSSIBLECase #2: POSSIBLECase #3: IMPOSSIBLECase #4: POSSIBLE
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5540
水题,问你第一个矩阵能不能旋转成第二个矩阵,矩阵保证2*2
代码:
#include <iostream>#include <cstdio>using namespace std;int a[4],b[4];bool check(){if(a[0]==b[0]&&a[1]==b[1]&&a[2]==b[2]&&a[3]==b[3])return 1;if(a[0]==b[2]&&a[1]==b[0]&&a[2]==b[3]&&a[3]==b[1])return 1;if(a[0]==b[3]&&a[1]==b[2]&&a[2]==b[1]&&a[3]==b[0])return 1;if(a[0]==b[1]&&a[1]==b[3]&&a[2]==b[0]&&a[3]==b[2])return 1;return 0;}int main(){ int t; scanf("%d",&t); for(int i=1;i<=t;++i) {for(int j=0;j<4;++j)scanf("%d",&a[j]);for(int j=0;j<4;++j)scanf("%d",&b[j]);printf("Case #%d: ",i);if(check())puts("POSSIBLE");else puts("IMPOSSIBLE"); } return 0;}
0 0
- a
- a
- a
- a
- a
- a
- a
- a
- a
- a
- a
- a
- a
- A
- A*
- a
- A
- a
- 正则在FME中的应用
- hdu 1370 Biorhythms(中国剩余定理)
- 分数四则运算
- mybatis思维导图
- 浅谈JavaScript表单
- A
- bzoj 3027: [Ceoi2004]Sweet (生成函数)
- 如何用两个栈模拟队列操作
- 责任链模式 详解
- AlexNet-ImageNet Classification with Deep Convolutional Neural Networks
- Linux Makefile中赋值运算符=,:=,?=和+= 之间的区别
- google signing
- 答答租车系统(面向对象综合练习)
- 穷举法-有趣的数字(腾讯2017实习生编程题)