結果

問題 No.610 区間賞(Section Award)
ユーザー Ryuto
提出日時 2017-12-12 21:20:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 154 ms / 2,000 ms
コード長 403 bytes
コンパイル時間 231 ms
コンパイル使用メモリ 82,108 KB
実行使用メモリ 116,948 KB
最終ジャッジ日時 2024-12-14 06:25:23
合計ジャッジ時間 6,442 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python

n = int(input().strip())
sorder1 = [int(x) for x in input().split()]
sorder = {y: x for x, y in enumerate(sorder1)}
forder = [int(x) for x in input().split()]

ans = []
exc = set()
for i, j in enumerate(forder):
    tmp = sorder[j]
    if i <= tmp and j not in exc:
        ans.append(j)
        for k in sorder1[i:tmp]:
            exc.add(k)

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