結果
| 問題 |
No.2209 Flip and Reverse
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-02-10 22:34:00 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 490 bytes |
| コンパイル時間 | 1,312 ms |
| コンパイル使用メモリ | 167,456 KB |
| 実行使用メモリ | 7,188 KB |
| 最終ジャッジ日時 | 2024-07-07 16:40:35 |
| 合計ジャッジ時間 | 3,472 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 15 WA * 15 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main () {
int N;
cin >> N;
string s, t;
cin >> s >> t;
int ans1 = 0;
for (int i = 0; i < N; i ++) {
ans1 += s[i] != t[i];
}
int ans = 1e9 +7;
if (ans1 % 2 == 0) {
ans = ans1;
}
int ans2 = 0;
for (int i = 0; i < N; i ++) {
ans2 += s[N - i - 1] == t[i];
}
if (ans2 % 2 == 1) {
ans = min(ans, ans2);
}
cout << ans << endl;
}