結果

問題 No.318 学学学学学
ユーザー nebukuro09nebukuro09
提出日時 2016-10-31 09:59:26
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 256 ms / 2,000 ms
コード長 288 bytes
コンパイル時間 1,414 ms
コンパイル使用メモリ 77,732 KB
実行使用メモリ 106,016 KB
最終ジャッジ日時 2023-09-04 20:34:44
合計ジャッジ時間 8,226 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 150 ms
81,532 KB
testcase_01 AC 162 ms
83,012 KB
testcase_02 AC 159 ms
84,040 KB
testcase_03 AC 173 ms
82,540 KB
testcase_04 AC 181 ms
83,968 KB
testcase_05 AC 256 ms
106,016 KB
testcase_06 AC 207 ms
97,428 KB
testcase_07 AC 207 ms
93,880 KB
testcase_08 AC 198 ms
92,128 KB
testcase_09 AC 185 ms
89,980 KB
testcase_10 AC 166 ms
89,568 KB
testcase_11 AC 232 ms
105,720 KB
testcase_12 AC 220 ms
97,332 KB
testcase_13 AC 199 ms
94,588 KB
testcase_14 AC 198 ms
92,084 KB
testcase_15 AC 192 ms
90,456 KB
testcase_16 AC 191 ms
89,676 KB
testcase_17 AC 208 ms
96,264 KB
testcase_18 AC 185 ms
96,540 KB
testcase_19 AC 138 ms
100,764 KB
testcase_20 AC 172 ms
88,072 KB
testcase_21 AC 80 ms
77,808 KB
testcase_22 AC 78 ms
78,284 KB
testcase_23 AC 78 ms
78,096 KB
testcase_24 AC 76 ms
77,984 KB
testcase_25 AC 77 ms
77,876 KB
testcase_26 AC 76 ms
78,152 KB
testcase_27 AC 77 ms
77,800 KB
testcase_28 AC 78 ms
78,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq

N = input()
A = map(int, raw_input().split())
R = {}

for i, a in enumerate(A):
    R[a] = i

q = []
B = [0 for _ in xrange(N)]
for i, a in enumerate(A):
    heapq.heappush(q, -a)
    while R[-q[0]] < i:
        heapq.heappop(q)
    B[i] = -q[0]
print ' '.join(map(str, B))
0