Problem 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 × 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
The first line of the input gives the number of test cases, T(≤T≤). T test cases follow. Each test case contains  lines. Each line contains two integers ai0 and ai1 (≤ai0,ai1≤). The first two lines stands for the original plan, the 3rd and 4th line stands for the plan Fei opened.
 
Output
For each test case, output one line containing "Case #x: y", where x is the test case number
(starting from ) and y is either "POSSIBLE" or "IMPOSSIBLE" (quotes for clarity).
 
Sample Input

 
Sample Output
Case #: POSSIBLE
Case #: POSSIBLE
Case #: IMPOSSIBLE
Case #: POSSIBLE
 
Source
 #pragma comment(linker, "/STACK:1024000000,1024000000")
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<math.h>
#include<algorithm>
#include<queue>
#include<set>
#include<bitset>
#include<map>
#include<vector>
#include<stdlib.h>
#include <stack>
using namespace std;
#define PI acos(-1.0)
#define max(a,b) (a) > (b) ? (a) : (b)
#define min(a,b) (a) < (b) ? (a) : (b)
#define ll long long
#define eps 1e-10
#define MOD 1000000007
#define N 1000000
#define inf 1e12
int x[],y[];
int main()
{
int t;
int ac=;
scanf("%d",&t);
while(t--){
for(int i=;i<=;i++){
scanf("%d%d",&x[i],&y[i]);
}
int ans=x[]*+y[]*+y[]*+x[]; printf("Case #%d: ",++ac);
if(x[]*+y[]*+y[]*+x[]==ans){
printf("POSSIBLE\n");
continue;
}
if(y[]*+y[]*+x[]*+x[]==ans){
printf("POSSIBLE\n");
continue;
}
if(y[]*+x[]*+x[]*+y[]==ans){
printf("POSSIBLE\n");
continue;
}
if(x[]*+x[]*+y[]*+y[]==ans){
printf("POSSIBLE\n");
continue;
}
printf("IMPOSSIBLE\n"); }
return ;
}

hdu 5540 Secrete Master Plan(水)的更多相关文章

  1. 2015南阳CCPC A - Secrete Master Plan 水题

    D. Duff in Beach Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 无 Description Master Mind KongMing gave ...

  2. 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 ...

  3. ACM Secrete Master Plan

    Problem Description Master Mind KongMing gave Fei Zhang a secrete master plan stashed in a pocket. T ...

  4. HDU-5540 Secrete Master Plan

    Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission( ...

  5. 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 ...

  6. HDOJ5540 Secrete Master Plan

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5540 题目大意:给一个两个2*2的矩阵,第二个矩阵能不能通过旋转得到第一个矩阵 题目思路:模拟 #in ...

  7. ACM学习历程—UESTC 1215 Secrete Master Plan(矩阵旋转)(2015CCPC A)

    题目链接:http://acm.uestc.edu.cn/#/problem/show/1215 题目大意就是问一个2*2的矩阵能否通过旋转得到另一个. 代码: #include <iostre ...

  8. HDU 5578 Friendship of Frog 水题

    Friendship of Frog Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.ph ...

  9. HDU 5590 ZYB's Biology 水题

    ZYB's Biology Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid ...

随机推荐

  1. Eclipse Plugin Dev Materials

    以下资料是本人在开发Eclipse 插件时候收集的一些比较有用的资料Link,和大家分享下. 比较权威的资料: Helpful Eclipse Plugin Websites: Eclipse Art ...

  2. Unix/Linux环境C编程入门教程(26) 字符数字那些事儿

    1.gcvt() strtod() strtol() strtoul() toascii() tolower() toupper函数介绍 gcvt(将浮点型数转换为字符串,取四舍五入) 相关函数 ec ...

  3. index seek与index scan

    原文地址:http://blog.csdn.net/pumaadamsjack/article/details/6597357 低效Index Scan(索引扫描):就全扫描索引(包括根页,中间页和叶 ...

  4. A Knight's Journey 分类: dfs 2015-05-03 14:51 23人阅读 评论(0) 收藏

    A Knight’s Journey Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 34085 Accepted: 11621 ...

  5. 解决Mac OS Adobe Flash Builder 4.7 java heap space 问题【转】

    1. 在Finder中打开Adobe Flash Builder 4.7的安装目录 2. 在Adobe Flash Builder 4.7.app上点击右键“Show Package contents ...

  6. Swift版音乐播放器(简化版),swift音乐播放器

    这几天闲着也是闲着,学习一下Swift的,于是到开源社区Download了个OC版的音乐播放器,练练手,在这里发扬开源精神, 希望对大家有帮助! 这个DEMO里,使用到了 AudioPlayer(对音 ...

  7. 关于jQuery中.attr()和.prop()

    功能需求是这样的,两个radio:男和女,一个button:重置.启动页面默认选中男,在用户选择女之后又点击重置按钮,需要恢复到默认状态. <input type="radio&quo ...

  8. web api (.NET 4.5)

    摘自http://blog.csdn.net/fangxing80/article/details/7318289 在刚刚发布的 ASP.NET MVC 4 中,有一个值得注意的新特性——Web Ap ...

  9. 代码生成引擎之T4模版

    在学校三年.公司里呆了快一年了,作用ASP.NET开发的我,居然从来没听过T4模版,公司里也没有人使用,它就是这样不为世人所熟知,却又默默的奉献着!这...........tm还是我吗?什么时候会说这 ...

  10. C#VS面向对象基础(二)

    这里我们接着上一篇博客,继续学习用C#实现面向对象中的概念.这里学习下边几个,当然我们还是通过动物比赛的例子. 多态:表示不同的对象可以执行相同的动作,但是通过它们自己的实现代码来执行.这里需要将父类 ...