結果

問題 No.610 区間賞(Section Award)
ユーザー titiatitia
提出日時 2024-01-02 07:06:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 475 ms / 2,000 ms
コード長 465 bytes
コンパイル時間 1,509 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 44,400 KB
最終ジャッジ日時 2024-01-02 07:07:01
合計ジャッジ時間 12,820 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
9,856 KB
testcase_01 AC 28 ms
9,856 KB
testcase_02 AC 27 ms
9,984 KB
testcase_03 AC 28 ms
9,856 KB
testcase_04 AC 27 ms
9,856 KB
testcase_05 AC 28 ms
9,856 KB
testcase_06 AC 28 ms
9,984 KB
testcase_07 AC 30 ms
9,856 KB
testcase_08 AC 29 ms
10,112 KB
testcase_09 AC 29 ms
9,984 KB
testcase_10 AC 29 ms
9,984 KB
testcase_11 AC 28 ms
9,984 KB
testcase_12 AC 28 ms
9,856 KB
testcase_13 AC 29 ms
10,112 KB
testcase_14 AC 28 ms
10,240 KB
testcase_15 AC 29 ms
9,984 KB
testcase_16 AC 27 ms
10,112 KB
testcase_17 AC 27 ms
9,984 KB
testcase_18 AC 27 ms
9,984 KB
testcase_19 AC 74 ms
16,512 KB
testcase_20 AC 393 ms
42,380 KB
testcase_21 AC 55 ms
14,208 KB
testcase_22 AC 237 ms
31,032 KB
testcase_23 AC 44 ms
12,544 KB
testcase_24 AC 76 ms
17,920 KB
testcase_25 AC 40 ms
11,648 KB
testcase_26 AC 134 ms
24,336 KB
testcase_27 AC 329 ms
41,944 KB
testcase_28 AC 273 ms
38,228 KB
testcase_29 AC 220 ms
29,476 KB
testcase_30 AC 256 ms
35,424 KB
testcase_31 AC 128 ms
22,964 KB
testcase_32 AC 292 ms
39,024 KB
testcase_33 AC 53 ms
14,336 KB
testcase_34 AC 320 ms
42,284 KB
testcase_35 AC 157 ms
25,068 KB
testcase_36 AC 305 ms
39,780 KB
testcase_37 AC 246 ms
35,668 KB
testcase_38 AC 70 ms
16,880 KB
testcase_39 AC 339 ms
43,252 KB
testcase_40 AC 347 ms
43,124 KB
testcase_41 AC 331 ms
43,252 KB
testcase_42 AC 327 ms
43,124 KB
testcase_43 AC 353 ms
43,124 KB
testcase_44 AC 383 ms
37,776 KB
testcase_45 AC 439 ms
43,948 KB
testcase_46 AC 475 ms
44,400 KB
testcase_47 AC 264 ms
36,304 KB
testcase_48 AC 241 ms
35,392 KB
testcase_49 AC 268 ms
36,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

A_INV=[0]*N
B_INV=[0]*N

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

E=[[] for i in range(N)]

for i in range(N):
    E[A_INV[i]].append((B_INV[i],i+1))

ANS=[]
MAX=N+1000

for i in range(N-1,-1,-1):
    now,plus=E[i][0]

    if now<MAX:
        ANS.append(plus)
        MAX=min(MAX,now)

for ans in sorted(ANS):
    print(ans)
0