結果

問題 No.91 赤、緑、青の石
ユーザー flippergoflippergo
提出日時 2020-12-28 18:11:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 5,000 ms
コード長 507 bytes
コンパイル時間 784 ms
コンパイル使用メモリ 86,888 KB
実行使用メモリ 71,568 KB
最終ジャッジ日時 2023-09-06 12:53:38
合計ジャッジ時間 3,942 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,296 KB
testcase_01 AC 73 ms
71,088 KB
testcase_02 AC 73 ms
71,476 KB
testcase_03 AC 74 ms
71,252 KB
testcase_04 AC 76 ms
71,284 KB
testcase_05 AC 74 ms
71,568 KB
testcase_06 AC 73 ms
71,280 KB
testcase_07 AC 74 ms
71,084 KB
testcase_08 AC 74 ms
71,260 KB
testcase_09 AC 72 ms
71,484 KB
testcase_10 AC 68 ms
71,312 KB
testcase_11 AC 69 ms
71,396 KB
testcase_12 AC 69 ms
71,232 KB
testcase_13 AC 69 ms
71,256 KB
testcase_14 AC 65 ms
71,368 KB
testcase_15 AC 65 ms
71,472 KB
testcase_16 AC 68 ms
71,292 KB
testcase_17 AC 66 ms
71,284 KB
testcase_18 AC 67 ms
71,300 KB
testcase_19 AC 68 ms
71,084 KB
testcase_20 AC 66 ms
71,512 KB
testcase_21 AC 65 ms
71,508 KB
testcase_22 AC 62 ms
71,260 KB
testcase_23 AC 62 ms
71,352 KB
testcase_24 AC 65 ms
71,312 KB
testcase_25 AC 65 ms
71,296 KB
testcase_26 AC 62 ms
71,224 KB
testcase_27 AC 64 ms
71,392 KB
testcase_28 AC 62 ms
71,308 KB
testcase_29 AC 63 ms
71,512 KB
testcase_30 AC 66 ms
71,324 KB
testcase_31 AC 64 ms
71,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

R,G,B = map(int,input().split())
high = 10**7+1
low = 0
while high-low>1:
    mid = (high+low)//2
    x,y,z = R,G,B
    x -= mid
    y -= mid
    z -= mid
    if x<0 and y<0 and z<0:
        high = mid
        continue
    x,y,z = sorted([x,y,z])
    if y>=0:
        cnt = y//2+z//2
        if x+cnt>=0:
            low = mid
            continue
        high = mid
        continue
    else:
        if x+y+z//2>=0:
            low = mid
            continue
        high = mid
        continue
print(low)
0