結果

問題 No.489 株に挑戦
ユーザー mmmpppmmmppp
提出日時 2017-02-25 21:32:27
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 237 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 11,492 KB
実行使用メモリ 25,292 KB
最終ジャッジ日時 2023-09-02 08:13:31
合計ジャッジ時間 8,000 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 232 ms
25,292 KB
testcase_01 AC 197 ms
20,080 KB
testcase_02 AC 85 ms
15,056 KB
testcase_03 AC 88 ms
15,100 KB
testcase_04 AC 88 ms
15,100 KB
testcase_05 AC 89 ms
15,064 KB
testcase_06 AC 91 ms
15,112 KB
testcase_07 AC 90 ms
15,312 KB
testcase_08 AC 87 ms
15,140 KB
testcase_09 AC 88 ms
15,256 KB
testcase_10 AC 85 ms
15,072 KB
testcase_11 AC 83 ms
15,008 KB
testcase_12 AC 84 ms
15,000 KB
testcase_13 AC 87 ms
15,132 KB
testcase_14 AC 87 ms
15,156 KB
testcase_15 AC 98 ms
15,260 KB
testcase_16 AC 320 ms
21,144 KB
testcase_17 AC 102 ms
16,284 KB
testcase_18 AC 192 ms
20,116 KB
testcase_19 AC 175 ms
18,984 KB
testcase_20 AC 293 ms
21,416 KB
testcase_21 AC 135 ms
16,416 KB
testcase_22 AC 102 ms
15,616 KB
testcase_23 AC 177 ms
20,368 KB
testcase_24 AC 324 ms
24,656 KB
testcase_25 AC 87 ms
15,220 KB
testcase_26 AC 219 ms
24,668 KB
testcase_27 TLE -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:3: warning: assigned but unused variable - c
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
  x[j+1..f].each_with_index{|b,k|
    v=b-a
    break if v<0
    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