Submission #00037
ソースコード
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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | #include <bits/stdc++.h> using namespace std; int main(){ int N,i=0,m=0,l=0,l1=0,l2=0,l3=0,l4=0,l5=0,l6=0,ll=0; cin >>N; char S[N][N],T[N][N],S1[N][N]; while (m<N) { i=0; while (i<N){ cin >> S[m][i]; S1[m][i]=S[m][i]; i++; } m++; } m=0; while (m<N) { i=0; while (i<N){ cin >> T[m][i]; i++; } m++; } m=0; while (m<N) { i=0; while (i<N){ if ( S1[m][i]!=T[m][i]){ l++; } i++; } m++; } m=0; while (m<N) { i=0; while (i<N){ S1[m][N-(i+1)]=S[i][m]; i++; } m++; } l1++; l2++; l3++; m=0; while (m<N){ i=0; while (i<N){ if (S1[m][i]!=T[m][i]){ l1++; } i++; } m++; } m=0; while (m<N){ i=0; while (i<N){ S[m][N-(i+1)]=S1[i][m]; i++; } m++; } l2++; l3++; m=0; while (m<N){ i=0; while (i<N){ if (S[m][i]!=T[m][i]){ l2++; } i++; } m++; } m=0; while (m<N){ i=0; while (i<N){ S1[m][N-(i+1)]=S[i][m]; i++; } m++; } m=0; l3--; while (m<N){ i=0; while (i<N){ if (S1[m][i]!=T[m][i]){ l3++; } i++; } m++; } if (l<=l1&&l<=l2&&l<=l3){ ll=l; } if (l>=l1&&l1<=l2&&l1<=l3){ ll=l1; } if (l2<=l1&&l>=l2&&l2<=l3){ ll=l2; } if (l3<=l1&&l3<=l2&&l>=l3){ ll=l3; } cout<<ll<< "\n" ; } |
ステータス
項目 | データ |
---|---|
問題 | 0003 - ポスター |
ユーザー名 | ei2314 |
投稿日時 | 2023-11-13 17:43:53 |
言語 | C++11 |
状態 | Accepted |
得点 | 20 |
ソースコード長 | 1952 Byte |
最大実行時間 | 48 ms |
最大メモリ使用量 | 1264 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | all | 20 / 20 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
01-01.txt | AC | 43 ms | 1244 KB |
1
|
01-02.txt | AC | 39 ms | 1260 KB |
1
|
01-03.txt | AC | 41 ms | 1148 KB |
1
|
01-04.txt | AC | 34 ms | 1164 KB |
1
|
01-05.txt | AC | 40 ms | 1180 KB |
1
|
01-06.txt | AC | 35 ms | 1072 KB |
1
|
01-07.txt | AC | 39 ms | 1040 KB |
1
|
01-08.txt | AC | 37 ms | 1036 KB |
1
|
01-09.txt | AC | 42 ms | 1160 KB |
1
|
01-10.txt | AC | 37 ms | 1212 KB |
1
|
01-11.txt | AC | 48 ms | 1156 KB |
1
|
01-12.txt | AC | 33 ms | 1160 KB |
1
|
01-13.txt | AC | 33 ms | 1204 KB |
1
|
01-14.txt | AC | 38 ms | 1228 KB |
1
|
01-15.txt | AC | 37 ms | 1264 KB |
1
|
01-16.txt | AC | 18 ms | 736 KB |
1
|
01-17.txt | AC | 20 ms | 584 KB |
1
|
sample-01.txt | AC | 18 ms | 560 KB |
1
|
sample-02.txt | AC | 21 ms | 536 KB |
1
|
sample-03.txt | AC | 17 ms | 632 KB |
1
|