結果
問題 | No.489 株に挑戦 |
ユーザー | kjnho |
提出日時 | 2017-02-25 01:13:22 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,489 bytes |
コンパイル時間 | 291 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 47,336 KB |
最終ジャッジ日時 | 2024-06-11 03:31:22 |
合計ジャッジ時間 | 26,384 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 644 ms
45,540 KB |
testcase_01 | WA | - |
testcase_02 | AC | 455 ms
44,912 KB |
testcase_03 | AC | 451 ms
44,644 KB |
testcase_04 | AC | 441 ms
44,904 KB |
testcase_05 | WA | - |
testcase_06 | AC | 448 ms
44,488 KB |
testcase_07 | AC | 466 ms
44,644 KB |
testcase_08 | AC | 472 ms
44,392 KB |
testcase_09 | AC | 454 ms
44,636 KB |
testcase_10 | AC | 450 ms
44,904 KB |
testcase_11 | AC | 456 ms
44,268 KB |
testcase_12 | AC | 452 ms
45,028 KB |
testcase_13 | WA | - |
testcase_14 | AC | 444 ms
44,520 KB |
testcase_15 | AC | 456 ms
44,524 KB |
testcase_16 | TLE | - |
testcase_17 | AC | 473 ms
44,512 KB |
testcase_18 | AC | 601 ms
44,620 KB |
testcase_19 | AC | 609 ms
44,772 KB |
testcase_20 | TLE | - |
testcase_21 | WA | - |
testcase_22 | AC | 470 ms
44,908 KB |
testcase_23 | AC | 594 ms
44,868 KB |
testcase_24 | TLE | - |
testcase_25 | AC | 457 ms
44,524 KB |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | AC | 445 ms
44,388 KB |
testcase_29 | AC | 465 ms
44,772 KB |
testcase_30 | AC | 696 ms
47,336 KB |
testcase_31 | AC | 670 ms
47,212 KB |
testcase_32 | WA | - |
testcase_33 | TLE | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | AC | 488 ms
44,648 KB |
testcase_37 | WA | - |
ソースコード
# coding: utf-8 # from scipy import integrate import re from operator import itemgetter from collections import defaultdict as dd from collections import Counter from collections import deque from collections import namedtuple import numpy as np import fractions import math from copy import deepcopy as dcopy import heapq from math import cos, sin, radians import itertools from heapq import * import bisect def main(): N,D,K = map(int, input().split()) values = [int(input()) for i in range(N)] h_window = dcopy(values[:D]) h_window.sort() minimum = min(values[:D]) w_min_index = values[:D].index(minimum) min_index = values[:D].index(minimum) maximum = max(values[:D+1]) max_index = values[:D+1].index(maximum) MAX = maximum - minimum for j in range(D+1, N): del h_window[bisect.bisect_left(h_window, values[j-D-1])] if len(h_window) == 0: w_min_index = j-1 elif values[j-1] < h_window[0]: w_min_index = j-1 bisect.insort(h_window, values[j-1]) minimum = h_window[0] tmp = values[j] - minimum if tmp > MAX: MAX = tmp max_index = j min_index = w_min_index # print(MAX, min_index, max_index) if MAX <= 0: print(0) else: print(K*MAX) print(min_index, max_index) if __name__ == "__main__": # {{{ try: import test test.test() except: main() # }}}