結果

問題 No.2233 Average
ユーザー Live Youtube Channel Promotion FreeLive Youtube Channel Promotion Free
提出日時 2023-07-10 01:47:43
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 535 bytes
コンパイル時間 1,876 ms
コンパイル使用メモリ 164,456 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-10-01 05:53:45
合計ジャッジ時間 3,484 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 38 ms
4,380 KB
testcase_09 AC 57 ms
4,376 KB
testcase_10 AC 46 ms
4,376 KB
testcase_11 AC 44 ms
4,376 KB
testcase_12 AC 39 ms
4,380 KB
testcase_13 AC 10 ms
4,376 KB
testcase_14 AC 32 ms
4,376 KB
testcase_15 AC 44 ms
4,380 KB
testcase_16 AC 14 ms
4,376 KB
testcase_17 AC 17 ms
4,376 KB
testcase_18 AC 65 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

void solve(){
    long long a, b, c, k;
    cin >> a >> b >> c >> k;
    long long ta, tb, tc;
    k=min(k,80ll);
    while(k > 0){
        ta = (b+c)/2;
        tb = (a+c)/2;
        tc = (b+a)/2;
        a = ta, b = tb, c = tc;
        if(a == b && b == c){
            break;
        }
        k--;
    }
    cout << (a+b+c) << "\n";

}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t;
    cin >> t;
    while(t--){
       solve();     
    }

    return 0;
}
0