博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【CS Round #46 (Div. 1.5) B】Letters Deque
阅读量:4329 次
发布时间:2019-06-06

本文共 1789 字,大约阅读时间需要 5 分钟。

【链接】

【题意】

让你把一个正方形A竖直或水平翻转。
问你翻转一次能不能把A翻转成B

【题解】

有说一定要恰好为1次。
并不是说A和B相同就一定不行。

【错的次数】

2

【反思】

自己强行理解错题意

【代码】

/**/#include 
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1#define LL long long#define rep1(i,a,b) for (int i = a;i <= b;i++)#define rep2(i,a,b) for (int i = a;i >= b;i--)#define mp make_pair#define pb emplace_back#define fi first#define se second#define ld long double#define ms(x,y) memset(x,y,sizeof x)#define ri(x) scanf("%d",&x)#define rl(x) scanf("%lld",&x)#define rs(x) scanf("%s",x)#define rf(x) scnaf("%lf",&x)#define oi(x) printf("%d",x)#define ol(x) printf("%lld",x)#define oc putchar(' ')#define os(x) printf(x)#define all(x) x.begin(),x.end()#define Open() freopen("F:\\rush.txt","r",stdin)#define Close() ios::sync_with_stdio(0)#define sz(x) ((int) x.size())#define ld long doubletypedef pair
pii;typedef pair
pll;//mt19937 myrand(time(0));//int get_rand(int n){return myrand()%n + 1;}const int dx[9] = {0,1,-1,0,0,-1,-1,1,1};const int dy[9] = {0,0,0,-1,1,-1,1,-1,1};const double pi = acos(-1.0);const int N = 110;int n,a[N+10][N+10],b[N+10][N+10];bool ok(){    rep1(i,1,n)        rep1(j,1,n)            if (a[i][j]!=b[i][j]){                return false;            }    return true;}void shui(){    rep1(i,1,n/2)        rep1(j,1,n)            swap(a[i][j],a[n-i+1][j]);}void shu(){    rep1(j,1,n/2){        rep1(i,1,n)            swap(a[i][j],a[i][n-j+1]);    }}int main(){    //Open();    //Close();    ri(n);    rep1(i,1,n)        rep1(j,1,n)            ri(a[i][j]);    rep1(i,1,n)        rep1(j,1,n)            ri(b[i][j]);    shui();    if (ok()){        puts("1");        return 0;    }    shui();    shu();    if (ok()){        puts("1");        return 0;    }    puts("0");    return 0;}

转载于:https://www.cnblogs.com/AWCXV/p/7626044.html

你可能感兴趣的文章
根据ISBN获取豆瓣API提供的图书信息
查看>>
【转】Python中*args和**kwargs的区别
查看>>
git命令简单使用
查看>>
CODEFORCES 125E MST Company 巧用Kruskal算法
查看>>
C++标准库分析总结(三)——<迭代器设计原则>
查看>>
Ibatis 配置问题
查看>>
Notability 3.1 for Mac 中文共享版 – 好用的文本笔记工具
查看>>
HDU 2089 数位dp入门
查看>>
How do I resolve the CodeSign error: CSSMERR_TP_NOT_TRUSTED?
查看>>
linux下添加定时任务
查看>>
python的第三篇--安装Ubuntu、pycharm
查看>>
LeetCode 1092. Shortest Common Supersequence
查看>>
《区块链技术与应用》北京大学肖臻老师公开课 笔记
查看>>
139句
查看>>
购买《哈利波特》书籍
查看>>
谈谈一些网页游戏失败的原因到底有哪些?(转)
查看>>
备案的问题
查看>>
asp.net下ajax.ajaxMethod使用方法
查看>>
win10+mongodb安装配置
查看>>
window7修改hosts文件
查看>>