結果
問題 | No.610 区間賞(Section Award) |
ユーザー |
|
提出日時 | 2020-10-10 09:01:14 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 235 ms / 2,000 ms |
コード長 | 297 bytes |
コンパイル時間 | 103 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 34,468 KB |
最終ジャッジ日時 | 2024-07-20 15:40:00 |
合計ジャッジ時間 | 6,859 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 50 |
ソースコード
import heapqN = 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')