結果
問題 |
No.2209 Flip and Reverse
|
ユーザー |
![]() |
提出日時 | 2023-02-11 02:32:08 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 613 bytes |
コンパイル時間 | 884 ms |
コンパイル使用メモリ | 105,124 KB |
最終ジャッジ日時 | 2025-02-10 13:58:42 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 WA * 11 |
ソースコード
#include <iostream> #include <vector> #include <cmath> #include <map> #include <set> #include <iomanip> #include <queue> #include <algorithm> #include <numeric> #include <deque> #include <complex> #include <cassert> using namespace std; int main(){ int N, ans=1e9, cnt; string S, T; cin >> N >> S >> T; cnt = 0; for (int i=0; i<N; i++) if (S[i] != T[i]) cnt++; if (cnt % 2 == 0) ans = min(ans, cnt); reverse(S.begin(), S.end()); cnt = 0; for (int i=0; i<N; i++) if (S[i] != T[i]) cnt++; if (cnt % 2 == 1) ans = min(ans, cnt); cout << cnt << endl; return 0; }