結果

問題 No.489 株に挑戦
ユーザー 💕💖💞💕💖💞
提出日時 2018-09-16 14:42:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 1,081 bytes
コンパイル時間 786 ms
コンパイル使用メモリ 10,772 KB
実行使用メモリ 139,368 KB
最終ジャッジ日時 2023-09-25 08:59:32
合計ジャッジ時間 4,790 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, D, K = map(int, input().split()) 
import sys
xs = [(index, int(input())) for index, i in enumerate(range(N)) ] 
#print(xs)


def pmap(arg):
  key, starts = arg
  ans = []
  for start in starts:
    try:
      result = max( xs[start+1:min([start+D+1, len(xs)])], key=lambda x:x[1] ) 
      #print(result)
      r, l = xs[start], result
      delta = l[1] - r[1]
      tuple = (r[0], l[0])
      ans.append( (tuple, delta) )
      #sys.exit()
      #break
    except Exception as ex:
      print(ex)
  return ans

args = {}
for start in range(len(xs)-1):
  key = start%4
  if args.get(key) is None:
    args[key] = []
  args[key].append( start )
args = [(key,starts) for key, starts in args.items()]

from concurrent.futures import ProcessPoolExecutor as PPE
ans = []
with PPE(max_workers=4) as exe:
  for _ans in exe.map(pmap, args):
    for _a in _ans:
      ans.append(_a)

ans = sorted(ans, key=lambda x:x[1]*-1)

ans_size = ans[0][1]

ans = sorted( [a[0] for a in ans if a[1] == ans_size] )
if ans_size == 0:
  print(0)
else:
  print(ans_size*K)
  print(ans[0][0], ans[0][1])
0