結果

問題 No.318 学学学学学
ユーザー pluto77pluto77
提出日時 2018-02-09 11:43:46
言語 Python2
(2.7.18)
結果
AC  
実行時間 761 ms / 2,000 ms
コード長 282 bytes
コンパイル時間 928 ms
コンパイル使用メモリ 6,504 KB
実行使用メモリ 21,748 KB
最終ジャッジ日時 2023-09-04 21:03:25
合計ジャッジ時間 11,557 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
7,532 KB
testcase_01 AC 69 ms
8,220 KB
testcase_02 AC 84 ms
8,548 KB
testcase_03 AC 57 ms
8,016 KB
testcase_04 AC 73 ms
8,452 KB
testcase_05 AC 665 ms
21,748 KB
testcase_06 AC 496 ms
19,856 KB
testcase_07 AC 614 ms
19,868 KB
testcase_08 AC 570 ms
17,116 KB
testcase_09 AC 451 ms
17,068 KB
testcase_10 AC 332 ms
16,056 KB
testcase_11 AC 559 ms
21,504 KB
testcase_12 AC 578 ms
16,948 KB
testcase_13 AC 406 ms
16,416 KB
testcase_14 AC 438 ms
14,616 KB
testcase_15 AC 412 ms
14,684 KB
testcase_16 AC 450 ms
14,676 KB
testcase_17 AC 761 ms
17,012 KB
testcase_18 AC 555 ms
18,480 KB
testcase_19 AC 200 ms
19,832 KB
testcase_20 AC 357 ms
13,640 KB
testcase_21 AC 12 ms
6,236 KB
testcase_22 AC 12 ms
6,108 KB
testcase_23 AC 12 ms
6,288 KB
testcase_24 AC 12 ms
6,232 KB
testcase_25 AC 12 ms
6,112 KB
testcase_26 AC 12 ms
6,112 KB
testcase_27 AC 12 ms
6,084 KB
testcase_28 AC 12 ms
6,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki318
import heapq

n=int(raw_input())
a=map(int,raw_input().split())
d={}
b=[0 for i in xrange(n)]
for i,v in enumerate(a):
 d[v]=i
q=[]
for i,v in enumerate(a):
 heapq.heappush(q,-v)
 while d[-q[0]]<i:
  heapq.heappop(q)
 b[i]=-q[0]
for i in xrange(len(b)):
 print b[i],
print
0