結果

問題 No.610 区間賞(Section Award)
ユーザー rlangevinrlangevin
提出日時 2023-11-19 01:55:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 394 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 104,536 KB
最終ジャッジ日時 2023-11-19 01:55:20
合計ジャッジ時間 11,674 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,460 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 AC 36 ms
53,460 KB
testcase_03 AC 37 ms
53,460 KB
testcase_04 AC 37 ms
53,460 KB
testcase_05 AC 37 ms
53,460 KB
testcase_06 AC 40 ms
59,460 KB
testcase_07 AC 37 ms
53,460 KB
testcase_08 AC 42 ms
59,444 KB
testcase_09 AC 37 ms
53,460 KB
testcase_10 AC 41 ms
59,452 KB
testcase_11 AC 42 ms
59,452 KB
testcase_12 AC 37 ms
53,460 KB
testcase_13 AC 41 ms
59,444 KB
testcase_14 AC 42 ms
59,444 KB
testcase_15 AC 42 ms
59,460 KB
testcase_16 AC 41 ms
59,460 KB
testcase_17 AC 41 ms
59,464 KB
testcase_18 AC 38 ms
53,460 KB
testcase_19 AC 86 ms
72,976 KB
testcase_20 AC 305 ms
104,432 KB
testcase_21 AC 70 ms
68,388 KB
testcase_22 AC 218 ms
97,156 KB
testcase_23 AC 59 ms
66,340 KB
testcase_24 AC 95 ms
76,168 KB
testcase_25 AC 54 ms
64,292 KB
testcase_26 AC 170 ms
92,576 KB
testcase_27 AC 295 ms
104,260 KB
testcase_28 AC 267 ms
101,360 KB
testcase_29 AC 206 ms
95,664 KB
testcase_30 AC 248 ms
98,620 KB
testcase_31 AC 140 ms
86,160 KB
testcase_32 AC 279 ms
101,276 KB
testcase_33 AC 69 ms
68,388 KB
testcase_34 AC 300 ms
104,476 KB
testcase_35 AC 169 ms
94,060 KB
testcase_36 AC 290 ms
104,392 KB
testcase_37 AC 251 ms
98,580 KB
testcase_38 AC 89 ms
73,008 KB
testcase_39 AC 305 ms
104,536 KB
testcase_40 AC 302 ms
104,536 KB
testcase_41 AC 303 ms
104,536 KB
testcase_42 AC 302 ms
104,536 KB
testcase_43 AC 301 ms
104,536 KB
testcase_44 AC 306 ms
98,552 KB
testcase_45 AC 394 ms
104,468 KB
testcase_46 AC 372 ms
104,472 KB
testcase_47 AC 258 ms
101,324 KB
testcase_48 AC 243 ms
98,544 KB
testcase_49 AC 261 ms
101,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
DA, DB = [0] * N, [0] * N
for i in range(N):
    DA[A[i] - 1] = i
    DB[B[i] - 1] = i

D = []    
for i in range(N):
    D.append((DA[i], DB[i], i + 1))
    
D.sort()
ans = []
mi = 10 ** 18
for i in range(N - 1, -1, -1):
    if D[i][1] <= mi:
        ans.append(D[i][2])
        mi = D[i][1]  
        
ans.sort()
for a in ans:
    print(a)
0