链接

分析:根据操作模拟

 /*
ID:wanghan
PROB:transform
LANG:C++
*/
#include "iostream"
#include "cstdio"
#include "cstring"
#include "string"
#include "cmath"
using namespace std;
const int maxn=;
string s[maxn],solve[maxn];
int n;
bool Turn3(string str[],string val[]){
char t[maxn][maxn];
for(int i=;i<n;i++){
for(int j=;j<n;j++){
t[i][j]=s[j][n--i];
}
}
/*for(int i=0;i<n;i++){
for(int j=0;j<n;j++)
cout<<t[i][j];
cout<<endl;
}
cout<<endl;*/
int flag=;
for(int i=;i<n;i++){
for(int j=;j<n;j++)
if(t[i][j]!=val[i][j]){
flag=; break;
}
if(flag) break;
}
if(flag) return false;
return true;
}
bool Turn2(string str[],string val[]){
char t[maxn][maxn];
for(int i=;i<n;i++){
for(int j=;j<n;j++)
t[i][j]=str[n-i-][n-j-];
}
/*for(int i=0;i<n;i++){
for(int j=0;j<n;j++)
cout<<t[i][j];
cout<<endl;
}
cout<<endl;*/
int flag=;
for(int i=;i<n;i++){
for(int j=;j<n;j++)
if(t[i][j]!=val[i][j]){
flag=; break;
}
if(flag) break;
}
if(flag) return false;
return true;
}
bool Turn1(string str[],string val[]){
char t[maxn][maxn];
for(int i=;i<n;i++){
for(int j=;j<n;j++)
t[i][j]=str[n--j][i];
}
/*for(int i=0;i<n;i++){
for(int j=0;j<n;j++)
cout<<t[i][j];
cout<<endl;
}
cout<<endl;*/
int flag=;
for(int i=;i<n;i++){
for(int j=;j<n;j++)
if(t[i][j]!=val[i][j]){
flag=; break;
}
if(flag) break;
}
if(flag) return false;
return true;
}
bool Turn4(string str[],string val[]){
for(int i=;i<n;i++){
for(int j=;j<n/;j++)
swap(str[i][j],str[i][n--j]);
}
/*for(int i=0;i<n;i++){
for(int j=0;j<n;j++)
cout<<str[i][j];
cout<<endl;
}
cout<<endl;*/
int flag=;
for(int i=;i<n;i++){
for(int j=;j<n;j++)
if(str[i][j]!=val[i][j]){
flag=; break;
}
if(flag) break;
}
if(flag) return false;
return true;
}
bool Turn5(string str[],string val[]){
char t1[maxn][maxn],t2[maxn][maxn],t3[maxn][maxn];
/*for(int i=0;i<n;i++){
for(int j=0;j<n/2;j++)
swap(str[i][j],str[i][n-1-j]);
}*/
for(int i=;i<n;i++){
for(int j=;j<n;j++)
t1[i][j]=str[n--j][i];
}
int flag=;
for(int i=;i<n;i++){
for(int j=;j<n;j++)
if(t1[i][j]!=val[i][j]){
flag=; break;
}
if(flag) break;
}
if(!flag) return true;
/*for(int i=0;i<n;i++){
for(int j=0;j<n;j++)
cout<<t1[i][j];
cout<<endl;
}
cout<<endl;*/
for(int i=;i<n;i++){
for(int j=;j<n;j++)
t2[i][j]=str[n-i-][n-j-];
}
flag=;
for(int i=;i<n;i++){
for(int j=;j<n;j++)
if(t2[i][j]!=val[i][j]){
flag=; break;
}
if(flag) break;
}
if(!flag) return true;
/*for(int i=0;i<n;i++){
for(int j=0;j<n;j++)
cout<<t2[i][j];
cout<<endl;
}
cout<<endl;*/
for(int i=;i<n;i++){
for(int j=;j<n;j++){
t3[i][j]=str[j][n--i];
}
}
//int flag=0;
flag=;
for(int i=;i<n;i++){
for(int j=;j<n;j++)
if(t3[i][j]!=val[i][j]){
flag=; break;
}
if(flag) break;
}
/*for(int i=0;i<n;i++){
for(int j=0;j<n;j++)
cout<<t3[i][j];
cout<<endl;
}
cout<<endl;*/
if(!flag) return true;
return false;
}
bool Turn6(string str[],string val[]){
int flag=;
for(int i=;i<n;i++){
for(int j=;j<n;j++)
if(str[i][j]!=val[i][j]){
flag=; break;
}
if(flag) break;
}
if(flag) return false;
return true;
}
int main()
{
freopen("transform.in", "r", stdin);
freopen("transform.out", "w", stdout);
while(cin>>n){
for(int i=;i<n;i++){
cin>>s[i];
}
for(int i=;i<n;i++){
cin>>solve[i];
}
if(Turn1(s,solve)){
cout<<""<<endl;
}else if(Turn2(s,solve)){
cout<<""<<endl;
}else if(Turn3(s,solve)){
cout<<""<<endl;
}else if(Turn4(s,solve)){
cout<<""<<endl;
}else if(Turn5(s,solve)){
cout<<""<<endl;
}else if(Turn6(s,solve)){
cout<<""<<endl;
}else{
cout<<""<<endl;
}
}
return ;
}

