結果

問題 No.2233 Average
ユーザー ぷらぷら
提出日時 2023-02-17 03:31:49
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 416 bytes
コンパイル時間 3,145 ms
コンパイル使用メモリ 197,164 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-26 06:41:21
合計ジャッジ時間 5,628 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 37 ms
4,376 KB
testcase_09 AC 56 ms
4,376 KB
testcase_10 AC 45 ms
4,376 KB
testcase_11 AC 43 ms
4,384 KB
testcase_12 AC 38 ms
4,380 KB
testcase_13 AC 9 ms
4,376 KB
testcase_14 AC 32 ms
4,376 KB
testcase_15 AC 42 ms
4,376 KB
testcase_16 AC 13 ms
4,380 KB
testcase_17 AC 16 ms
4,376 KB
testcase_18 AC 64 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t;
    cin >> t;
    while(t--) {
        long long a,b,c,K;
        cin >> a >> b >> c >> K;
        while(K--) {
            long long A = (b+c)/2,B = (a+c)/2,C = (a+b)/2;
            a = A,b = B,c = C;
            if(a == b && b == c) break;
        }
        cout << a+b+c << "\n";
    }
}
0