hdu 5540 Secrete Master Plan(水)
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.

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.
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).
Case #: POSSIBLE
Case #: POSSIBLE
Case #: IMPOSSIBLE
Case #: POSSIBLE
#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(水)的更多相关文章
- 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 ...
- 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 A - Secrete Master Plan A.
D. Duff in Beach Description Master Mind KongMing gave Fei Zhang a secrete master plan stashed in a ...
- HDOJ5540 Secrete Master Plan
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5540 题目大意:给一个两个2*2的矩阵,第二个矩阵能不能通过旋转得到第一个矩阵 题目思路:模拟 #in ...
- ACM学习历程—UESTC 1215 Secrete Master Plan(矩阵旋转)(2015CCPC A)
题目链接:http://acm.uestc.edu.cn/#/problem/show/1215 题目大意就是问一个2*2的矩阵能否通过旋转得到另一个. 代码: #include <iostre ...
- HDU 5578 Friendship of Frog 水题
Friendship of Frog Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.ph ...
- HDU 5590 ZYB's Biology 水题
ZYB's Biology Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid ...
随机推荐
- Eclipse图标含义
学习了这么久,之前也没注意,这次在csdn找个了文章,记录一下: Eclipse的Package Explorer中用图标表示了很多内容,刚刚开始接触Eclipse时对这些图标表示的内容并不清楚,而且 ...
- 【Mysql5.7数据目录和配置文件目录】
Win7下 C:\ProgramData\MySQL\MySQL Server 5.7\ 如何查看mysql运行.访问记录等日志 1.首先确认你日志是否启用了mysql>show variabl ...
- 10453 Make Palindrome (dp)
Problem A Make Palindrome Input: standard input Output: standard output Time Limit: 8 seconds By def ...
- Unix/Linux环境C编程入门教程(26) 字符数字那些事儿
1.gcvt() strtod() strtol() strtoul() toascii() tolower() toupper函数介绍 gcvt(将浮点型数转换为字符串,取四舍五入) 相关函数 ec ...
- VC实现图片拖拽及动画
基础知识 1.PictureBox控件的使用 2.加载位图文件 1.通过文件路径获得位图句柄 //获得位图句柄 void CMovePictureDlg::GetHandleFromPath(CSt ...
- 在Eclipse中创建打开文件夹快捷键
Run 展开如下菜单: Run ---- External Tools ---- External Tools Configurations 在 program 下面新建一个工具 在 Location ...
- Hadoop 5、HDFS HA 和 YARN
Hadoop 2.0 产生的背景Hadoop 1.0 中HDFS和MapReduce存在高可用和扩展方面的问题 HDFS存在的问题 NameNode单点故障,难以用于在线场景 NameNode压力过大 ...
- 写一个产生16位纯数字唯一 ID 的方法,要求时间因素的介入。(不要求绝对唯一,在一定的时空中重复机率很小即可)
function randomID () { _random = function(min, max) { if (max == null) { max = min; min = 0; } retur ...
- Centos 6.8下安装LBP2900打印机驱动
今天第一次在Linux下面安装LBP2900的驱动程序,在安装的过程中出现了不少的问题,不过问题最终还是解决了. 1.下载LBP2900的Linux驱动程序: Linux_LBP2900_CAPT_P ...
- SqlServer2008(R2) 数据库使用外网IP实例连接服务器
1.打开sql2008,使用windows身份登录 2.登录后,右键选择"属性".左侧选择"安全性",选中右侧的"SQL Server 和 Windo ...