結果

問題 No.489 株に挑戦
ユーザー mkawa2mkawa2
提出日時 2020-05-16 16:19:01
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 681 bytes
コンパイル時間 382 ms
コンパイル使用メモリ 11,884 KB
実行使用メモリ 17,840 KB
最終ジャッジ日時 2023-10-23 18:03:17
合計ジャッジ時間 3,739 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
10,132 KB
testcase_01 AC 64 ms
10,132 KB
testcase_02 AC 29 ms
10,116 KB
testcase_03 AC 29 ms
10,116 KB
testcase_04 AC 29 ms
10,116 KB
testcase_05 AC 28 ms
10,116 KB
testcase_06 AC 29 ms
10,116 KB
testcase_07 AC 29 ms
10,116 KB
testcase_08 AC 28 ms
10,116 KB
testcase_09 AC 29 ms
10,116 KB
testcase_10 AC 29 ms
10,116 KB
testcase_11 AC 28 ms
10,116 KB
testcase_12 AC 29 ms
10,116 KB
testcase_13 AC 28 ms
10,116 KB
testcase_14 AC 28 ms
10,116 KB
testcase_15 AC 31 ms
10,132 KB
testcase_16 AC 87 ms
10,132 KB
testcase_17 AC 37 ms
10,132 KB
testcase_18 AC 63 ms
10,132 KB
testcase_19 AC 55 ms
10,132 KB
testcase_20 AC 89 ms
10,132 KB
testcase_21 AC 44 ms
10,132 KB
testcase_22 AC 34 ms
10,132 KB
testcase_23 AC 67 ms
10,132 KB
testcase_24 AC 99 ms
10,132 KB
testcase_25 AC 29 ms
10,116 KB
testcase_26 AC 92 ms
10,132 KB
testcase_27 WA -
testcase_28 AC 28 ms
10,116 KB
testcase_29 AC 28 ms
10,116 KB
testcase_30 AC 99 ms
10,132 KB
testcase_31 AC 97 ms
17,840 KB
testcase_32 AC 66 ms
10,132 KB
testcase_33 AC 97 ms
10,132 KB
testcase_34 AC 86 ms
10,132 KB
testcase_35 AC 52 ms
10,132 KB
testcase_36 AC 38 ms
10,132 KB
testcase_37 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
import sys

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())

def main():
    ii=deque()
    xx=deque()
    n,d,k=MI()
    mx=0
    ai=aj=0
    for i in range(n):
        x=II()
        if i==0:
            ii.append(i)
            xx.append(x)
            continue
        if ii and ii[0]<i-d:
            ii.popleft()
            xx.popleft()
        cur=x-xx[0]
        if cur>mx:
            mx=cur
            ai=ii[0]
            aj=i
        while xx and xx[-1]>=x:
            ii.pop()
            xx.pop()
        xx.append(x)
        ii.append(i)

    print(mx*k)
    if mx:print(ai,aj)

main()
0