結果

問題 No.91 赤、緑、青の石
ユーザー Konton7Konton7
提出日時 2019-05-05 23:07:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 443 bytes
コンパイル時間 597 ms
コンパイル使用メモリ 10,888 KB
実行使用メモリ 7,908 KB
最終ジャッジ日時 2023-09-08 12:27:34
合計ジャッジ時間 2,239 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 16 ms
7,756 KB
testcase_08 AC 16 ms
7,764 KB
testcase_09 AC 16 ms
7,824 KB
testcase_10 AC 16 ms
7,800 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 16 ms
7,908 KB
testcase_17 AC 15 ms
7,772 KB
testcase_18 AC 16 ms
7,800 KB
testcase_19 AC 16 ms
7,768 KB
testcase_20 AC 15 ms
7,684 KB
testcase_21 AC 15 ms
7,700 KB
testcase_22 AC 16 ms
7,776 KB
testcase_23 AC 15 ms
7,816 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 15 ms
7,756 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 15 ms
7,860 KB
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

stones = sorted([ int(v) for v in input().split() ])

def exchange(inlist):
    a, b, c = inlist


    if b != 0:    
        d = min( ( c - a ) // 3, b)
        a, c = a + d, c - d * 2
        d = a
        inlist = sorted([ i - a for i in [a,b,c] ])
    else:
        d = c // 5
        inlist = [0,0,(c-5*d)]

    return(inlist,d)

ans = 0
product = 1
while product != 0:
    stones, product = exchange(stones)
    ans += product
print(ans)
0