結果

問題 No.2233 Average
ユーザー umimelumimel
提出日時 2023-03-03 21:51:16
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 704 bytes
コンパイル時間 3,277 ms
コンパイル使用メモリ 166,648 KB
実行使用メモリ 8,696 KB
最終ジャッジ日時 2023-10-18 01:50:34
合計ジャッジ時間 9,330 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
#define drep(i, cc, n) for (int i = (cc); i <= (n); ++i)
#define rep(i, n) drep(i, 0, n - 1)
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define fi first
#define se second

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
    ll t; cin >> t;
    while(t--){
        ll a, b, c, k; cin >> a >> b >> c >> k;
        while(k--){
            if(a%2==0 && b%2==0 && c%2==0) break;
            ll pre_a = a, pre_b = b, pre_c = c;
            a = (pre_b+pre_c)/2;
            b = (pre_c+pre_a)/2;
            c = (pre_a+pre_b)/2;
        }

        cout << a+b+c << '\n';
    }
}
0