Transformations的更多相关文章

  1. [大数据之Spark]——Transformations转换入门经典实例

    Spark相比于Mapreduce的一大优势就是提供了很多的方法,可以直接使用:另一个优势就是执行速度快,这要得益于DAG的调度,想要理解这个调度规则,还要理解函数之间的依赖关系. 本篇就着重描述下S ...

  2. 【USACO】Transformations(模拟)

    Transformations A square pattern of size N x N (1 <= N <= 10) black and white square tiles is ...

  3. WPF Wonders: Transformations (and Robots!)

    indows Presentation Framework (WPF) gets a lot of mileage out of being layered on top of DirectX, in ...

  4. [Compose] 21. Apply Natural Transformations in everyday work

    We see three varied examples of where natural transformations come in handy. const Right = x => ( ...

  5. [Compose] 20. Principled type conversions with Natural Transformations

    We learn what a natural transformation is and see the laws it must obey. We will see how a natural t ...

  6. Glossary of view transformations

    Glossary of view transformations The following terms are used to define view orientation, i.e. trans ...

  7. 【USACO】Transformations

    A square pattern of size N x N (1 <= N <= 10) black and white square tiles is transformed into ...

  8. [USACO1.2.2]方块转换 Transformations

    P1205 [USACO1.2]方块转换 Transformations 标签 搜索/枚举 USACO 题目描述 一块N x N(1<=N<=10)正方形的黑白瓦片的图案要被转换成新的正方 ...

  9. SSIS 阻塞,半阻塞和全阻塞 (Non-blocking, semi-blocking and Fully-blocking) transformations清单

    三种Blocking类型,这里跟数据流的Buff关系很大:■■ non-blocking transformations,每一行直接转换输出,没有等待.■■ partial-blocking tran ...

  10. spark的action和transformations汇集

    汇总了Spark支持的Transformations 和Actions 用于备忘! 參考 http://spark.apache.org/docs/latest/programming-guide.h ...

随机推荐

  1. CCPC-Wannafly Winter Camp Day1 (Div2, online mirror) A,B,C,E,F,I,J

    https://www.zhixincode.com/contest/7/problems A题 分类讨论 当B有点需要经过时 穿梭的花费肯定为2*k,也可以发现,我们要找到包含所有需要经过的点(不含 ...

  2. (5)ASP.NET Core 中的静态文件

    1.前言 当我们创建Core项目的时候,Web根目录下会有个wwwroot文件目录,wwwroot文件目录里面默认有HTML.CSS.IMG.JavaScript等文件,而这些文件都是Core提供给客 ...

  3. 问题:typedef char *pstring????

    typedef char *pstring; const pstring cstr = 0; //cstr是指向char的常量指针: const pstring *ps; //ps是一个指针,它的对象 ...

  4. 打印报表以显示具有给定责任的用户-FNDSCRUR责任用户

    select --&p_hint         distinct         user_name,         decode (            greatest (u.sta ...

  5. [转]文件IO详解(二)---文件描述符(fd)和inode号的关系

    原文:https://www.cnblogs.com/frank-yxs/p/5925563.html 文件IO详解(二)---文件描述符(fd)和inode号的关系 ---------------- ...

  6. Win7 VNC远程连接Centos桌面

    一,安装Linux桌面: yum -y groupinstall Desktop yum -y groupinstall "X Window System" yum -y grou ...

  7. Java之基于Eclipse搭建SSH框架(下)

    在上篇博客里,我简介了Tomcat滴配置与Struts2滴搭建,假设对这个还不会滴童鞋去看一下我滴上篇博客<Java之基于Eclipse搭建SSH框架(上)>.今天我们接着上篇博客滴内容. ...

  8. linux系列之-—03 压缩和解压缩命令

    tar命令 解包:tar zxvf FileName.tar 打包:tar czvf FileName.tar DirName gz命令 解压1:gunzip FileName.gz 解压2:gzip ...

  9. shell学习五十六天----延迟进程调度

    延迟进程调度 前言:大部分时候,我们都希望进程快点開始,开点结束,别卡.而shell的运行,也是在前一个命令后,立即接着运行下一个命令.命令完毕的速度是与资源的限制有关,且不在shell的权限下. 在 ...

  10. REST – PUT vs POST

    REST – PUT vs POST – REST API Tutorial https://restfulapi.net/rest-put-vs-post/ REST – PUT vs POST I ...