結果

問題 No.610 区間賞(Section Award)
ユーザー lloyzlloyz
提出日時 2023-05-09 00:04:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 421 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 82,668 KB
実行使用メモリ 105,088 KB
最終ジャッジ日時 2024-05-04 05:39:58
合計ジャッジ時間 6,073 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,876 KB
testcase_01 AC 35 ms
52,884 KB
testcase_02 AC 35 ms
53,256 KB
testcase_03 AC 34 ms
52,620 KB
testcase_04 AC 35 ms
52,616 KB
testcase_05 AC 37 ms
53,692 KB
testcase_06 AC 40 ms
58,916 KB
testcase_07 AC 37 ms
52,416 KB
testcase_08 AC 40 ms
59,216 KB
testcase_09 AC 39 ms
54,040 KB
testcase_10 AC 39 ms
59,028 KB
testcase_11 AC 37 ms
58,892 KB
testcase_12 AC 35 ms
53,376 KB
testcase_13 AC 37 ms
59,336 KB
testcase_14 AC 38 ms
59,304 KB
testcase_15 AC 43 ms
59,972 KB
testcase_16 AC 39 ms
58,036 KB
testcase_17 AC 39 ms
59,260 KB
testcase_18 AC 36 ms
53,428 KB
testcase_19 AC 52 ms
71,276 KB
testcase_20 AC 91 ms
104,972 KB
testcase_21 AC 50 ms
67,436 KB
testcase_22 AC 71 ms
91,464 KB
testcase_23 AC 47 ms
66,008 KB
testcase_24 AC 52 ms
72,048 KB
testcase_25 AC 46 ms
64,460 KB
testcase_26 AC 63 ms
80,756 KB
testcase_27 AC 84 ms
104,488 KB
testcase_28 AC 77 ms
99,700 KB
testcase_29 AC 67 ms
89,204 KB
testcase_30 AC 77 ms
95,904 KB
testcase_31 AC 61 ms
80,704 KB
testcase_32 AC 83 ms
101,164 KB
testcase_33 AC 47 ms
68,344 KB
testcase_34 AC 88 ms
104,640 KB
testcase_35 AC 63 ms
82,572 KB
testcase_36 AC 91 ms
104,388 KB
testcase_37 AC 74 ms
95,540 KB
testcase_38 AC 50 ms
71,548 KB
testcase_39 AC 88 ms
104,860 KB
testcase_40 AC 88 ms
104,608 KB
testcase_41 AC 94 ms
104,724 KB
testcase_42 AC 93 ms
104,504 KB
testcase_43 AC 92 ms
104,536 KB
testcase_44 AC 113 ms
102,472 KB
testcase_45 AC 119 ms
104,664 KB
testcase_46 AC 119 ms
105,088 KB
testcase_47 AC 76 ms
98,244 KB
testcase_48 AC 73 ms
95,140 KB
testcase_49 AC 76 ms
98,596 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