Submission #75836
ソースコード
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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | #include<iostream> #include<algorithm> #include<vector> using namespace std; int main(){ int n,max=0; cin >> n; char s[n][n]; char t[n][n]; for ( int i=0;i<n;i++){ for ( int j=0;j<n;j++){ cin >> s[i][j]; } } for ( int i=0;i<n;i++){ for ( int j=0;j<n;j++){ cin >> t[i][j]; } } int a=0; for ( int i=0;i<n;i++){ for ( int j=0;j<n;j++){ if (s[i][j]!=t[i][j]){ a++; } } } int b=0; for ( int i=0,k=0;i<n;i++,k++){ for ( int j=n-1,l=0;j>=0;j--,l++){ if (s[j][i]!=t[k][l]){ b++; } } } b++; int c=0; for ( int i=n-1,k=0;i>=0;i--,k++){ for ( int j=0,l=0;j<n;j++,l++){ if (s[j][i]!=t[k][l]){ c++; } } } c++; int d=0; for ( int i=n-1,k=0;i>=0;i--,k++){ for ( int j=n-1,l=0;j>=0;j--,l++){ if (s[i][j]!=t[k][l]){ d++; } } } d+=2; int ans[4]; ans[0]=a; ans[1]=b; ans[2]=c; ans[3]=d; sort(ans,ans+4); cout << ans[0] << "\n" ; return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 1265 - ポスター (Poster) |
ユーザー名 | ei2331 |
投稿日時 | 2023-09-08 17:38:02 |
言語 | C++17 |
状態 | Accepted |
得点 | 100 |
ソースコード長 | 1259 Byte |
最大実行時間 | 109 ms |
最大メモリ使用量 | 7740 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 100 / 100 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
01-01.txt | AC | 60 ms | 1496 KB |
1
|
01-02.txt | AC | 48 ms | 2004 KB |
1
|
01-03.txt | AC | 45 ms | 2520 KB |
1
|
01-04.txt | AC | 44 ms | 3032 KB |
1
|
01-05.txt | AC | 58 ms | 3412 KB |
1
|
01-06.txt | AC | 36 ms | 3924 KB |
1
|
01-07.txt | AC | 36 ms | 4232 KB |
1
|
01-08.txt | AC | 36 ms | 4700 KB |
1
|
01-09.txt | AC | 48 ms | 5160 KB |
1
|
01-10.txt | AC | 39 ms | 5688 KB |
1
|
01-11.txt | AC | 39 ms | 5860 KB |
1
|
01-12.txt | AC | 109 ms | 6460 KB |
1
|
01-13.txt | AC | 36 ms | 6736 KB |
1
|
01-14.txt | AC | 57 ms | 7464 KB |
1
|
01-15.txt | AC | 38 ms | 7740 KB |
1
|
01-16.txt | AC | 20 ms | 7300 KB |
1
|
01-17.txt | AC | 41 ms | 7396 KB |
1
|
sample-01.txt | AC | 25 ms | 7492 KB |
1
|
sample-02.txt | AC | 25 ms | 7592 KB |
1
|
sample-03.txt | AC | 21 ms | 7436 KB |
1
|