結果

問題 No.91 赤、緑、青の石
ユーザー matsu7874
提出日時 2015-10-13 12:55:50
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 450 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 16,128 KB
最終ジャッジ日時 2024-07-21 07:27:12
合計ジャッジ時間 33,033 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 7 WA * 1 TLE * 2 -- * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

s = list(map(int, input().split()))
s.sort()
total = s[0]
for i in range(3):
    s[i] -= total
while True:
    if s[0] == 0:
        z = min((s[2]-s[1]+2)//2,s[2]//3)
        s[2] -= z*2
        s[0] += z
    if all(s[i] > 0 for i in range(3)):
        m = min(s)
        total += m
        for i in range(3):
            s[i] -= m
    s.sort()
    if (s[1]==1 and s[2]<3) or (s[1]==0 and s[2]<5) or (s[1]==2 and s[2]==2):
        break
print(total)
0