Submission #73999


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include<bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define repp(i,a,n) for(int i=a;i>=n;i--)
#define so(z) sort(z.begin(),z.end())
#define sor(z) sort(z.begin(),z.end(),greater<int>())
#define cout(a) cout<<a<<"\n"
#define yess cout<<"YES"<<nn
#define noo cout<<"NO"<<nn
#define yes cout<<"Yes"<<"\n"
#define no cout<<"No"<<"\n"
#define fi first
#define se second
#define nn "\n"
#define ll long long
#define fu 1000000007
#define IM INT_MAX
#define re(a) return(a)
#define prev(a) prev_permutation(a.begin(),a.end())
#define next(a) next_permutation(a.begin(),a.end())
using namespace std;
int main(){
int n,ans=0,ans2=1,ans3=1,ans4=2;
cin>>n;
char s[501][501],t[501][501];
rep(i,0,n) cin>>s[i];
rep(i,0,n) cin>>t[i];
rep(i,0,n){
rep(j,0,n){
if(s[i][j]!=t[i][j]) ans++;
if(s[j][n-i-1]!=t[i][j]) ans2++;
if(s[n-j-1][i]!=t[i][j]) ans3++;
if(s[n-i-1][n-j-1]!=t[i][j]) ans4++;
}
}
cout<<min({ans,ans2,ans3,ans4})<<nn;
return(0);
}

ステータス

項目 データ
問題 1265 - ポスター (Poster)
ユーザー名 r2201
投稿日時 2022-11-16 15:51:11
言語 C++17
状態 Accepted
得点 100
ソースコード長 1076 Byte
最大実行時間 44 ms
最大メモリ使用量 1116 KB

セット

セット 得点 Cases
1 ALL 100 / 100 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
01-01.txt AC 44 ms 1108 KB
1
01-02.txt AC 30 ms 980 KB
1
01-03.txt AC 34 ms 976 KB
1
01-04.txt AC 31 ms 1108 KB
1
01-05.txt AC 32 ms 1108 KB
1
01-06.txt AC 35 ms 980 KB
1
01-07.txt AC 27 ms 1000 KB
1
01-08.txt AC 33 ms 1028 KB
1
01-09.txt AC 30 ms 928 KB
1
01-10.txt AC 26 ms 1056 KB
1
01-11.txt AC 34 ms 936 KB
1
01-12.txt AC 33 ms 1092 KB
1
01-13.txt AC 29 ms 960 KB
1
01-14.txt AC 35 ms 1116 KB
1
01-15.txt AC 27 ms 988 KB
1
01-16.txt AC 19 ms 620 KB
1
01-17.txt AC 15 ms 584 KB
1
sample-01.txt AC 17 ms 676 KB
1
sample-02.txt AC 18 ms 636 KB
1
sample-03.txt AC 22 ms 724 KB
1