Secrete Master Plan HDU - 5540

问两个锦囊是不是一个,就是简单的把第二个锦囊旋转一下对比就可以
暴力即可

//leehaoze
#include <iostream>
#include <deque>
#include <string>
#include <vector>
#include <queue>
#include <cstdio>
#include <stack>
#include <algorithm>
#include <cstring>
#include <cctype>
#include <cstdio>
#include <cmath>
#include <cstdlib>

using namespace std;
const int INF = 1<<29;
#define INC_SAT( val ) (val = ((val)+1 > (val)) ? (val)+1 : (val))
#define ARR_SIZE( a ) ( sizeof( (a) ) / sizeof( (a[0]) ) )
#define ULL unsigned long long

int A[4][4],B[4][4];

bool Comp(){
    for (int i = 0; i < 2; ++i) {
        for (int j = 0; j < 2; ++j) {
            if(A[i][j] != B[i][j])
                return false;
        }
    }
    return true;
}

void Change(){
    swap(B[0][0],B[0][1]);
    swap(B[0][0],B[1][1]);
    swap(B[0][0],B[1][0]);
}

bool Match(){
    for (int i = 0; i < 4; ++i) {
        if(Comp()){
            return true;
        }
        else{
            Change();
        }
    }
    return false;
}

int main() {
#ifdef LOCAL
    freopen("IN.txt", "r", stdin);
#endif
    int T;
    scanf("%d",&T);
    int cases = 1;
    while(T--){
        scanf("%d%d",&A[0][0],&A[0][1]);
        scanf("%d%d",&A[1][0],&A[1][1]);
        scanf("%d%d",&B[0][0],&B[0][1]);
        scanf("%d%d",&B[1][0],&B[1][1]);
        if(Match()){
            printf("Case #%d: POSSIBLE\n",cases++);
        }
        else{
            printf("Case #%d: IMPOSSIBLE\n",cases++);
        }
    }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值