結果

問題 No.489 株に挑戦
ユーザー smz_8110smz_8110
提出日時 2017-04-11 16:34:00
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 446 bytes
コンパイル時間 54 ms
コンパイル使用メモリ 11,572 KB
実行使用メモリ 16,448 KB
最終ジャッジ日時 2023-09-25 11:12:05
合計ジャッジ時間 5,662 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
16,092 KB
testcase_01 AC 113 ms
15,460 KB
testcase_02 AC 79 ms
15,128 KB
testcase_03 AC 80 ms
15,040 KB
testcase_04 AC 80 ms
15,304 KB
testcase_05 AC 79 ms
15,088 KB
testcase_06 AC 80 ms
15,272 KB
testcase_07 AC 80 ms
15,232 KB
testcase_08 AC 80 ms
15,136 KB
testcase_09 AC 81 ms
15,160 KB
testcase_10 AC 80 ms
15,272 KB
testcase_11 AC 82 ms
15,116 KB
testcase_12 AC 82 ms
15,244 KB
testcase_13 AC 80 ms
15,224 KB
testcase_14 AC 81 ms
15,272 KB
testcase_15 AC 86 ms
15,048 KB
testcase_16 AC 137 ms
16,080 KB
testcase_17 AC 91 ms
15,392 KB
testcase_18 AC 113 ms
15,520 KB
testcase_19 AC 106 ms
15,548 KB
testcase_20 AC 140 ms
16,288 KB
testcase_21 AC 96 ms
15,408 KB
testcase_22 AC 87 ms
15,300 KB
testcase_23 AC 118 ms
15,708 KB
testcase_24 AC 147 ms
16,436 KB
testcase_25 AC 80 ms
15,120 KB
testcase_26 AC 145 ms
16,184 KB
testcase_27 WA -
testcase_28 AC 80 ms
15,152 KB
testcase_29 AC 80 ms
15,188 KB
testcase_30 AC 146 ms
16,220 KB
testcase_31 AC 146 ms
16,076 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 91 ms
15,304 KB
testcase_37 AC 116 ms
15,508 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N,D,K=gets.split.map &:to_i
a=N.times.map{gets.to_i}
c=1
min=a[0]
v=0
b=[a[0]]
x=y=z=0
i,j=0,1
while j<a.size
  if j-i>D
    if a[i]==min
      c-=1
      if c==0
        b=a[i+1,D]
        min=b.min
        c=b.count(min)
        v=b.index(min)
      end
    end
    i+=1
  end
  if a[j]<min
    min=a[j]
    c=1
    v=j
  elsif a[j]==min
    c+=1
  elsif a[j]-min>z
    z=a[j]-min
    x=v
    y=j
  end
  j+=1
end
p z*K
puts "#{x} #{y}" if z>0
0