結果

問題 No.489 株に挑戦
ユーザー mmmpppmmmppp
提出日時 2017-02-25 21:37:11
言語 Ruby
(3.3.0)
結果
AC  
実行時間 245 ms / 1,000 ms
コード長 213 bytes
コンパイル時間 44 ms
コンパイル使用メモリ 11,568 KB
実行使用メモリ 29,148 KB
最終ジャッジ日時 2023-09-27 05:22:11
合計ジャッジ時間 6,858 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 216 ms
23,504 KB
testcase_01 AC 150 ms
21,956 KB
testcase_02 AC 86 ms
15,296 KB
testcase_03 AC 85 ms
15,144 KB
testcase_04 AC 84 ms
15,284 KB
testcase_05 AC 87 ms
15,092 KB
testcase_06 AC 86 ms
15,124 KB
testcase_07 AC 83 ms
15,140 KB
testcase_08 AC 83 ms
15,120 KB
testcase_09 AC 84 ms
15,200 KB
testcase_10 AC 83 ms
15,004 KB
testcase_11 AC 85 ms
15,012 KB
testcase_12 AC 85 ms
15,184 KB
testcase_13 AC 84 ms
15,136 KB
testcase_14 AC 84 ms
15,032 KB
testcase_15 AC 89 ms
15,584 KB
testcase_16 AC 245 ms
26,024 KB
testcase_17 AC 97 ms
16,168 KB
testcase_18 AC 176 ms
22,052 KB
testcase_19 AC 138 ms
20,244 KB
testcase_20 AC 207 ms
24,280 KB
testcase_21 AC 106 ms
16,940 KB
testcase_22 AC 100 ms
15,892 KB
testcase_23 AC 162 ms
21,420 KB
testcase_24 AC 245 ms
29,148 KB
testcase_25 AC 85 ms
15,252 KB
testcase_26 AC 203 ms
24,640 KB
testcase_27 AC 140 ms
22,504 KB
testcase_28 AC 86 ms
15,092 KB
testcase_29 AC 84 ms
15,008 KB
testcase_30 AC 153 ms
23,724 KB
testcase_31 AC 168 ms
27,476 KB
testcase_32 AC 181 ms
22,120 KB
testcase_33 AC 244 ms
28,948 KB
testcase_34 AC 243 ms
26,684 KB
testcase_35 AC 144 ms
18,688 KB
testcase_36 AC 96 ms
16,032 KB
testcase_37 AC 143 ms
21,340 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|f=[j+d,n-1].min
x[j]>=c&&x[f]<=x[h]&&next
(j+1..f).map{|k|v=x[k]-x[j]
v<0&&break
v>m[0]&&m=[v,j,k]}
h=f
c=x[j]}
m[0]<1?p(0):puts(m[0]*K,m[1,2]*' ')
0