結果

問題 No.2233 Average
ユーザー umimel
提出日時 2023-03-03 21:51:16
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 704 bytes
コンパイル時間 1,674 ms
コンパイル使用メモリ 167,572 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-09-17 22:47:12
合計ジャッジ時間 8,429 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 1 WA * 5 TLE * 1 -- * 11
権限があれば一括ダウンロードができます

ソースコード

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