結果
| 問題 | No.2233 Average |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-03-03 23:11:14 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 482 bytes |
| 記録 | |
| コンパイル時間 | 1,698 ms |
| コンパイル使用メモリ | 190,560 KB |
| 最終ジャッジ日時 | 2025-02-11 04:19:19 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 18 |
コンパイルメッセージ
main.cpp: In function ‘void solve()’:
main.cpp:15:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
15 | scanf(" %lld %lld %lld %lld", &a, &b, &c, &k);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll calc(ll a, ll b, ll c, ll k) {
if (k == 0) {
return a + b + c;
}
if (a == b && b == c) {
return a * 3;
}
return calc((b+c) >> 2, (c + a) >> 2, (a + b) >> 2, k - 1);
}
void solve() {
ll a, b, c, k;
scanf(" %lld %lld %lld %lld", &a, &b, &c, &k);
printf("%lld\n", calc(a, b, c, k));
}
int main () {
int n;
cin >> n;
while (n--) {
solve();
}
}