結果

問題 No.1922 Separate and Attach
ユーザー titiatitia
提出日時 2023-05-23 01:32:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 393 bytes
コンパイル時間 122 ms
コンパイル使用メモリ 10,908 KB
実行使用メモリ 34,068 KB
最終ジャッジ日時 2023-08-24 05:04:34
合計ジャッジ時間 8,741 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,804 KB
testcase_01 AC 15 ms
7,860 KB
testcase_02 AC 14 ms
7,808 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 15 ms
7,912 KB
testcase_07 AC 14 ms
7,948 KB
testcase_08 WA -
testcase_09 AC 15 ms
7,864 KB
testcase_10 WA -
testcase_11 AC 15 ms
7,860 KB
testcase_12 WA -
testcase_13 AC 16 ms
8,304 KB
testcase_14 WA -
testcase_15 AC 16 ms
7,808 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 16 ms
7,820 KB
testcase_19 AC 16 ms
7,912 KB
testcase_20 AC 16 ms
7,856 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 14 ms
7,912 KB
testcase_26 AC 15 ms
7,820 KB
testcase_27 AC 16 ms
8,224 KB
testcase_28 AC 17 ms
8,608 KB
testcase_29 AC 42 ms
11,884 KB
testcase_30 AC 124 ms
24,960 KB
testcase_31 AC 112 ms
24,988 KB
testcase_32 AC 180 ms
33,948 KB
testcase_33 AC 213 ms
33,852 KB
testcase_34 AC 195 ms
33,856 KB
testcase_35 AC 213 ms
33,940 KB
testcase_36 AC 211 ms
33,856 KB
testcase_37 AC 218 ms
33,952 KB
testcase_38 AC 247 ms
34,012 KB
testcase_39 AC 243 ms
33,948 KB
testcase_40 AC 250 ms
33,868 KB
testcase_41 AC 235 ms
34,068 KB
testcase_42 AC 177 ms
33,864 KB
testcase_43 AC 169 ms
33,860 KB
testcase_44 AC 196 ms
33,872 KB
testcase_45 AC 202 ms
33,880 KB
testcase_46 AC 242 ms
33,864 KB
testcase_47 AC 194 ms
33,968 KB
testcase_48 AC 72 ms
23,100 KB
testcase_49 AC 216 ms
33,976 KB
testcase_50 WA -
testcase_51 AC 230 ms
34,040 KB
testcase_52 AC 16 ms
8,256 KB
testcase_53 AC 14 ms
8,320 KB
testcase_54 WA -
testcase_55 AC 15 ms
7,868 KB
testcase_56 AC 15 ms
8,144 KB
testcase_57 AC 15 ms
7,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
P=list(map(int,input().split()))
Q=list(map(int,input().split()))

if P==Q:
    print(0)
    exit()

A=[(P[i],i) for i in range(N)]
A.sort()

B=[-1]*N
for i in range(N):
    B[A[Q[i]-1][1]]=i+1

B_INV=[-1]*N
for i in range(N):
    B_INV[B[i]-1]=i

block=1
for i in range(N-1):
    if B_INV[i]>B_INV[i+1]:
        block+=1

ANS=0
while block:
    ANS+=1
    block//=2

print(ANS)
0