結果

問題 No.489 株に挑戦
ユーザー mmmpppmmmppp
提出日時 2017-02-25 22:10:18
言語 Ruby
(3.3.0)
結果
AC  
実行時間 217 ms / 1,000 ms
コード長 211 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 11,532 KB
実行使用メモリ 28,356 KB
最終ジャッジ日時 2023-09-27 05:22:21
合計ジャッジ時間 5,843 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 185 ms
22,888 KB
testcase_01 AC 125 ms
22,076 KB
testcase_02 AC 73 ms
15,144 KB
testcase_03 AC 72 ms
15,268 KB
testcase_04 AC 71 ms
15,376 KB
testcase_05 AC 72 ms
15,180 KB
testcase_06 AC 72 ms
15,096 KB
testcase_07 AC 74 ms
15,180 KB
testcase_08 AC 75 ms
15,304 KB
testcase_09 AC 74 ms
15,124 KB
testcase_10 AC 69 ms
15,144 KB
testcase_11 AC 74 ms
15,152 KB
testcase_12 AC 73 ms
15,008 KB
testcase_13 AC 72 ms
15,136 KB
testcase_14 AC 69 ms
15,008 KB
testcase_15 AC 75 ms
15,428 KB
testcase_16 AC 206 ms
26,892 KB
testcase_17 AC 82 ms
16,088 KB
testcase_18 AC 148 ms
21,600 KB
testcase_19 AC 120 ms
20,776 KB
testcase_20 AC 178 ms
25,272 KB
testcase_21 AC 89 ms
16,748 KB
testcase_22 AC 80 ms
15,780 KB
testcase_23 AC 133 ms
21,252 KB
testcase_24 AC 217 ms
28,244 KB
testcase_25 AC 71 ms
15,124 KB
testcase_26 AC 181 ms
24,696 KB
testcase_27 AC 120 ms
22,540 KB
testcase_28 AC 72 ms
15,236 KB
testcase_29 AC 71 ms
15,120 KB
testcase_30 AC 131 ms
23,600 KB
testcase_31 AC 141 ms
27,352 KB
testcase_32 AC 165 ms
21,720 KB
testcase_33 AC 210 ms
28,356 KB
testcase_34 AC 206 ms
25,532 KB
testcase_35 AC 121 ms
18,560 KB
testcase_36 AC 89 ms
16,380 KB
testcase_37 AC 126 ms
21,696 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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