本地能过第二个测试点但硬是WA555
#include<bits/stdc++.h>
#define ijr if(ju())return true;return false;
using namespace std;
int n;
char c[12][38],ctmp[12][38],cgoal[12][38],cor[12][38];
void in(){
getchar();
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
c[i][j]=getchar();
}
getchar();
}
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
cgoal[i][j]=getchar();
}
getchar();
}
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++)
cor[i][j]=c[i][j];
}
bool ju(){
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
if(ctmp[i][j]!=cgoal[i][j])return false;
}
}
return true;
}
bool w1(){
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
ctmp[j][n+1-i]=c[i][j];
}
}
ijr
}
bool w2(){
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
ctmp[n+1-i][n+1-j]=c[i][j];
}
}
ijr
}
bool w3(){
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
ctmp[n+1-j][i]=c[i][j];
}
}
ijr
}
bool w4(){
switch(n%2){
case 1:{
int h=n/2,t=n/2+2;
for(int i=1;i<=n;i++)c[i][h+1]=cor[i][h+1];
while(h>=1){
for(int i=1;i<=n;i++){
c[i][h]=cor[i][t];
c[i][t]=cor[i][h];
}
h--;t++;
}
break;
}
case 0:{
int h=n/2,t=n/2+1;
while(h>=1){
for(int i=1;i<=n;i++){
c[i][h]=cor[i][t];
c[i][h]=cor[i][t];
}
h--;t++;
}
break;
}
}
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++)
ctmp[i][j]=c[i][j];
ijr
}
bool w5(){
if(w1()||w2()||w3())return true;
return false;
}
bool w6(){
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++){
if(cor[i][j]!=cgoal[i][j])return false;
}
return true;
}
int main(){
cin>>n;
in();
if(w1())cout<<1;
else if(w2())cout<<2;
else if(w3())cout<<3;
else if(w4())cout<<4;
else if(w5())cout<<5;
else if(w6())cout<<6;
else cout<<7;
}
Wrong Answer. wrong answer On line 1 column 1, read 7, expected 5.