結果
問題 |
No.2209 Flip and Reverse
|
ユーザー |
![]() |
提出日時 | 2023-02-10 21:26:27 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 498 bytes |
コンパイル時間 | 223 ms |
コンパイル使用メモリ | 82,368 KB |
実行使用メモリ | 80,716 KB |
最終ジャッジ日時 | 2024-07-07 15:35:22 |
合計ジャッジ時間 | 4,572 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 17 WA * 13 |
ソースコード
mod = 998244353 def main(): import sys input = sys.stdin.readline N = int(input()) S = input().rstrip('\n') T = input().rstrip('\n') ans = 0 for s, t in zip(S, T): if s != t: ans += 1 if ans & 1: ans += 1 ans2 = 0 for s, t in zip(S, T[::-1]): if s != t: ans2 += 1 if ans2 == 0: ans2 += 1 if ans2 & 1 == 0: ans2 += 1 print(min(ans, ans2)) if __name__ == '__main__': main()