結果

問題 No.610 区間賞(Section Award)
ユーザー lloyzlloyz
提出日時 2023-05-09 00:04:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 421 bytes
コンパイル時間 711 ms
コンパイル使用メモリ 86,804 KB
実行使用メモリ 103,740 KB
最終ジャッジ日時 2023-08-16 22:18:40
合計ジャッジ時間 9,213 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,048 KB
testcase_01 AC 73 ms
71,228 KB
testcase_02 AC 73 ms
71,068 KB
testcase_03 AC 73 ms
71,172 KB
testcase_04 AC 71 ms
71,256 KB
testcase_05 AC 72 ms
71,080 KB
testcase_06 AC 75 ms
75,496 KB
testcase_07 AC 73 ms
71,316 KB
testcase_08 AC 78 ms
75,504 KB
testcase_09 AC 74 ms
71,368 KB
testcase_10 AC 77 ms
75,492 KB
testcase_11 AC 76 ms
75,728 KB
testcase_12 AC 72 ms
71,092 KB
testcase_13 AC 76 ms
75,644 KB
testcase_14 AC 77 ms
75,732 KB
testcase_15 AC 76 ms
75,600 KB
testcase_16 AC 76 ms
75,900 KB
testcase_17 AC 76 ms
75,436 KB
testcase_18 AC 73 ms
71,308 KB
testcase_19 AC 88 ms
78,508 KB
testcase_20 AC 124 ms
100,228 KB
testcase_21 AC 86 ms
76,512 KB
testcase_22 AC 108 ms
95,284 KB
testcase_23 AC 83 ms
76,360 KB
testcase_24 AC 90 ms
79,360 KB
testcase_25 AC 84 ms
76,356 KB
testcase_26 AC 98 ms
86,464 KB
testcase_27 AC 122 ms
100,028 KB
testcase_28 AC 121 ms
101,720 KB
testcase_29 AC 104 ms
92,588 KB
testcase_30 AC 117 ms
98,504 KB
testcase_31 AC 96 ms
86,056 KB
testcase_32 AC 120 ms
100,788 KB
testcase_33 AC 86 ms
76,372 KB
testcase_34 AC 122 ms
100,324 KB
testcase_35 AC 99 ms
88,024 KB
testcase_36 AC 123 ms
103,740 KB
testcase_37 AC 115 ms
98,340 KB
testcase_38 AC 89 ms
78,528 KB
testcase_39 AC 124 ms
100,608 KB
testcase_40 AC 124 ms
100,672 KB
testcase_41 AC 125 ms
100,636 KB
testcase_42 AC 123 ms
100,784 KB
testcase_43 AC 124 ms
100,808 KB
testcase_44 AC 146 ms
98,856 KB
testcase_45 AC 162 ms
100,416 KB
testcase_46 AC 163 ms
100,436 KB
testcase_47 AC 119 ms
101,552 KB
testcase_48 AC 113 ms
98,296 KB
testcase_49 AC 118 ms
101,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

Price = [-1 for _ in range(n)]
for i in range(n):
    Price[B[i] - 1] = i
ANS = []
P = [False for _ in range(n)]
idx = 0
for i in range(n):
    a = A[i] - 1
    f = i
    l = Price[a]
    P[l] = True
    if idx == l:
        ANS.append(a + 1)
        while idx < n and P[idx]:
            idx += 1
ANS.sort()
print(*ANS, sep='\n')
0