結果

問題 No.91 赤、緑、青の石
ユーザー nnkknnkk
提出日時 2016-03-26 17:28:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 878 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 82,428 KB
実行使用メモリ 75,652 KB
最終ジャッジ日時 2024-04-09 23:58:27
合計ジャッジ時間 4,996 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#red,green,blue = 5,18,36
red,green,blue = [int(i) for i in input().split(" ")]
stones = [red,green,blue]

stones.sort()
minCount = min(stones)
result = minCount
stones.pop(0)
stones = [i - minCount for i in stones]

#個数が最も多い色の石を2個使って0個になった石に変更したのちにアクセサリを作成する
#つまり、個数が最も多い色の石は一回アクセサリを作るごとに3個消費される
#また、個数が2番目に多い石の数も0個になっていた場合は、一回アクセサリを作るごとに5個消費されることになる

while(True):
    if stones[1] - 2 >= 1 and stones[0] >= 1:
        stones[1] -= 3
        stones[0] -= 1
        result += 1
        stones.sort()
    elif stones[1] - 4 >= 1:
        stones[1] -= 5
        result += 1
    else:
        break   

print(stones)
print(result)

0