結果
| 問題 |
No.2209 Flip and Reverse
|
| コンテスト | |
| ユーザー |
vwxyz
|
| 提出日時 | 2024-08-15 12:12:28 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 478 ms / 2,000 ms |
| コード長 | 248 bytes |
| コンパイル時間 | 284 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 39,224 KB |
| 最終ジャッジ日時 | 2024-08-15 12:12:42 |
| 合計ジャッジ時間 | 12,214 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
N=int(input())
S=list(map(int,list(input())))
T=list(map(int,list(input())))
cnt0=sum(s^t for s,t in zip(S,T))
cnt1=sum(s^t for s,t in zip(S[::-1],T))
inf=1<<30
ans=inf
if cnt0%2==0:
ans=min(ans,cnt0)
if cnt1%2:
ans=min(ans,cnt1)
print(ans)
vwxyz