Submission #58481
ソースコード
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 | #include<bits/stdc++.h> #define lol long long #define mp make_pair #define fi first #define se second using namespace std; string s[1000]; string an[1000]; signed main(){ cin.tie(0); ios::sync_with_stdio( false ); int n; cin >>n; for ( int i=0;i<n;i++) cin >>s[i]; for ( int i=0;i<n;i++) cin >>an[i]; int na=0,ri=1,li=1,re=2; for ( int i=0;i<n;i++){ for ( int j=0;j<n;j++){ if (s[i][j]!=an[i][j]) na++; if (s[i][j]!=an[j][n-i-1]) ri++; if (s[i][j]!=an[n-j-1][i]) li++; if (s[i][j]!=an[n-i-1][n-j-1]) re++; } } cout <<min(min(na,ri),min(li,re))<< '\n' ; return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 1265 - ポスター (Poster) |
ユーザー名 | ei1923 |
投稿日時 | 2020-02-05 17:07:06 |
言語 | C++14 |
状態 | Accepted |
得点 | 100 |
ソースコード長 | 644 Byte |
最大実行時間 | 40 ms |
最大メモリ使用量 | 1212 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 100 / 100 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
01-01.txt | AC | 40 ms | 1116 KB |
1
|
01-02.txt | AC | 28 ms | 1140 KB |
1
|
01-03.txt | AC | 27 ms | 1160 KB |
1
|
01-04.txt | AC | 24 ms | 1180 KB |
1
|
01-05.txt | AC | 27 ms | 1204 KB |
1
|
01-06.txt | AC | 27 ms | 1100 KB |
1
|
01-07.txt | AC | 18 ms | 1056 KB |
1
|
01-08.txt | AC | 21 ms | 1024 KB |
1
|
01-09.txt | AC | 21 ms | 984 KB |
1
|
01-10.txt | AC | 29 ms | 1024 KB |
1
|
01-11.txt | AC | 21 ms | 956 KB |
1
|
01-12.txt | AC | 24 ms | 1052 KB |
1
|
01-13.txt | AC | 25 ms | 1212 KB |
1
|
01-14.txt | AC | 28 ms | 1196 KB |
1
|
01-15.txt | AC | 26 ms | 1100 KB |
1
|
01-16.txt | AC | 17 ms | 680 KB |
1
|
01-17.txt | AC | 25 ms | 704 KB |
1
|
sample-01.txt | AC | 29 ms | 728 KB |
1
|
sample-02.txt | AC | 20 ms | 624 KB |
1
|
sample-03.txt | AC | 24 ms | 648 KB |
1
|