結果
問題 | No.2209 Flip and Reverse |
ユーザー | deepjuggling |
提出日時 | 2023-02-10 22:35:44 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 223 ms / 2,000 ms |
コード長 | 353 bytes |
コンパイル時間 | 145 ms |
コンパイル使用メモリ | 82,440 KB |
実行使用メモリ | 174,292 KB |
最終ジャッジ日時 | 2024-07-07 16:41:14 |
合計ジャッジ時間 | 6,253 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
ソースコード
n = int(input()) s = input() t = input() s = list(s) t = list(t) ss = list(s) ss.reverse() mae = 0 usi = 0 for i in range(n): if s[i] != t[i]: mae += 1 if ss[i] != t[i]: usi += 1 if mae <= usi and mae % 2 == 0: print(mae) elif usi <= mae and usi % 2 == 1: print(usi) elif mae % 2 == 0: print(mae) else: print(usi)