結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 206 ms
23,016 KB
testcase_01 AC 141 ms
21,900 KB
testcase_02 AC 81 ms
15,168 KB
testcase_03 AC 82 ms
15,368 KB
testcase_04 AC 82 ms
15,216 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,356 KB
testcase_16 AC 243 ms
27,008 KB
testcase_17 AC 96 ms
16,352 KB
testcase_18 AC 168 ms
21,596 KB
testcase_19 AC 135 ms
20,780 KB
testcase_20 AC 205 ms
25,296 KB
testcase_21 AC 102 ms
16,864 KB
testcase_22 AC 95 ms
15,924 KB
testcase_23 AC 155 ms
21,164 KB
testcase_24 AC 243 ms
28,252 KB
testcase_25 AC 84 ms
15,108 KB
testcase_26 AC 138 ms
22,436 KB
testcase_27 AC 138 ms
22,572 KB
testcase_28 AC 84 ms
15,184 KB
testcase_29 RE -
testcase_30 AC 152 ms
23,592 KB
testcase_31 AC 165 ms
27,492 KB
testcase_32 AC 180 ms
21,600 KB
testcase_33 AC 230 ms
28,300 KB
testcase_34 AC 234 ms
25,752 KB
testcase_35 AC 138 ms
18,908 KB
testcase_36 AC 95 ms
16,348 KB
testcase_37 AC 141 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+1..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