結果

問題 No.2233 Average
ユーザー Live Youtube Channel Promotion FreeLive Youtube Channel Promotion Free
提出日時 2023-07-10 01:47:12
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 535 bytes
コンパイル時間 1,664 ms
コンパイル使用メモリ 165,092 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-10-01 05:53:28
合計ジャッジ時間 3,756 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 39 ms
4,380 KB
testcase_09 AC 58 ms
4,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 33 ms
4,376 KB
testcase_15 AC 44 ms
4,376 KB
testcase_16 AC 14 ms
4,380 KB
testcase_17 AC 17 ms
4,380 KB
testcase_18 AC 66 ms
4,376 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,50ll);
    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