結果

問題 No.2233 Average
ユーザー Navier_Boltzmann
提出日時 2023-03-03 21:27:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 648 ms / 2,000 ms
コード長 480 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 82,408 KB
実行使用メモリ 80,512 KB
最終ジャッジ日時 2024-09-17 22:19:39
合計ジャッジ時間 6,315 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
import sys,math
input = sys.stdin.readline

def answer():
    
    
    a,b,c,K = map(int,input().split())
    
    bef = sorted([a,b,c])
    
    for _ in range(K):
        a,b,c = (b+c)//2,(a+c)//2,(b+a)//2
        aft = sorted([a,b,c])
        if bef==aft:
            print(sum(aft))
            return
        bef = aft[:]
    print(sum(aft))
    return
    
for _ in range(int(input())):
    answer()
0