链接

分析:根据操作模拟

 /*
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. C#/.NET基于Topshelf创建Windows服务的守护程序作为服务启动的客户端桌面程序不显示UI界面的问题分析和解决方案

    本文首发于:码友网--一个专注.NET/.NET Core开发的编程爱好者社区. 文章目录 C#/.NET基于Topshelf创建Windows服务的系列文章目录: C#/.NET基于Topshelf ...

  2. CodeChef - METEORAK Meteor

    Read problems statements in Mandarin Chineseand Russian. A meteor fell on Andrew's house. That's why ...

  3. 数据库系统学习(十)-嵌入式SQL语言之动态SQL

    第十讲 嵌入式SQL语言之动态SQL 静态SQL 区别变量和属性:高级语言向嵌入式SQL传递变量的方法 动态SQL 动态构造SQL语句是应用程序员必须掌握的重要手段 SQL语句的动态构造示例 根据界面 ...

  4. [转]Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案

    原文地址:http://www.cnblogs.com/gb2013/archive/2013/03/05/SecurityEnhancementsInTheCRT.html 在VS 2012 中编译 ...

  5. 系统重装 如何转换GPT的磁盘格式为MBR或者反过来

    使用分区助手专业版可以让磁盘在GPT和MBR之间进行转换   一般把磁盘全部格式化并清除分区,剩下的都会是可用空间,还是需要重建MBR来把磁盘转换成MBR格式的   转换会设置操作系统类型    

  6. Android开发的环境搭建及HelloWorld的实现

    安装JDK和配置Java开发环境 http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-4321 ...

  7. 九度OJ #1437 To Fill or Not to Fil

    题目描写叙述: With highways available, driving a car from Hangzhou to any other city is easy. But since th ...

  8. sqlite学习笔记10:C语言中使用sqlite之查询和更新数据

    前面说到的 sqlite_exec() 中的第三个參数, SQLite 将为 sql 參数内运行的每一个 SELECT 语句中处理的每一个记录调用这个回调函数. 本节加入了两个函数.selectFro ...

  9. 带GPG签名的Git tag

    原文地址http://airk000.github.io/git/2013/09/30/git-tag-with-gpg-key Git tag ###Tag用来做什么? Tag即标签,用以给项目仓储 ...

  10. zookeeper 服务端上下线,客户端感知

    package pfs.y2017.m11.zookeeper.demo03; import java.util.ArrayList; import java.util.List; import or ...