結果

問題 No.2233 Average
ユーザー karinohitokarinohito
提出日時 2023-03-10 16:17:20
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 293 ms / 2,000 ms
コード長 320 bytes
コンパイル時間 2,656 ms
コンパイル使用メモリ 201,208 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-18 06:45:07
合計ジャッジ時間 6,106 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
    ll T,A,B,C,K,p,q,r;
    cin>>T;
    while(cin>>A>>B>>C>>K){
        for(ll k=0;k<K;k++){
            p=(A+B)/2,q=(B+C)/2,r=(A+C)/2;
            A=p,B=q,C=r;
            if(A==B&&B==C)break;
        }
        cout<<A+B+C<<endl;
    }
}
0