【链接】h在这里写链接


【题意】


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

【题解】


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

【错的次数】


2

【反思】


自己强行理解错题意

【代码】

/*

*/
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <cstdlib>
#include <cmath>
#include <bitset>
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 double typedef pair<int,int> pii;
typedef pair<LL,LL> 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;
}

【CS Round #46 (Div. 1.5) B】Letters Deque的更多相关文章

  1. 【CS Round #46 (Div. 1.5) A】Letters Deque

    [链接]h在这里写链接 [题意] 在这里写题意 [题解] string类模拟 [错的次数] 0 [反思] 在这了写反思 [代码] /* */ #include <cstdio> #incl ...

  2. 【CS Round #46 (Div. 1.5) E】Ultimate Orbs

    [链接]链接 [题意] n个人从左到右站在一条直线上.每个人都有一个能力值g[i],然后每个人可以将相邻的一个人打败. 然后它的能力值能够增加相应的能力值(就是打败了的那个人的能力值). A能够打败B ...

  3. 【CS Round #46 (Div. 1.5) C】Set Subtraction

    [链接]h在这里写链接 [题意] 一开始有n个数字,然后有一个数字X,把每个数字都减去X,又生成N个新的数字. 然后把这2*N个数字混在一起. 告诉你这2*N个数字是什么.让你复原出原来的N个数字,以 ...

  4. 【CS Round #36 (Div. 2 only) A】Bicycle Rental

    [题目链接]:https://csacademy.com/contest/round-36/task/bicycle-rental/ [题意] 让你从n辆车中选一辆车; 每一辆车有3个属性 1.到达车 ...

  5. 【CS Round #37 (Div. 2 only) D】Reconstruct Graph

    [Link]:https://csacademy.com/contest/round-37/task/reconstruct-graph/statement/ [Description] 给你一张图; ...

  6. 【CS Round #37 (Div. 2 only) B】Group Split

    [Link]:https://csacademy.com/contest/round-37/task/group-split/ [Description] 让你把一个数分成两个数a.b的和; (a,b ...

  7. 【CS Round #37 (Div. 2 only) A】Boring Number

    [Link]:https://csacademy.com/contest/round-37/task/boring-number/ [Description] 让你找离平均数最近的一个数的下标; [S ...

  8. 【CS Round #39 (Div. 2 only) D】Seven-segment Display

    [Link]:https://csacademy.com/contest/round-39/task/seven-segment-display/ [Description] 0..9各自有一个数字, ...

  9. 【CS Round #39 (Div. 2 only) C】Reconstruct Sum

    [Link]:https://csacademy.com/contest/round-39/task/reconstruct-sum/ [Description] 给你一个数字S; 让你找有多少对A, ...

随机推荐

  1. HDU-5307 He is Flying (FFT)

    Problem DescriptionJRY wants to drag racing along a long road. There are n sections on the road, the ...

  2. 小米开源便签Notes-源码研究(2)-定时提醒的便签

    本篇讲述小米便签中的定时提醒功能.  便签,可以理解为一件事情,一项任务,有个定时提醒的功能,还是蛮不错的~    小米便签定时功能,是当编辑便签的时候,有个菜单项,选了之后,就弹出一个"日 ...

  3. JS 中 this 与闭包的结合产生的问题

    代码片段一: var name = "The Window"; var object = { name : "My Object", getNameFunc : ...

  4. 解决WIN7远程登录提示无法保存凭据的问题

    事由:今天到公司,想起手上还有点小东西没有改动完,就打算连上server进行小改动.结果发现昨天还能好好的远程连接server的WIN7,今天突然间不能远程登录了~ 无奈~悲催~ 我仅仅能猜是不是有什 ...

  5. osgi实战学习之路:1. ant+bnd+felix搭建osgi之HelloWorld

    开发环境分为三个部份 osgi_provider: bundle开发环境,对外提供服务 osgi_consumer: 引用其他bundle osgi_main: 执行測试 项目主要内容 : commo ...

  6. strongSwan IKEv2服务器配置

    strongSwan IKEv2服务器配置 资料来源 https://www.cl.cam.ac.uk/~mas90/resources/strongswan/ 经过大量的反复试验,我配置了一个str ...

  7. Docs-->.NET-->API reference-->System.​Web.​UI.​Web​Controls-->Repeater

    https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.repeater?view=netframework-4.7 ...

  8. jquery的ajax总结

    jquery的ajax总结 一.总结 一句话总结:ajax函数中层级关系如下: 最底层的封装方式: $.ajax(); 第二层: .load(),$.get(), $.post() 最高层: $.ge ...

  9. php中array_merge函数

    php中array_merge函数 一.array_merge简介 (PHP 4, PHP 5, PHP 7) array_merge — 合并一个或多个数组 说明¶ array array_merg ...

  10. 深入了解"网上邻居"原理

    说到“网上邻居”,相信很多人都很熟悉.但是说起“网上邻居”的工作机制,可能大家就不太清楚了. 要说“网上邻居”的工作机制,不妨联系一下生活中的例子:比如我(A),要拜访一个远方的朋友(B),我要去他的 ...