結果
| 問題 | No.489 株に挑戦 |
| コンテスト | |
| ユーザー |
mkawa2
|
| 提出日時 | 2020-05-16 16:15:00 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 1,259 bytes |
| 記録 | |
| コンパイル時間 | 289 ms |
| コンパイル使用メモリ | 21,208 KB |
| 実行使用メモリ | 39,396 KB |
| 最終ジャッジ日時 | 2026-09-02 10:45:51 |
| 合計ジャッジ時間 | 24,749 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 WA * 2 |
ソースコード
import numpy as np
from itertools import *
from bisect import *
from collections import *
from heapq import *
import sys
sys.setrecursionlimit(10 ** 6)
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)]
def LLI1(rows_number): return [LI1() 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 = [(1, 0), (0, 1), (-1, 0), (0, -1)]
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()
mkawa2