結果

問題 No.1736 Princess vs. Dragoness
ユーザー 小野寺健小野寺健
提出日時 2021-12-01 16:43:40
言語 Ruby
(3.3.0)
結果
AC  
実行時間 290 ms / 2,000 ms
コード長 261 bytes
コンパイル時間 64 ms
コンパイル使用メモリ 11,432 KB
実行使用メモリ 15,316 KB
最終ジャッジ日時 2023-09-17 23:17:43
合計ジャッジ時間 6,178 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,112 KB
testcase_01 AC 84 ms
15,076 KB
testcase_02 AC 88 ms
15,112 KB
testcase_03 AC 86 ms
15,244 KB
testcase_04 AC 98 ms
15,200 KB
testcase_05 AC 85 ms
15,236 KB
testcase_06 AC 176 ms
15,184 KB
testcase_07 AC 127 ms
15,296 KB
testcase_08 AC 140 ms
15,236 KB
testcase_09 AC 110 ms
15,256 KB
testcase_10 AC 82 ms
15,044 KB
testcase_11 AC 267 ms
15,104 KB
testcase_12 AC 117 ms
15,132 KB
testcase_13 AC 191 ms
15,016 KB
testcase_14 AC 94 ms
15,148 KB
testcase_15 AC 94 ms
15,080 KB
testcase_16 AC 112 ms
15,304 KB
testcase_17 AC 132 ms
15,308 KB
testcase_18 AC 116 ms
15,012 KB
testcase_19 AC 119 ms
15,136 KB
testcase_20 AC 92 ms
15,084 KB
testcase_21 AC 148 ms
15,108 KB
testcase_22 AC 122 ms
15,008 KB
testcase_23 AC 114 ms
15,164 KB
testcase_24 AC 83 ms
14,996 KB
testcase_25 AC 111 ms
15,172 KB
testcase_26 AC 257 ms
15,200 KB
testcase_27 AC 249 ms
15,184 KB
testcase_28 AC 109 ms
15,084 KB
testcase_29 AC 88 ms
15,316 KB
testcase_30 AC 153 ms
15,148 KB
testcase_31 AC 172 ms
15,080 KB
testcase_32 AC 290 ms
15,048 KB
testcase_33 AC 85 ms
15,108 KB
testcase_34 AC 83 ms
15,080 KB
testcase_35 AC 83 ms
15,032 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N, A, B, X, Y = gets.split(" ").map{|s| s.to_i}
h = gets.split(" ").map{|s| s.to_i}
h.sort!.reverse!

A.times {
	i = h.shift
	if i > X then
		h << (i - X)
		h.sort!.reverse!
	end
	break if h.length == 0
}

puts (h.length == 0 or h.sum <= B * Y) ? "Yes" : "No" 
0