CCPC A(模拟)
Secrete Master Plan
Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)
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
The first line of the input gives the number of test cases, T(1≤T≤104). T test cases follow. Each test case contains 4 lines. Each line contains two integers ai0 and ai1 (1≤ai0,ai1≤100). 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 1) and y is either "POSSIBLE
" or "IMPOSSIBLE
" (quotes for clarity).
Sample input and output
Sample Input | Sample Output |
---|---|
4 |
Case #1: POSSIBLE |
题解:要善于把复杂问题简单化,而不是复杂化,自己用数组模拟了半天,好神经;
代码:
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
const int INF=0x3f3f3f3f;
int main(){
int a,b,c,d,x,y,z,w;
int T,cnt=;
scanf("%d",&T);
while(T--){
scanf("%d%d%d%d",&b,&a,&c,&d);
scanf("%d%d%d%d",&y,&x,&z,&w);
bool t1=(a==x&&b==y&&c==z&&d==w);
bool t2=(a==y&&b==z&&c==w&&d==x);
bool t3=(a==z&&b==w&&c==x&&d==y);
bool t4=(a==w&&b==x&&c==y&&d==z);
int flot=;
if(t1||t2||t3||t4)flot=;
printf("Case #%d: ",++cnt);
if(flot)puts("POSSIBLE");
else puts("IMPOSSIBLE");
}
return ;
}
CCPC A(模拟)的更多相关文章
- 【HDOJ6666】Quailty and CCPC(模拟)
题意:给出罚时现场赛的题数和罚时,问是否有在金牌线下取整被卡出,四舍五入卡入的队伍 n<=1e5 思路: #include<bits/stdc++.h> using namespac ...
- 2017CCPC秦皇岛 E题String of CCPC&&ZOJ3985【模拟】
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3985 题意: 给定一个字符串,由c和p组成,可以添加c或者p. 串中出现一 ...
- ccpc网赛 hdu6705 path(队列模拟 贪心
http://acm.hdu.edu.cn/showproblem.php?pid=6705 这是比赛前8题过的人数第二少的题,于是就来补了,但感觉并不难啊..(怕不是签到难度 题意:给个图,给几条路 ...
- 2016 CCPC 东北地区重现赛
1. 2016 CCPC 东北地区重现赛 2.总结:弱渣,只做出01.03.05水题 08 HDU5929 Basic Data Structure 模拟,双端队列 1.题意:模拟一个栈的操 ...
- HDU 5965 枚举模拟 + dp(?)
ccpc合肥站的重现...一看就觉得是dp 然后强行搞出来一个转移方程 即 根据第i-1列的需求和i-1 i-2列的枚举摆放 可以得出i列摆放的种类..加了n多if语句...最后感觉怎么都能过了..然 ...
- ccpc杭州站 赛后总结
Ccpc杭州站赛后总结 2017年11月4号五号,我参加了ccpc杭州站的比赛,我的队友是聂少飞和王艳,在4号一点半,举行了比赛开幕式,听着教练代表的发言,听着参赛选手代表的发言,听着志愿者的发言,都 ...
- 2017 CCPC 杭州 流水账
day0: 队内训练ccpc 秦皇岛,敝校自己出的题,感觉一个星期没怎么写代码,手生得很,不出意料被打飞了. day1 (热身赛): 热身赛还算顺利,A题看有的队几分钟就草过去了,还以为又是西安ICP ...
- CodeForces 731B Coupons and Discounts (水题模拟)
题意:有n个队参加CCPC,然后有两种优惠方式,一种是一天买再次,一种是买两天,现在让你判断能不能找到一种方式,使得优惠不剩余. 析:直接模拟,如果本次是奇数,那么就得用第二种,作一个标记,再去计算下 ...
- 模拟赛小结:2014-2015 ACM-ICPC, NEERC, Southern Subregional Contest
2014-2015 ACM-ICPC, NEERC, Southern Subregional Contest 2019年10月11日 15:30-20:30(Solved 6,Penalty 740 ...
随机推荐
- 基于maven进行spring 和mybatis的整合(Myeclpise)
学习日记:基于maven进行spring和mybatis的整合,进行分页查询 什么是maven:maven是一个项目管理工具,使用maven可以自动管理java项目的整个生命周期,包括编译.构建.测试 ...
- 关于scala和java 在maven项目中混编的问题
1.需要添加scala 相关maven配置: <properties> <scala.version>2.10.1</scala.version> <slf4 ...
- Responsive Design响应式网站设计心得笔记
这个词已经喊了很久了,一直都是小打小闹,没正经的做过大的响应式全站,这次终于有机会了.网站刚上线半个月,就要改版为响应式设计,支持手机/PC等各类终端显示浏览.今天把首页做好,并测试无误,这里把一些应 ...
- ActiveMQ的入门demo
步骤: 1 :下载ActiveMQ 官网:http://activemq.apache.org/ 2 :解压AcitveMQ, 根据自己的操作系统选择运行win64或者win32下的activemq. ...
- JQuery中serialize() 序列化
更多2014/8/24 来源:jquery学习浏览量:1671 学习标签: serialize 本文导读:在jQuery中,当我们使用ajax时,常常需要拼装input数据以键值对(Key/Value ...
- web编程速度大比拼(nodejs go python)(非专业对比)
C10K问题的解决,涌现出一大批新框架,或者新语言,那么问题来了:到底谁最快呢?非专业程序猿来个非专业对比. 比较程序:输出Hello World! 测试程序:siege –c 100 –r 100 ...
- MySQL Select 优化
准备: create table t(x int primary key,y int unique,z int); insert into t(x,y,z) values(1,1,1),(2,2,2) ...
- VS2010 win32项目windows窗体程序 向导生成代码解析
目录: 1.Win32项目的windows窗体程序的向导生成了如下代码 2.手工生成代码如下 3.当消息队列中没有消息需要处理,我们可以利用这段时间处理我们自己的任务 1.Win32项目的window ...
- 有道翻译API
轻奢侈品_百度百科 轻奢侈品 有道翻译API 有道翻译API申请成功 API key:72763558 keyfrom:lexus-studio
- 基于mini2440的看门狗(裸机)
在由单片机构成的微型计算机系统中,由于单片机的工作常常会受到来自外界电磁场的干扰,造成程序的跑飞,而陷入死循环,程序的正常运行被打断,由单片机控制的系统无法继续工作,会造成整个系统的陷入停滞状态,发生 ...