結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 173 ms
21,020 KB
testcase_01 AC 125 ms
20,432 KB
testcase_02 AC 76 ms
15,092 KB
testcase_03 AC 75 ms
15,120 KB
testcase_04 AC 74 ms
15,304 KB
testcase_05 AC 71 ms
15,160 KB
testcase_06 AC 72 ms
15,012 KB
testcase_07 AC 70 ms
15,092 KB
testcase_08 AC 69 ms
15,128 KB
testcase_09 AC 69 ms
15,080 KB
testcase_10 AC 72 ms
15,180 KB
testcase_11 AC 73 ms
15,280 KB
testcase_12 AC 70 ms
15,280 KB
testcase_13 AC 71 ms
15,256 KB
testcase_14 AC 72 ms
15,256 KB
testcase_15 AC 76 ms
15,568 KB
testcase_16 AC 199 ms
21,296 KB
testcase_17 AC 81 ms
16,280 KB
testcase_18 AC 144 ms
20,148 KB
testcase_19 AC 114 ms
18,836 KB
testcase_20 AC 178 ms
21,436 KB
testcase_21 AC 87 ms
16,428 KB
testcase_22 AC 80 ms
15,692 KB
testcase_23 AC 133 ms
20,608 KB
testcase_24 AC 206 ms
24,924 KB
testcase_25 AC 74 ms
15,136 KB
testcase_26 AC 189 ms
24,896 KB
testcase_27 AC 123 ms
22,528 KB
testcase_28 AC 73 ms
15,300 KB
testcase_29 AC 73 ms
15,152 KB
testcase_30 AC 130 ms
22,492 KB
testcase_31 AC 147 ms
24,696 KB
testcase_32 AC 159 ms
20,428 KB
testcase_33 AC 199 ms
24,556 KB
testcase_34 AC 198 ms
21,420 KB
testcase_35 AC 116 ms
17,892 KB
testcase_36 AC 80 ms
15,924 KB
testcase_37 AC 114 ms
20,136 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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
v<0&&break
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