結果

問題 No.610 区間賞(Section Award)
ユーザー roaris
提出日時 2019-12-17 23:41:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 251 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 103,836 KB
最終ジャッジ日時 2024-07-04 23:45:50
合計ジャッジ時間 5,963 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = [True]*(1+N)
j = 0

for i in range(N):
    if not ans[B[i]]:
        continue
    
    while A[j]!=B[i]:
        ans[A[j]] = False
        j += 1
    
    j += 1
    
for i in range(1, N+1):
    if ans[i]:
        print(i)
0