結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 201 ms
22,740 KB
testcase_01 AC 139 ms
21,924 KB
testcase_02 AC 81 ms
15,092 KB
testcase_03 AC 80 ms
15,152 KB
testcase_04 AC 81 ms
15,168 KB
testcase_05 AC 80 ms
15,224 KB
testcase_06 AC 80 ms
15,180 KB
testcase_07 AC 82 ms
15,148 KB
testcase_08 AC 83 ms
15,356 KB
testcase_09 AC 81 ms
15,004 KB
testcase_10 AC 80 ms
15,088 KB
testcase_11 AC 83 ms
15,184 KB
testcase_12 AC 81 ms
15,140 KB
testcase_13 AC 82 ms
15,040 KB
testcase_14 AC 81 ms
15,272 KB
testcase_15 AC 88 ms
15,368 KB
testcase_16 AC 238 ms
26,972 KB
testcase_17 AC 94 ms
16,164 KB
testcase_18 AC 168 ms
21,628 KB
testcase_19 AC 132 ms
20,604 KB
testcase_20 AC 204 ms
25,024 KB
testcase_21 AC 104 ms
16,600 KB
testcase_22 AC 96 ms
15,780 KB
testcase_23 AC 155 ms
21,348 KB
testcase_24 AC 238 ms
28,188 KB
testcase_25 AC 81 ms
15,156 KB
testcase_26 AC 199 ms
24,716 KB
testcase_27 AC 136 ms
22,360 KB
testcase_28 AC 82 ms
15,136 KB
testcase_29 AC 83 ms
15,096 KB
testcase_30 AC 149 ms
23,660 KB
testcase_31 AC 160 ms
27,252 KB
testcase_32 AC 177 ms
21,736 KB
testcase_33 AC 230 ms
28,152 KB
testcase_34 AC 236 ms
25,600 KB
testcase_35 AC 135 ms
18,704 KB
testcase_36 AC 96 ms
16,212 KB
testcase_37 AC 142 ms
21,804 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
((j+1..f).map{|k|v=x[k]-a;v<0&&break;v>m[0]&&m=[v,j,k]};c,h=a,f)if a<c||x[f]>x[h]}
puts m[0]<1?0:[m.shift*K,m*' ']
0