結果

問題 No.91 赤、緑、青の石
ユーザー はむ吉🐹はむ吉🐹
提出日時 2016-08-18 13:21:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 590 ms / 5,000 ms
コード長 632 bytes
コンパイル時間 593 ms
コンパイル使用メモリ 86,924 KB
実行使用メモリ 76,572 KB
最終ジャッジ日時 2023-09-06 12:22:56
合計ジャッジ時間 8,948 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 437 ms
76,164 KB
testcase_01 AC 309 ms
76,016 KB
testcase_02 AC 217 ms
76,008 KB
testcase_03 AC 330 ms
76,248 KB
testcase_04 AC 200 ms
76,064 KB
testcase_05 AC 379 ms
76,572 KB
testcase_06 AC 150 ms
76,308 KB
testcase_07 AC 70 ms
71,520 KB
testcase_08 AC 71 ms
71,416 KB
testcase_09 AC 70 ms
71,588 KB
testcase_10 AC 72 ms
71,444 KB
testcase_11 AC 163 ms
76,064 KB
testcase_12 AC 363 ms
76,056 KB
testcase_13 AC 404 ms
76,264 KB
testcase_14 AC 297 ms
76,012 KB
testcase_15 AC 424 ms
76,088 KB
testcase_16 AC 70 ms
71,392 KB
testcase_17 AC 71 ms
71,416 KB
testcase_18 AC 71 ms
71,316 KB
testcase_19 AC 71 ms
71,448 KB
testcase_20 AC 71 ms
71,580 KB
testcase_21 AC 71 ms
71,628 KB
testcase_22 AC 74 ms
71,572 KB
testcase_23 AC 72 ms
71,280 KB
testcase_24 AC 72 ms
71,316 KB
testcase_25 AC 590 ms
76,132 KB
testcase_26 AC 556 ms
75,980 KB
testcase_27 AC 70 ms
71,244 KB
testcase_28 AC 108 ms
76,008 KB
testcase_29 AC 146 ms
75,976 KB
testcase_30 AC 405 ms
76,236 KB
testcase_31 AC 541 ms
76,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env pypy3


def in_place_compute(stones):
    ans = 0
    stones.sort()
    ans += stones[0]
    stones[1] -= stones[0]
    stones[2] -= stones[0]
    stones[0] -= stones[0]
    while stones[2] >= 2:
        stones.sort()
        stones[2] -= 2
        stones[0] += 1
        if not (stones[1] and stones[2]):
            continue
        ans += stones[0]
        stones[1] -= stones[0]
        stones[2] -= stones[0]
        stones[0] -= stones[0]
        stones.sort()
    return ans


def main():
    stones = list(map(int, input().split()))
    print(in_place_compute(stones))


if __name__ == '__main__':
    main()
0