hdu 5540 Secrete Master Plan(水)

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.

hdu 5540 Secrete Master Plan(水)

 
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 ;
}
上一篇:自己封装的工具类,使用原生SwipeRefreshLayout+RecycleView实现下拉刷新和加载更多


下一篇:WIN10远程连接,报错身份验证错误,要求的函数不受支持