結果
| 問題 | No.1922 Separate and Attach |
| ユーザー |
|
| 提出日時 | 2023-01-10 22:06:43 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 344 bytes |
| 記録 | |
| コンパイル時間 | 225 ms |
| コンパイル使用メモリ | 84,480 KB |
| 実行使用メモリ | 136,492 KB |
| 最終ジャッジ日時 | 2026-05-28 04:48:09 |
| 合計ジャッジ時間 | 5,776 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 WA * 21 |
ソースコード
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = {a:i for i,a in enumerate(A)}
B = [C[b] for b in B]
now = set()
#print(B)
for b in B:
if b-1 in now:
now.add(b)
now.remove(b-1)
else:
now.add(b)
n = len(now)
ans = 0
while n>1:
n = (n+1)//2
ans += 1
print(ans)