結果
問題 | No.2209 Flip and Reverse |
ユーザー |
![]() |
提出日時 | 2023-02-12 00:18:12 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 97 ms / 2,000 ms |
コード長 | 289 bytes |
コンパイル時間 | 166 ms |
コンパイル使用メモリ | 82,192 KB |
実行使用メモリ | 82,304 KB |
最終ジャッジ日時 | 2024-07-08 10:13:28 |
合計ジャッジ時間 | 3,746 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
ソースコード
N = int(input())S = input()T = input()if S == T:print(0)exit()RS = S[::-1]cnt0 = 0cnt1 = 0for i in range(N):if S[i] != T[i]:cnt0 += 1if RS[i] != T[i]:cnt1 += 1ans = 10 ** 6 + 1if cnt0 % 2 == 0:ans = cnt0else:ans = cnt1print(ans)