結果
問題 | No.2233 Average |
ユーザー |
|
提出日時 | 2023-03-03 21:51:22 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 174 ms / 2,000 ms |
コード長 | 460 bytes |
コンパイル時間 | 4,505 ms |
コンパイル使用メモリ | 251,268 KB |
最終ジャッジ日時 | 2025-02-11 02:22:18 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 18 |
ソースコード
#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();}}