結果

問題 No.2233 Average
ユーザー minimumminimum
提出日時 2023-03-03 22:10:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 311 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 805 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 75,976 KB
最終ジャッジ日時 2023-10-18 02:18:00
合計ジャッジ時間 4,969 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,908 KB
testcase_01 AC 38 ms
51,892 KB
testcase_02 AC 38 ms
51,900 KB
testcase_03 AC 38 ms
51,996 KB
testcase_04 AC 37 ms
51,948 KB
testcase_05 AC 39 ms
52,104 KB
testcase_06 AC 39 ms
52,080 KB
testcase_07 AC 43 ms
57,676 KB
testcase_08 AC 247 ms
75,480 KB
testcase_09 AC 291 ms
75,816 KB
testcase_10 AC 203 ms
75,956 KB
testcase_11 AC 197 ms
75,948 KB
testcase_12 AC 183 ms
75,932 KB
testcase_13 AC 101 ms
75,944 KB
testcase_14 AC 195 ms
75,952 KB
testcase_15 AC 233 ms
75,956 KB
testcase_16 AC 124 ms
75,976 KB
testcase_17 AC 134 ms
75,952 KB
testcase_18 AC 311 ms
75,912 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    A, B, C, K = map(int, input().split())
    if A == B == C:
        print(A + B + C)
        return
    for _ in range(K):
        if A == B == C:
            print(A + B + C)
            return
        A, B, C = (B + C) // 2, (C + A) // 2, (A + B) // 2
    print(A + B + C)
    return

T = int(input())
for _ in range(T):
    solve()
0