結果

問題 No.610 区間賞(Section Award)
ユーザー H3PO4H3PO4
提出日時 2020-10-10 09:01:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 189 ms / 2,000 ms
コード長 297 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 10,708 KB
実行使用メモリ 33,560 KB
最終ジャッジ日時 2023-09-27 21:08:28
合計ジャッジ時間 7,333 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
8,060 KB
testcase_01 AC 13 ms
7,996 KB
testcase_02 AC 13 ms
7,936 KB
testcase_03 AC 17 ms
7,988 KB
testcase_04 AC 13 ms
7,992 KB
testcase_05 AC 14 ms
7,912 KB
testcase_06 AC 15 ms
8,300 KB
testcase_07 AC 13 ms
7,988 KB
testcase_08 AC 14 ms
8,476 KB
testcase_09 AC 14 ms
8,020 KB
testcase_10 AC 14 ms
8,388 KB
testcase_11 AC 14 ms
8,336 KB
testcase_12 AC 14 ms
8,032 KB
testcase_13 AC 13 ms
8,432 KB
testcase_14 AC 14 ms
8,456 KB
testcase_15 AC 14 ms
8,288 KB
testcase_16 AC 13 ms
8,036 KB
testcase_17 AC 14 ms
8,080 KB
testcase_18 AC 14 ms
8,012 KB
testcase_19 AC 29 ms
12,312 KB
testcase_20 AC 96 ms
32,600 KB
testcase_21 AC 25 ms
11,212 KB
testcase_22 AC 65 ms
22,764 KB
testcase_23 AC 21 ms
9,884 KB
testcase_24 AC 34 ms
14,280 KB
testcase_25 AC 19 ms
9,568 KB
testcase_26 AC 50 ms
20,204 KB
testcase_27 AC 99 ms
32,728 KB
testcase_28 AC 81 ms
26,068 KB
testcase_29 AC 66 ms
21,884 KB
testcase_30 AC 77 ms
25,176 KB
testcase_31 AC 47 ms
16,924 KB
testcase_32 AC 89 ms
32,524 KB
testcase_33 AC 24 ms
11,148 KB
testcase_34 AC 96 ms
33,400 KB
testcase_35 AC 51 ms
19,952 KB
testcase_36 AC 92 ms
32,940 KB
testcase_37 AC 77 ms
25,536 KB
testcase_38 AC 30 ms
12,716 KB
testcase_39 AC 98 ms
33,364 KB
testcase_40 AC 100 ms
33,492 KB
testcase_41 AC 96 ms
33,368 KB
testcase_42 AC 96 ms
33,508 KB
testcase_43 AC 103 ms
33,560 KB
testcase_44 AC 152 ms
25,488 KB
testcase_45 AC 188 ms
33,324 KB
testcase_46 AC 189 ms
32,972 KB
testcase_47 AC 79 ms
25,772 KB
testcase_48 AC 74 ms
24,416 KB
testcase_49 AC 81 ms
25,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq

N = int(input())
A = tuple(map(int, input().split()))
B = map(int, input().split())
B_idx = {x: i for i, x in enumerate(B)}

h = [N + 1]
ans = []
for a in reversed(A):
    if B_idx[a] < h[0]:
        ans.append(a)
        heapq.heappush(h, B_idx[a])
ans.sort()
print(*ans, sep='\n')
0