結果

問題 No.91 赤、緑、青の石
ユーザー wotsushiwotsushi
提出日時 2017-03-24 22:21:35
言語 Ruby
(3.3.0)
結果
AC  
実行時間 521 ms / 5,000 ms
コード長 187 bytes
コンパイル時間 248 ms
コンパイル使用メモリ 11,516 KB
実行使用メモリ 93,588 KB
最終ジャッジ日時 2023-09-06 12:28:46
合計ジャッジ時間 18,651 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 515 ms
93,400 KB
testcase_01 AC 514 ms
93,512 KB
testcase_02 AC 519 ms
93,464 KB
testcase_03 AC 517 ms
93,448 KB
testcase_04 AC 514 ms
93,460 KB
testcase_05 AC 519 ms
93,512 KB
testcase_06 AC 517 ms
93,244 KB
testcase_07 AC 514 ms
93,288 KB
testcase_08 AC 516 ms
93,400 KB
testcase_09 AC 521 ms
93,420 KB
testcase_10 AC 518 ms
93,240 KB
testcase_11 AC 514 ms
93,468 KB
testcase_12 AC 517 ms
93,324 KB
testcase_13 AC 515 ms
93,288 KB
testcase_14 AC 514 ms
93,532 KB
testcase_15 AC 516 ms
93,588 KB
testcase_16 AC 514 ms
93,320 KB
testcase_17 AC 518 ms
93,328 KB
testcase_18 AC 514 ms
93,576 KB
testcase_19 AC 518 ms
93,384 KB
testcase_20 AC 516 ms
93,328 KB
testcase_21 AC 515 ms
93,520 KB
testcase_22 AC 514 ms
93,248 KB
testcase_23 AC 520 ms
93,320 KB
testcase_24 AC 518 ms
93,328 KB
testcase_25 AC 518 ms
93,288 KB
testcase_26 AC 519 ms
93,520 KB
testcase_27 AC 519 ms
93,324 KB
testcase_28 AC 515 ms
93,404 KB
testcase_29 AC 516 ms
93,396 KB
testcase_30 AC 518 ms
93,388 KB
testcase_31 AC 514 ms
93,404 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

R, G, B = gets.split.map(&:to_i)
ans = (10**7).downto(0).to_a.bsearch {|x|
  [R - x, G - x, B - x].map {|y|
    if y >= 0
      y / 2
    else
      y
    end
}.inject(:+) >= 0}
puts ans
0