結果

問題 No.2056 非力なレッド
ユーザー maguroflymagurofly
提出日時 2022-08-26 22:29:35
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 314 bytes
コンパイル時間 132 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 27,648 KB
最終ジャッジ日時 2024-04-22 00:34:58
合計ジャッジ時間 7,212 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
12,160 KB
testcase_01 AC 76 ms
12,288 KB
testcase_02 AC 78 ms
12,160 KB
testcase_03 AC 79 ms
12,160 KB
testcase_04 AC 81 ms
12,160 KB
testcase_05 AC 76 ms
12,160 KB
testcase_06 AC 77 ms
12,160 KB
testcase_07 AC 77 ms
12,416 KB
testcase_08 AC 77 ms
12,160 KB
testcase_09 AC 78 ms
12,288 KB
testcase_10 AC 83 ms
12,288 KB
testcase_11 AC 80 ms
12,160 KB
testcase_12 AC 81 ms
12,160 KB
testcase_13 AC 148 ms
22,400 KB
testcase_14 AC 146 ms
22,144 KB
testcase_15 AC 147 ms
22,528 KB
testcase_16 AC 82 ms
12,928 KB
testcase_17 AC 125 ms
18,560 KB
testcase_18 AC 86 ms
12,416 KB
testcase_19 AC 87 ms
13,184 KB
testcase_20 AC 160 ms
24,064 KB
testcase_21 AC 96 ms
14,336 KB
testcase_22 AC 157 ms
22,144 KB
testcase_23 AC 155 ms
20,608 KB
testcase_24 AC 103 ms
16,384 KB
testcase_25 AC 161 ms
24,448 KB
testcase_26 AC 168 ms
25,344 KB
testcase_27 AC 165 ms
24,704 KB
testcase_28 AC 192 ms
27,520 KB
testcase_29 AC 192 ms
27,520 KB
testcase_30 AC 192 ms
27,648 KB
testcase_31 AC 175 ms
27,520 KB
testcase_32 AC 180 ms
27,520 KB
testcase_33 AC 188 ms
27,648 KB
testcase_34 AC 191 ms
27,648 KB
testcase_35 AC 181 ms
27,520 KB
testcase_36 AC 178 ms
27,648 KB
testcase_37 AC 197 ms
27,648 KB
testcase_38 AC 76 ms
12,288 KB
testcase_39 WA -
testcase_40 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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