結果

問題 No.318 学学学学学
ユーザー mkawa2mkawa2
提出日時 2020-02-09 20:49:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 355 ms / 2,000 ms
コード長 871 bytes
コンパイル時間 122 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 28,696 KB
最終ジャッジ日時 2024-04-08 12:31:45
合計ジャッジ時間 6,518 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
11,520 KB
testcase_01 AC 66 ms
13,396 KB
testcase_02 AC 63 ms
13,492 KB
testcase_03 AC 49 ms
12,672 KB
testcase_04 AC 62 ms
13,496 KB
testcase_05 AC 284 ms
28,696 KB
testcase_06 AC 355 ms
27,108 KB
testcase_07 AC 303 ms
25,316 KB
testcase_08 AC 300 ms
24,040 KB
testcase_09 AC 279 ms
23,908 KB
testcase_10 AC 274 ms
22,884 KB
testcase_11 AC 264 ms
28,052 KB
testcase_12 AC 228 ms
24,292 KB
testcase_13 AC 194 ms
22,120 KB
testcase_14 AC 200 ms
21,256 KB
testcase_15 AC 192 ms
21,256 KB
testcase_16 AC 202 ms
21,256 KB
testcase_17 AC 234 ms
23,880 KB
testcase_18 AC 190 ms
23,828 KB
testcase_19 AC 230 ms
26,952 KB
testcase_20 AC 229 ms
20,516 KB
testcase_21 AC 33 ms
10,240 KB
testcase_22 AC 40 ms
10,240 KB
testcase_23 AC 36 ms
10,240 KB
testcase_24 AC 36 ms
10,240 KB
testcase_25 AC 36 ms
10,240 KB
testcase_26 AC 35 ms
10,240 KB
testcase_27 AC 35 ms
10,240 KB
testcase_28 AC 35 ms
10,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 6)
from bisect import *
from collections import *
from heapq import *

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def SI(): return sys.stdin.readline()[:-1]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
int1 = lambda x: int(x) - 1
def MI1(): return map(int1, sys.stdin.readline().split())
def LI1(): return list(map(int1, sys.stdin.readline().split()))
p2D = lambda x: print(*x, sep="\n")
dij = [(0, 1), (1, 0), (0, -1), (-1, 0)]

def main():
    n=II()
    aa=LI()
    r=defaultdict(int)
    hp=[]
    for i,a in enumerate(aa):r[a]=i
    ans=[0]*n
    for i,a in enumerate(aa):
        heappush(hp,-a)
        ans[i]=-hp[0]
        while hp and r[-hp[0]]<=i:heappop(hp)
    print(*ans)

main()
0