結果

問題 No.610 区間賞(Section Award)
ユーザー maspymaspy
提出日時 2020-03-04 10:00:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 204 ms / 2,000 ms
コード長 510 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 33,296 KB
最終ジャッジ日時 2024-04-22 01:00:17
合計ジャッジ時間 6,858 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
10,752 KB
testcase_01 AC 34 ms
10,624 KB
testcase_02 AC 31 ms
10,624 KB
testcase_03 AC 31 ms
10,624 KB
testcase_04 AC 30 ms
10,624 KB
testcase_05 AC 30 ms
10,624 KB
testcase_06 AC 31 ms
10,880 KB
testcase_07 AC 30 ms
10,752 KB
testcase_08 AC 31 ms
10,880 KB
testcase_09 AC 31 ms
10,752 KB
testcase_10 AC 31 ms
10,752 KB
testcase_11 AC 31 ms
10,752 KB
testcase_12 AC 31 ms
10,752 KB
testcase_13 AC 32 ms
10,880 KB
testcase_14 AC 32 ms
11,008 KB
testcase_15 AC 32 ms
10,752 KB
testcase_16 AC 32 ms
10,752 KB
testcase_17 AC 31 ms
10,624 KB
testcase_18 AC 31 ms
10,752 KB
testcase_19 AC 51 ms
14,180 KB
testcase_20 AC 163 ms
30,348 KB
testcase_21 AC 45 ms
13,568 KB
testcase_22 AC 113 ms
23,436 KB
testcase_23 AC 39 ms
12,416 KB
testcase_24 AC 57 ms
15,820 KB
testcase_25 AC 36 ms
12,032 KB
testcase_26 AC 86 ms
21,160 KB
testcase_27 AC 160 ms
30,480 KB
testcase_28 AC 144 ms
25,492 KB
testcase_29 AC 110 ms
22,760 KB
testcase_30 AC 135 ms
25,332 KB
testcase_31 AC 78 ms
18,136 KB
testcase_32 AC 156 ms
29,472 KB
testcase_33 AC 44 ms
13,312 KB
testcase_34 AC 165 ms
30,396 KB
testcase_35 AC 91 ms
21,092 KB
testcase_36 AC 157 ms
29,608 KB
testcase_37 AC 131 ms
23,480 KB
testcase_38 AC 54 ms
14,464 KB
testcase_39 AC 164 ms
30,256 KB
testcase_40 AC 160 ms
30,480 KB
testcase_41 AC 163 ms
30,444 KB
testcase_42 AC 165 ms
30,400 KB
testcase_43 AC 163 ms
30,352 KB
testcase_44 AC 167 ms
27,716 KB
testcase_45 AC 204 ms
33,160 KB
testcase_46 AC 201 ms
33,296 KB
testcase_47 AC 138 ms
25,264 KB
testcase_48 AC 139 ms
23,248 KB
testcase_49 AC 135 ms
25,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# %%
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


# %%
N = int(readline())
A = list(map(int, readline().split()))
B = list(map(int, readline().split()))


# %%
start_rank = {x: i for i, x in enumerate(A)}
max_start_rank = -1
answer = []
for b in B:
    rank = start_rank[b]
    if rank > max_start_rank:
        answer.append(b)
        max_start_rank = rank

# %%
answer.sort()
print('\n'.join(map(str, answer)))
0