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 ...
随机推荐
- android layout的布局
1.android:layout_width.android:layout_heigth 表示控件的大小,长宽 2.andoid:layout_gravity .android:gravity表示控件 ...
- SDK Manager 报错:Connection timed out: connect
安装Eclipse的安卓开发环境的时候,安装sdk时报错,出现: 解决办法: 1.选择左上角的Tools 2.选择Options,勾选下面红色框的东西 3. 4.重新重启一下sdk manager即可
- linux之SQL语句简明教程---函数
既然数据库中有许多资料都是已数字的型态存在,一个很重要的用途就是要能够对这些数字做一些运算,例如将它们总合起来,或是找出它们的平均值.SQL 有提供一些这一类的函数.它们是: AVG (平均) COU ...
- poj 1852 Ants_贪心
题目大意:很多的蚂蚁都在长度为L(cm)的膀子上爬行,它们的速度都是1cm/s,到了棒子终端的时候,蚂蚁就会掉下去.如果在爬行途中遇到其他蚂蚁,两只蚂蚁的方向都会逆转.已知蚂蚁在棒子的最初位置坐标,但 ...
- Hadoop 7、MapReduce执行环境配置
MR执行环境有两种:本地测试环境,服务器环境 本地测试环境(windows,用于测试) 1.下载Winddows版的Hadoop程序,解压后在Hadoop目录的bin目录放置一个winutils.ex ...
- Hadoop 5、HDFS HA 和 YARN
Hadoop 2.0 产生的背景Hadoop 1.0 中HDFS和MapReduce存在高可用和扩展方面的问题 HDFS存在的问题 NameNode单点故障,难以用于在线场景 NameNode压力过大 ...
- 网易云课堂_C++程序设计入门(上)_第1单元:C++概览_第1单元作业 - 写代码 - 互评 (难度:易)
第1单元作业 - 写代码 - 互评 (难度:易) 查看帮助 返回 提交作业(截止时间已过) 完成并提交作业 作业批改 互评训练 互评作业 自评作业 成绩公布 查看成绩 温 ...
- C#调用HTTP接口
string url = "http://www.***.com?id=123&username=test&userpwd=*****"; WebRequest w ...
- Yii2权威指南中文版及众包翻译平台
Yii2在今年4月份公布了beta版本号,预计下半年会推出正式版本号(可用于生产环境). Yii2使用了新的PHP语法特性(PHP5.4+)并集成了大量新的编程最佳实践, 如命名空间.响应式界面组件库 ...
- Windows下搭建Eclipse+Android4.0开发环境
官方搭建步骤: http://developer.android.com/index.html 搭建好开发环境之前须要下载以下几个文件包: 一.安装Java执行环境JRE(没这个Eclipse执行不起 ...