結果

問題 No.489 株に挑戦
ユーザー mmmpppmmmppp
提出日時 2017-02-25 23:26:10
言語 Ruby
(3.3.0)
結果
AC  
実行時間 288 ms / 1,000 ms
コード長 203 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 11,432 KB
実行使用メモリ 30,212 KB
最終ジャッジ日時 2023-09-27 05:25:41
合計ジャッジ時間 7,173 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 203 ms
21,812 KB
testcase_01 AC 170 ms
21,800 KB
testcase_02 AC 69 ms
15,204 KB
testcase_03 AC 69 ms
15,356 KB
testcase_04 AC 69 ms
15,300 KB
testcase_05 AC 69 ms
15,140 KB
testcase_06 AC 72 ms
15,256 KB
testcase_07 AC 72 ms
15,304 KB
testcase_08 AC 74 ms
15,144 KB
testcase_09 AC 73 ms
15,096 KB
testcase_10 AC 70 ms
15,004 KB
testcase_11 AC 73 ms
15,220 KB
testcase_12 AC 70 ms
15,328 KB
testcase_13 AC 71 ms
15,104 KB
testcase_14 AC 70 ms
15,300 KB
testcase_15 AC 81 ms
15,500 KB
testcase_16 AC 285 ms
24,984 KB
testcase_17 AC 83 ms
16,296 KB
testcase_18 AC 166 ms
21,248 KB
testcase_19 AC 145 ms
20,460 KB
testcase_20 AC 249 ms
24,484 KB
testcase_21 AC 106 ms
16,752 KB
testcase_22 AC 87 ms
15,580 KB
testcase_23 AC 153 ms
20,880 KB
testcase_24 AC 288 ms
27,492 KB
testcase_25 AC 70 ms
15,136 KB
testcase_26 AC 178 ms
24,556 KB
testcase_27 AC 130 ms
24,980 KB
testcase_28 AC 73 ms
15,260 KB
testcase_29 AC 71 ms
15,200 KB
testcase_30 AC 284 ms
28,564 KB
testcase_31 AC 152 ms
30,212 KB
testcase_32 AC 173 ms
21,264 KB
testcase_33 AC 280 ms
27,468 KB
testcase_34 AC 242 ms
23,788 KB
testcase_35 AC 136 ms
18,376 KB
testcase_36 AC 98 ms
16,512 KB
testcase_37 AC 181 ms
21,624 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]})if a<c||x[f]>x[h]
c,h=a,f}
puts m[0]<1?0:[m.shift*K,m*' ']
0