結果
| 問題 |
No.1922 Separate and Attach
|
| ユーザー |
|
| 提出日時 | 2023-01-10 21:34:21 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 344 bytes |
| コンパイル時間 | 502 ms |
| コンパイル使用メモリ | 82,348 KB |
| 実行使用メモリ | 112,924 KB |
| 最終ジャッジ日時 | 2024-12-21 12:29:26 |
| 合計ジャッジ時間 | 5,541 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)