結果

問題 No.489 株に挑戦
ユーザー maspymaspy
提出日時 2020-03-13 18:43:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 673 bytes
コンパイル時間 502 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 20,132 KB
最終ジャッジ日時 2024-05-02 02:57:28
合計ジャッジ時間 4,482 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
17,680 KB
testcase_01 AC 71 ms
15,512 KB
testcase_02 AC 26 ms
10,624 KB
testcase_03 AC 25 ms
10,624 KB
testcase_04 AC 25 ms
10,752 KB
testcase_05 AC 25 ms
10,752 KB
testcase_06 AC 26 ms
10,752 KB
testcase_07 AC 26 ms
10,624 KB
testcase_08 AC 26 ms
10,752 KB
testcase_09 AC 26 ms
10,752 KB
testcase_10 AC 26 ms
10,880 KB
testcase_11 AC 26 ms
10,624 KB
testcase_12 AC 27 ms
10,624 KB
testcase_13 AC 25 ms
10,624 KB
testcase_14 AC 26 ms
10,880 KB
testcase_15 AC 31 ms
11,264 KB
testcase_16 AC 100 ms
18,656 KB
testcase_17 AC 38 ms
11,904 KB
testcase_18 AC 67 ms
15,488 KB
testcase_19 AC 66 ms
14,252 KB
testcase_20 AC 105 ms
18,744 KB
testcase_21 AC 44 ms
12,772 KB
testcase_22 AC 32 ms
11,520 KB
testcase_23 AC 73 ms
15,776 KB
testcase_24 AC 114 ms
20,012 KB
testcase_25 AC 27 ms
10,752 KB
testcase_26 AC 105 ms
20,004 KB
testcase_27 WA -
testcase_28 AC 26 ms
10,752 KB
testcase_29 AC 27 ms
10,752 KB
testcase_30 AC 116 ms
20,004 KB
testcase_31 AC 118 ms
20,132 KB
testcase_32 AC 78 ms
16,032 KB
testcase_33 AC 109 ms
19,624 KB
testcase_34 AC 101 ms
18,444 KB
testcase_35 AC 57 ms
13,804 KB
testcase_36 AC 38 ms
12,032 KB
testcase_37 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3.8
# %%
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from collections import deque

# %%
N, D, K, *X = map(int, read().split())

# %%


def gen_cand():
    q = deque([0])
    for k, x in enumerate(X[1:], 1):
        while q[0] < k - D:
            q.popleft()
        j = q[0]
        diff = x - X[j]
        yield j, k, diff
        while q and X[q[-1]] >= x:
            q.pop()
        q.append(k)


# %%
best = 0, 0, 0
for j, k, x in gen_cand():
    if best[2] < x:
        best = j, k, x
if best[2] == 0:
    print(0)
else:
    print(best[2] * K)
    print(best[0], best[1])
0