結果

問題 No.1922 Separate and Attach
ユーザー ytftytft
提出日時 2022-05-07 00:35:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 415 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 102,092 KB
最終ジャッジ日時 2023-09-20 08:35:09
合計ジャッジ時間 10,268 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,068 KB
testcase_01 AC 77 ms
71,132 KB
testcase_02 AC 78 ms
71,184 KB
testcase_03 AC 77 ms
71,416 KB
testcase_04 AC 77 ms
71,304 KB
testcase_05 AC 79 ms
71,212 KB
testcase_06 AC 79 ms
71,188 KB
testcase_07 AC 79 ms
71,284 KB
testcase_08 AC 77 ms
71,172 KB
testcase_09 AC 79 ms
70,952 KB
testcase_10 AC 78 ms
71,388 KB
testcase_11 AC 77 ms
71,216 KB
testcase_12 AC 80 ms
71,048 KB
testcase_13 AC 79 ms
70,948 KB
testcase_14 AC 80 ms
71,236 KB
testcase_15 AC 79 ms
71,172 KB
testcase_16 AC 78 ms
71,212 KB
testcase_17 AC 77 ms
71,068 KB
testcase_18 AC 78 ms
71,180 KB
testcase_19 AC 78 ms
71,252 KB
testcase_20 AC 79 ms
71,416 KB
testcase_21 AC 77 ms
71,232 KB
testcase_22 AC 80 ms
71,336 KB
testcase_23 AC 79 ms
71,304 KB
testcase_24 AC 79 ms
71,208 KB
testcase_25 AC 77 ms
71,288 KB
testcase_26 AC 82 ms
71,052 KB
testcase_27 AC 85 ms
75,640 KB
testcase_28 AC 91 ms
76,128 KB
testcase_29 AC 88 ms
76,364 KB
testcase_30 AC 110 ms
94,596 KB
testcase_31 AC 108 ms
94,568 KB
testcase_32 AC 123 ms
101,976 KB
testcase_33 AC 123 ms
101,764 KB
testcase_34 AC 121 ms
101,936 KB
testcase_35 AC 120 ms
101,788 KB
testcase_36 AC 123 ms
101,788 KB
testcase_37 AC 124 ms
101,808 KB
testcase_38 AC 124 ms
101,904 KB
testcase_39 AC 123 ms
101,804 KB
testcase_40 AC 121 ms
101,900 KB
testcase_41 AC 124 ms
101,944 KB
testcase_42 AC 119 ms
101,940 KB
testcase_43 AC 122 ms
102,092 KB
testcase_44 AC 129 ms
101,712 KB
testcase_45 AC 125 ms
102,088 KB
testcase_46 AC 122 ms
101,912 KB
testcase_47 AC 122 ms
101,912 KB
testcase_48 AC 120 ms
101,832 KB
testcase_49 AC 130 ms
101,816 KB
testcase_50 AC 127 ms
101,752 KB
testcase_51 AC 120 ms
101,760 KB
testcase_52 AC 77 ms
71,236 KB
testcase_53 AC 77 ms
71,300 KB
testcase_54 AC 77 ms
70,948 KB
testcase_55 AC 77 ms
71,216 KB
testcase_56 AC 76 ms
71,136 KB
testcase_57 AC 79 ms
71,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
pos=[0 for i in range(N)]
for i in range(N):
    pos[A[i]-1]=i
B=list(map(int,input().split()))
prev=-1
chunk=0
ans=0
for i in B:
    if prev>pos[i-1]:
        chunk+=1
    prev=pos[i-1]
while chunk>0:
	ans+=1
	chunk//=2
print(ans)
0