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/Others)
Total Submission(s): 429 Accepted Submission(s): 244
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.
(starting from 1) and y is either "POSSIBLE" or "IMPOSSIBLE" (quotes for clarity).
1 2
3 4
1 2
3 4
1 2
3 4
3 1
4 2
1 2
3 4
3 2
4 1
1 2
3 4
4 3
2 1
Case #2: POSSIBLE
Case #3: IMPOSSIBLE
Case #4: POSSIBLE
#include <cstdio>
#include <iostream>
using namespace std; const int N = ;
int A[][], B[][], T[][]; int main()
{
int test;
scanf("%d", &test);
for(int testnumber = ; testnumber <= test; testnumber++)
{
for(int i = ; i < ; i++)
for(int j = ; j < ; j++)
scanf("%d", &A[i][j]);
for(int i = ; i < ; i++)
for(int j = ; j < ; j++)
scanf("%d", &B[i][j]); bool flag = ;
for(int k = ; k < ; k++)
{
T[][] = B[][];
T[][] = B[][];
T[][] = B[][];
T[][] = B[][]; for(int i = ; i < ; i++)
for(int j = ; j < ; j++)
B[i][j] = T[i][j]; /*for(int i = 0; i < 2; i++)
{
for(int j = 0; j < 2; j++)
printf("%d ", B[i][j]);
printf("\n");
}*/ bool okay = ;
for(int i = ; i < && !okay; i++)
for(int j = ; j < ; j++)
if(A[i][j] != B[i][j])
{
okay = ;
break;
}
if(!okay)
{
flag = ;
break;
}
}
if(!flag) printf("Case #%d: POSSIBLE\n", testnumber);
else printf("Case #%d: IMPOSSIBLE\n", testnumber);
}
return ;
}
The 2015 China Collegiate Programming Contest A. Secrete Master Plan hdu5540的更多相关文章
- The 2015 China Collegiate Programming Contest Game Rooms
Game Rooms Time Limit: 4000/4000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Submi ...
- The 2015 China Collegiate Programming Contest C. The Battle of Chibi hdu 5542
The Battle of Chibi Time Limit: 6000/4000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Othe ...
- The 2015 China Collegiate Programming Contest L. Huatuo's Medicine hdu 5551
Huatuo's Medicine Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others ...
- The 2015 China Collegiate Programming Contest K Game Rooms hdu 5550
Game Rooms Time Limit: 4000/4000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total ...
- The 2015 China Collegiate Programming Contest H. Sudoku hdu 5547
Sudoku Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Subm ...
- The 2015 China Collegiate Programming Contest G. Ancient Go hdu 5546
Ancient Go Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total ...
- The 2015 China Collegiate Programming Contest E. Ba Gua Zhen hdu 5544
Ba Gua Zhen Time Limit: 6000/4000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total ...
- The 2015 China Collegiate Programming Contest D.Pick The Sticks hdu 5543
Pick The Sticks Time Limit: 15000/10000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others ...
- The 2015 China Collegiate Programming Contest -ccpc-c题-The Battle of Chibi(hdu5542)(树状数组,离散化)
当时比赛时超时了,那时没学过树状数组,也不知道啥叫离散化(貌似好像现在也不懂).百度百科--离散化,把无限空间中无限的个体映射到有限的空间中去,以此提高算法的时空效率. 这道题是dp题,离散化和树状数 ...
随机推荐
- .net 获取https页面的信息 在iis7.5服务器上不管用
让我纠结了一天多的问题,给大家看下,有相同情况的可以不用浪费时间了,本人当时找了好半天都没找到什么有用的信息,项目在本地没有问题,但部署在服务器后,获取不到https页面的信息,加入下面的代码就可以了 ...
- 多次快速点击相同button导致重复响应的问题
Button在开发中经常用到,但是如果在瞬间点击多次时会出现多次响应事件的问题,今天给大家分享一下解决方法. 方法一:在Button响应事件中禁止Button允许点击, -(void)buttonAc ...
- db2 Hidden columns
When a table column is defined with the implicitly hidden attribute, that column is unavailable unle ...
- UVA 10252
按照字典序输出最长公共子序列 #include<time.h> #include <cstdio> #include <iostream> #include< ...
- 第二课 less的学习以及移动端需要注意的问题
一.LESS的学习笔记: 1.less介绍:一种动态样式语言.less将css赋予了动态语言的特性,如变量,继承,运算,函数,less既可以在客户端上运行(支持IE6+,webkit,firefox) ...
- 三、jQuery--jQuery基础--jQuery基础课程--第8章 jQuery 实现Ajax应用
1.使用load()方法异步请求数据 使用load()方法通过Ajax请求加载服务器中的数据,并把返回的数据放置到指定的元素中,它的调用格式为:load(url,[data],[callback]) ...
- 【C#】 用Route进行URL重写
在.NET Framework 4中,微软推出了Route机制.这种机制不仅在MVC中大量运用,在WebForm中也可以使用. 和Contex.RewritePath()一样,Route功能也是写在G ...
- Android Studio 配置
Android配置:[转]原地址:http://www.cnblogs.com/smyhvae/p/4022844.html [开发环境] 物理机版本:Win7旗舰版(64位) Android Stu ...
- 【翻译五】java-中断机制
Interrupts An interrupt is an indication to a thread that it should stop what it is doing and do som ...
- poj 2503:Babelfish(字典树,经典题,字典翻译)
Babelfish Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 30816 Accepted: 13283 Descr ...