結果

問題 No.489 株に挑戦
ユーザー mmmpppmmmppp
提出日時 2017-02-25 23:36:59
言語 Ruby
(3.3.0)
結果
AC  
実行時間 291 ms / 1,000 ms
コード長 202 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 11,468 KB
実行使用メモリ 30,232 KB
最終ジャッジ日時 2023-09-27 05:25:59
合計ジャッジ時間 6,688 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 197 ms
21,928 KB
testcase_01 AC 172 ms
21,760 KB
testcase_02 AC 70 ms
15,024 KB
testcase_03 AC 69 ms
15,096 KB
testcase_04 AC 72 ms
15,112 KB
testcase_05 AC 70 ms
15,260 KB
testcase_06 AC 68 ms
15,312 KB
testcase_07 AC 73 ms
15,220 KB
testcase_08 AC 71 ms
15,160 KB
testcase_09 AC 72 ms
15,160 KB
testcase_10 AC 72 ms
15,140 KB
testcase_11 AC 74 ms
15,032 KB
testcase_12 AC 74 ms
15,140 KB
testcase_13 AC 70 ms
15,164 KB
testcase_14 AC 70 ms
15,032 KB
testcase_15 AC 79 ms
15,540 KB
testcase_16 AC 282 ms
24,980 KB
testcase_17 AC 84 ms
16,308 KB
testcase_18 AC 169 ms
21,272 KB
testcase_19 AC 149 ms
20,356 KB
testcase_20 AC 248 ms
24,316 KB
testcase_21 AC 112 ms
16,708 KB
testcase_22 AC 87 ms
15,744 KB
testcase_23 AC 153 ms
21,136 KB
testcase_24 AC 291 ms
27,468 KB
testcase_25 AC 71 ms
15,280 KB
testcase_26 AC 175 ms
24,580 KB
testcase_27 AC 132 ms
24,972 KB
testcase_28 AC 74 ms
15,212 KB
testcase_29 AC 71 ms
15,068 KB
testcase_30 AC 283 ms
28,556 KB
testcase_31 AC 158 ms
30,232 KB
testcase_32 AC 182 ms
21,108 KB
testcase_33 AC 289 ms
27,332 KB
testcase_34 AC 236 ms
23,664 KB
testcase_35 AC 135 ms
18,704 KB
testcase_36 AC 96 ms
16,720 KB
testcase_37 AC 174 ms
21,800 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]||(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.shift*K,m*' ']
0