【CS Round #46 (Div. 1.5) B】Letters Deque
2024-10-01 02:54:29
【链接】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;
}
最新文章
- 做一个gulp+webpack+vue的单页应用开发架子
- 关于Jmeter分布式测试在公司内的使用
- JavaScript基础介绍
- 《zw版&#183;Halcon-delphi系列原创教程》 Halcon分类函数012,polygon,多边形
- ExtJs
- [JS4] 最简单JS框架
- 《深入理解计算机系统》深入实践之——vim深入研究
- oracle连接和执行流程总结
- NSPoint
- TCMalloc
- Maven 项目 启动时 解决3 字节的 UTF-8 序列的字节 3 无效
- ibeacon和蓝牙有什么区别_它们的区别在哪里
- bzoj4152-[AMPPZ2014]The_Captain
- 20165237 2017-2018-2 《Java程序设计》第6周学习总结
- 使用pm2离线部署nodejs项目
- maven 配置篇 之 settings.xml
- java 中方法重载
- Hashmat the brave warrior(UVa10055)简单题
- 在TFS中使用Git Tags(标签或标记),实现代码的版本管理
- 第六章 函数、谓词、CASE表达式 6-2 谓词