Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
124461 | 柯昊阳 | 方块转换 | C++ | 编译错误 | 0 | 0 MS | 0 KB | 2082 | 2024-01-23 14:47:08 |
#include <bits/stdc++.h> using namespace std; string a[15]; string tmp[15]; string b[15]; int n; void tr(){ for(int i = 0;i<n;i++){ tmp[i] = a[i]; } for(int i = 0;i<n;i++){ for(int j = 0;j<n;j++){ a[j][i] = tmp[n-1-i][j]; } } } void sp(){ for(int i = 0;i<n;i++) tmp[i] = a[i]; for(int i = 0;i<n;i++){ for(int j = 0;j<n;j++){ a[i][j] = tmp[j][i]; } } } int main(){ cin>>n; for(int i = 0;i<n;i++){ cin>>a[i]; } for(int i = 0;i<n;i++) cin>>b[i];3 tr(); bool t1 = true; for(int i=0;i<n;i++){ for(int j = 0;j<n;j++){ if(a[i][j]!=b[i][j]){ t1 = false; break; } } } if(t1){ cout<<"1"<<endl; return 0; } tr(); t1 = true; for(int i=0;i<n;i++){ for(int j = 0;j<n;j++){ if(a[i][j]!=b[i][j]){ t1 = false; break; } } } if(t1){ cout<<"2"<<endl; return 0; } tr(); t1 = true; for(int i=0;i<n;i++){ for(int j = 0;j<n;j++){ if(a[i][j]!=b[i][j]){ t1 = false; break; } } } if(t1){ cout<<"3"<<endl; return 0; } tr(); sp(); t1 = true; for(int i=0;i<n;i++){ for(int j = 0;j<n;j++){ if(a[i][j]!=b[i][j]){ t1 = false; break; } } } if(t1){ cout<<"4"<<endl; return 0; } t1 = true; tr(); for(int i=0;i<n;i++){ for(int j = 0;j<n;j++){ if(a[i][j]!=b[i][j]){ t1 = false; break; } } } if(t1){ cout<<"5"<<endl; return 0; } t1 = true; tr(); for(int i=0;i<n;i++){ for(int j = 0;j<n;j++){ if(a[i][j]!=b[i][j]){ t1 = false; break; } } } if(t1){ cout<<"5"<<endl; return 0; } t1 = true; tr(); for(int i=0;i<n;i++){ for(int j = 0;j<n;j++){ if(a[i][j]!=b[i][j]){ t1 = false; break; } } } if(t1){ cout<<"5"<<endl; return 0; } tr(); sp(); t1 = true; for(int i=0;i<n;i++){ for(int j = 0;j<n;j++){ if(a[i][j]!=b[i][j]){ t1 = false; break; } } } if(t1){ cout<<"6"<<endl; return 0; } else{ cout<<"7"<<endl; return 0; } }