結果

問題 No.489 株に挑戦
ユーザー mmmpppmmmppp
提出日時 2017-02-25 21:48:25
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 203 bytes
コンパイル時間 419 ms
コンパイル使用メモリ 11,392 KB
実行使用メモリ 28,404 KB
最終ジャッジ日時 2023-09-02 08:14:46
合計ジャッジ時間 6,753 ms
ジャッジサーバーID
(参考情報)
judge16 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 209 ms
23,000 KB
testcase_01 AC 144 ms
22,076 KB
testcase_02 AC 82 ms
15,172 KB
testcase_03 AC 81 ms
15,164 KB
testcase_04 AC 82 ms
15,276 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 89 ms
15,384 KB
testcase_16 AC 240 ms
27,392 KB
testcase_17 AC 95 ms
16,308 KB
testcase_18 AC 172 ms
21,564 KB
testcase_19 AC 134 ms
20,644 KB
testcase_20 AC 206 ms
25,224 KB
testcase_21 AC 100 ms
16,892 KB
testcase_22 AC 95 ms
15,916 KB
testcase_23 AC 160 ms
21,408 KB
testcase_24 AC 244 ms
28,404 KB
testcase_25 AC 81 ms
15,180 KB
testcase_26 AC 138 ms
22,472 KB
testcase_27 AC 138 ms
22,348 KB
testcase_28 AC 82 ms
15,040 KB
testcase_29 RE -
testcase_30 AC 152 ms
23,772 KB
testcase_31 AC 165 ms
27,540 KB
testcase_32 AC 183 ms
21,872 KB
testcase_33 AC 242 ms
28,268 KB
testcase_34 AC 239 ms
25,860 KB
testcase_35 AC 142 ms
18,764 KB
testcase_36 AC 95 ms
16,380 KB
testcase_37 AC 140 ms
21,748 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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