Submission #64020
ソースコード
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 | #include <iostream> #include <algorithm> #include <vector> using namespace std; signed main(){ cin.tie(nullptr); ios_base::sync_with_stdio( false ); int n,d1=0,d2=0,d3=0,d4=0; cin>>n; vector<vector< char >> s(n+1,vector< char >(n+1)),t(n+1,vector< char >(n+1)); for ( int i=1;i<=n;i++){ for ( int j=1;j<=n;j++){ cin>>s[i][j]; } } for ( int i=1;i<=n;i++){ for ( int j=1;j<=n;j++){ cin>>t[i][j]; if (s[i][j]!=t[i][j]){ d1++; } if (s[j][n-i+1]!=t[i][j]){ d2++; } if (s[n-j+1][i]!=t[i][j]){ d3++; } if (s[n-i+1][n-j+1]!=t[i][j]){ d4++; } } } int minv=min(d1,d2+1); minv=min(minv,d3+1); minv=min(minv,d4+2); cout<<minv<< '\n' ; return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 1265 - ポスター (Poster) |
ユーザー名 | ei2009 |
投稿日時 | 2020-09-14 16:17:25 |
言語 | C++17 |
状態 | Accepted |
得点 | 100 |
ソースコード長 | 921 Byte |
最大実行時間 | 60 ms |
最大メモリ使用量 | 7964 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 100 / 100 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
01-01.txt | AC | 50 ms | 1628 KB |
1
|
01-02.txt | AC | 38 ms | 2076 KB |
1
|
01-03.txt | AC | 26 ms | 2660 KB |
1
|
01-04.txt | AC | 26 ms | 2976 KB |
1
|
01-05.txt | AC | 60 ms | 3552 KB |
1
|
01-06.txt | AC | 28 ms | 3872 KB |
1
|
01-07.txt | AC | 35 ms | 4252 KB |
1
|
01-08.txt | AC | 59 ms | 4648 KB |
1
|
01-09.txt | AC | 27 ms | 5292 KB |
1
|
01-10.txt | AC | 44 ms | 5756 KB |
1
|
01-11.txt | AC | 36 ms | 6116 KB |
1
|
01-12.txt | AC | 56 ms | 6512 KB |
1
|
01-13.txt | AC | 21 ms | 6848 KB |
1
|
01-14.txt | AC | 22 ms | 7636 KB |
1
|
01-15.txt | AC | 24 ms | 7964 KB |
1
|
01-16.txt | AC | 28 ms | 7456 KB |
1
|
01-17.txt | AC | 25 ms | 7532 KB |
1
|
sample-01.txt | AC | 20 ms | 7492 KB |
1
|
sample-02.txt | AC | 23 ms | 7452 KB |
1
|
sample-03.txt | AC | 20 ms | 7404 KB |
1
|