結果
問題 |
No.2209 Flip and Reverse
|
ユーザー |
![]() |
提出日時 | 2023-02-10 21:57:39 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 197 ms / 2,000 ms |
コード長 | 294 bytes |
コンパイル時間 | 445 ms |
コンパイル使用メモリ | 82,228 KB |
実行使用メモリ | 144,276 KB |
最終ジャッジ日時 | 2024-07-07 16:12:50 |
合計ジャッジ時間 | 5,758 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
ソースコード
import sys input = sys.stdin.readline N=int(input()) S=list(map(int,input().strip())) T=list(map(int,input().strip())) INF=10**9 ans=INF x=0 for s,t in zip(S,T): if s!=t:x+=1 if x%2==0: ans = x x=0 for s,t in zip(S[::-1],T): if s!=t:x+=1 if x%2==1: ans = min(ans, x) print(ans)