結果

問題 No.318 学学学学学
ユーザー mkawa2mkawa2
提出日時 2020-02-09 15:47:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 967 bytes
コンパイル時間 460 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 21,276 KB
最終ジャッジ日時 2024-04-08 12:18:43
合計ジャッジ時間 5,744 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 146 ms
21,276 KB
testcase_08 AC 143 ms
21,276 KB
testcase_09 AC 141 ms
21,276 KB
testcase_10 AC 142 ms
21,276 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 141 ms
20,944 KB
testcase_18 WA -
testcase_19 AC 138 ms
20,944 KB
testcase_20 WA -
testcase_21 AC 33 ms
10,112 KB
testcase_22 AC 32 ms
10,112 KB
testcase_23 AC 33 ms
10,112 KB
testcase_24 AC 32 ms
10,112 KB
testcase_25 AC 33 ms
10,112 KB
testcase_26 AC 32 ms
10,112 KB
testcase_27 AC 32 ms
10,112 KB
testcase_28 AC 32 ms
10,112 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()
    bl=[0]*n
    br=[0]*n
    mx=aa[0]
    for i in range(n):
        if aa[i]>mx:mx=aa[i]
        bl[i]=mx
    mx=aa[n-1]
    for i in range(n-1,-1,-1):
        if aa[i]>mx:mx=aa[i]
        br[i]=mx
    #print(bl)
    #print(br)
    ans=[0]*n
    for i in range(n):
        ans[i]=min(bl[i],br[i])
    print(*ans)



main()
0