結果

問題 No.2056 非力なレッド
ユーザー maguroflymagurofly
提出日時 2022-08-26 22:30:27
言語 Ruby
(3.3.0)
結果
AC  
実行時間 213 ms / 2,000 ms
コード長 315 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 11,236 KB
実行使用メモリ 32,000 KB
最終ジャッジ日時 2023-08-04 02:03:29
合計ジャッジ時間 7,689 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,120 KB
testcase_01 AC 82 ms
15,240 KB
testcase_02 AC 80 ms
15,172 KB
testcase_03 AC 81 ms
15,244 KB
testcase_04 AC 80 ms
15,268 KB
testcase_05 AC 80 ms
15,084 KB
testcase_06 AC 80 ms
15,160 KB
testcase_07 AC 78 ms
15,252 KB
testcase_08 AC 79 ms
15,152 KB
testcase_09 AC 79 ms
15,284 KB
testcase_10 AC 78 ms
15,324 KB
testcase_11 AC 78 ms
15,136 KB
testcase_12 AC 79 ms
15,140 KB
testcase_13 AC 158 ms
26,168 KB
testcase_14 AC 164 ms
26,024 KB
testcase_15 AC 156 ms
26,220 KB
testcase_16 AC 85 ms
16,064 KB
testcase_17 AC 129 ms
22,580 KB
testcase_18 AC 84 ms
15,292 KB
testcase_19 AC 87 ms
16,228 KB
testcase_20 AC 167 ms
27,952 KB
testcase_21 AC 100 ms
17,364 KB
testcase_22 AC 167 ms
26,008 KB
testcase_23 AC 165 ms
24,160 KB
testcase_24 AC 111 ms
19,920 KB
testcase_25 AC 171 ms
28,248 KB
testcase_26 AC 182 ms
29,516 KB
testcase_27 AC 176 ms
28,576 KB
testcase_28 AC 192 ms
31,972 KB
testcase_29 AC 198 ms
31,760 KB
testcase_30 AC 200 ms
32,000 KB
testcase_31 AC 193 ms
31,976 KB
testcase_32 AC 194 ms
31,840 KB
testcase_33 AC 209 ms
31,704 KB
testcase_34 AC 211 ms
31,836 KB
testcase_35 AC 197 ms
31,816 KB
testcase_36 AC 195 ms
31,752 KB
testcase_37 AC 213 ms
31,740 KB
testcase_38 AC 79 ms
15,136 KB
testcase_39 AC 80 ms
15,256 KB
testcase_40 AC 81 ms
15,060 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N, X, M = gets.split.map(&:to_i)
A = gets.split.map(&:to_i)

B = A.map { |x|
  count = 0
  while x >= X
      count += 1
      x /= 2
  end
  count
}

max = 0
sum = 0
(0 ... N).reverse_each do |i|
    if B[i] > max
        sum += (i + 1) * (B[i] - max)
        max = B[i]
    end
end

puts (sum <= M ? "Yes" : "No")
0