結果

問題 No.91 赤、緑、青の石
ユーザー maimai
提出日時 2016-01-30 21:29:09
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 328 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 11,960 KB
実行使用メモリ 20,664 KB
最終ジャッジ日時 2023-10-21 18:10:51
合計ジャッジ時間 7,884 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
16,072 KB
testcase_01 AC 84 ms
16,072 KB
testcase_02 AC 84 ms
16,072 KB
testcase_03 AC 84 ms
16,072 KB
testcase_04 AC 85 ms
16,072 KB
testcase_05 AC 84 ms
16,072 KB
testcase_06 WA -
testcase_07 AC 85 ms
16,072 KB
testcase_08 AC 84 ms
16,072 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

r=gets.split(" ").map!(&:to_i)
g=r.min
r.map!{|e|e-g}.sort!;

loop{
    if r[1]==0
        break if r[2]/5<=0
        g+=r[2]/5
        r[2]=r[2]-r[2]/5*4
    elsif r[1]*3<r[2]
        g+=r[1]
        r[2]-=r[1]*3
        r[1]=0
    else
        i=r[2]/3
        g+=i
        r[1]-=i
        r[2]-=i*3
    end
    r.sort!
}
p g
0