結果

問題 No.2233 Average
ユーザー ttkkggwwttkkggww
提出日時 2023-03-03 21:51:22
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 171 ms / 2,000 ms
コード長 460 bytes
コンパイル時間 4,581 ms
コンパイル使用メモリ 262,140 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-18 01:49:44
合計ジャッジ時間 7,071 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 102 ms
4,348 KB
testcase_09 AC 153 ms
4,348 KB
testcase_10 AC 97 ms
4,348 KB
testcase_11 AC 93 ms
4,348 KB
testcase_12 AC 82 ms
4,348 KB
testcase_13 AC 20 ms
4,348 KB
testcase_14 AC 85 ms
4,348 KB
testcase_15 AC 115 ms
4,348 KB
testcase_16 AC 34 ms
4,348 KB
testcase_17 AC 42 ms
4,348 KB
testcase_18 AC 171 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#include<atcoder/all>
using namespace atcoder;
using ll = long long;
ll a,b,c,k;
void solve(){
	for(int i = 0;i<k;i++){
		ll na = (b+c)/2;
		ll nb = (a+c)/2;
		ll nc = (a+b)/2;
		if(a==na&&b==nb&&c==nc){
			break;
		}
		a = na;
		b = nb;
		c = nc;
	}
	cout<<(a+b+c)<<endl;
}

signed main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int t;
	cin >> t;
	while(t--){
		cin >> a >> b >> c >> k;
		solve();
	}
}
0