2015南阳CCPC A - Secrete Master Plan A.
D. Duff in Beach
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 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.
Input
Output
Case #x: y
, where x is the test case number (starting from 1) and y is either "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
题意
给你两个2*2的矩阵,判断一个旋转是否能得到另外一个
题解:
模拟不多说
///
#include<bits/stdc++.h>
using namespace std ;
typedef long long ll;
#define mem(a) memset(a,0,sizeof(a))
#define meminf(a) memset(a,127,sizeof(a))
#define TS printf("111111\n")
#define FOR(i,a,b) for( int i=a;i<=b;i++)
#define FORJ(i,a,b) for(int i=a;i>=b;i--)
#define READ(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define inf 100000
inline ll read()
{
ll x=,f=;
char ch=getchar();
while(ch<''||ch>'')
{
if(ch=='-')f=-;
ch=getchar();
}
while(ch>=''&&ch<='')
{
x=x*+ch-'';
ch=getchar();
}
return x*f;
}
//**************************************** int main()
{
int oo=;
int a[],b[];
int T=read();
while(T--){
for(int i=;i<=;i++){ scanf("%d",&b[i]); }
for(int i=;i<=;i++){ scanf("%d",&a[i]); }
bool flag=;
if(b[]==a[]&&b[]==a[]&&b[]==a[]&&b[]==a[]){
flag=;
}
if(a[]==b[]&&a[]==b[]&&a[]==b[]&&a[]==b[]){
flag=;
}
if(a[]==b[]&&a[]==b[]&&a[]==b[]&&a[]==b[]){flag=;}
if(a[]==b[]&&a[]==b[]&&a[]==b[]&&a[]==b[]){flag=;}
printf("Case #%d: ",oo++);
if(flag){
cout<<"POSSIBLE"<<endl;
}
else {
cout<<"IMPOSSIBLE"<<endl;
}
}
return ;
}
代码
2015南阳CCPC A - Secrete Master Plan A.的更多相关文章
- 2015南阳CCPC A - Secrete Master Plan 水题
D. Duff in Beach Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 无 Description Master Mind KongMing gave ...
- The 2015 China Collegiate Programming Contest A. Secrete Master Plan hdu5540
Secrete Master Plan Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Othe ...
- hdu 5540 Secrete Master Plan(水)
Problem Description Master Mind KongMing gave Fei Zhang a secrete master plan stashed × matrix, but ...
- ACM Secrete Master Plan
Problem Description Master Mind KongMing gave Fei Zhang a secrete master plan stashed in a pocket. T ...
- HDU-5540 Secrete Master Plan
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission( ...
- 2015南阳CCPC E - Ba Gua Zhen 高斯消元 xor最大
Ba Gua Zhen Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 无 Description During the Three-Kingdom perio ...
- 2015南阳CCPC F - The Battle of Guandu 多源多汇最短路
The Battle of Guandu Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 无 Description In the year of 200, t ...
- 2015南阳CCPC L - Huatuo's Medicine 水题
L - Huatuo's Medicine Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 无 Description Huatuo was a famous ...
- 2015南阳CCPC H - Sudoku 暴力
H - Sudoku Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 无 Description Yi Sima was one of the best cou ...
随机推荐
- vt100控制符
vt100控制符是比较古老的字符,基本上的终端都能支持 今天突然来了兴致玩一玩儿 颜色配置 下面是我写的各种背景和字体颜色的搭配演示,挑选一种你喜欢的 echo -en "[背景\字体] & ...
- Python的伪造数据库:Faker
faker 是一个可以让你生成伪造数据的Python包,在软件需求.开发.测试过程中常常需要利用一些假数据来做测试,这种时候就可以使用 Faker 来伪造数据从而用来测试. 一.Faker安装 pip ...
- day02python
''' 列表 定义:在[]内,可以存放多个任意类型的值,并以逗号隔开. 一般用于存放学生的爱好,课堂的周期等等... ''' students=['钱垚','李小龙','张全蛋','赵铁柱'] pri ...
- datetimebox赋值或取值
datetimebox赋值或取值 $('#j_dateStart').datebox('setValue', ""); //赋予空值 $("#j_dateStart&qu ...
- qemu vm setup network(ssh) with buildroot
1, build buildroot with buildroot.config, that is 'make qemu_x86_64_defconfig' + some packages, sshd ...
- RQNOJ #204 特种部队 sol
link 首先我们可以注意到一个非常无聊的性质.先一直向右边走,然后折返回来向左边走,本质上与先向右走,然后向左走,再向右走这样循环走完整个路程是一致的. 根据这个性质,我们可以将向左走与向右走两个东 ...
- 在Java中调用带参数的存储过程
JDBC调用存储过程: CallableStatement 在Java里面调用存储过程,写法那是相当的固定: Class.forName(.... Connection conn = DriverMa ...
- 【jenkins】UnicodeEncodeError: 'ascii' codec can't encode character
https://stackoverflow.com/questions/6076203/how-do-you-set-the-default-encoding-in-jenkins
- SQL Server数据库基础编程
转载,查看原文 Ø Go批处理语句 用于同时执行多个语句 Ø 使用.切换数据库 use master go Ø 创建.删除数据库 方法1. --判断是否存在该数据库,存在就删除 if (exist ...
- react入门----组件的基础用法
1.组件 <!-- React 允许将代码封装成组件(component),然后像插入普通 HTML 标签一样,在网页中插入这个组件.React.createClass 方法就用于生成一个组件类 ...