結果

問題 No.489 株に挑戦
ユーザー mmmpppmmmppp
提出日時 2017-02-25 21:33:10
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 262 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 11,456 KB
実行使用メモリ 28,108 KB
最終ジャッジ日時 2023-09-02 08:14:07
合計ジャッジ時間 7,321 ms
ジャッジサーバーID
(参考情報)
judge16 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 200 ms
21,176 KB
testcase_01 AC 190 ms
20,312 KB
testcase_02 AC 83 ms
15,128 KB
testcase_03 AC 81 ms
15,300 KB
testcase_04 AC 81 ms
15,340 KB
testcase_05 AC 82 ms
15,176 KB
testcase_06 AC 83 ms
15,172 KB
testcase_07 AC 82 ms
15,152 KB
testcase_08 AC 83 ms
15,168 KB
testcase_09 AC 83 ms
15,280 KB
testcase_10 AC 82 ms
15,264 KB
testcase_11 AC 82 ms
15,292 KB
testcase_12 AC 83 ms
15,088 KB
testcase_13 AC 83 ms
15,092 KB
testcase_14 AC 84 ms
15,156 KB
testcase_15 AC 90 ms
15,520 KB
testcase_16 AC 296 ms
21,500 KB
testcase_17 AC 95 ms
16,124 KB
testcase_18 AC 169 ms
20,352 KB
testcase_19 AC 166 ms
19,132 KB
testcase_20 AC 275 ms
21,496 KB
testcase_21 AC 129 ms
16,600 KB
testcase_22 AC 94 ms
15,432 KB
testcase_23 AC 154 ms
20,344 KB
testcase_24 AC 300 ms
24,932 KB
testcase_25 AC 83 ms
15,096 KB
testcase_26 AC 212 ms
24,812 KB
testcase_27 TLE -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,d,K,*x=$<.read.split.map &:to_i
m=[0,0,0]
c=h=x[0]+1
x.each_with_index{|a,j|
  f=[j+d,n-1].min
  next if a>c&&x[f]<x[h]
  x[j+1..f].each_with_index{|b,k|
    v=b-a
    break if v<0
    v>m[0]&&m=[v,j,k+j+1]
  }
  h=f
  c=a
}
m[0]<1?p(0):puts(m[0]*K,m[1,2]*' ')
0