結果

問題 No.2233 Average
ユーザー 👑 chro_96chro_96
提出日時 2023-03-03 21:38:41
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 574 bytes
コンパイル時間 503 ms
コンパイル使用メモリ 29,208 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-18 01:34:48
合計ジャッジ時間 2,118 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 42 ms
4,348 KB
testcase_09 AC 64 ms
4,348 KB
testcase_10 AC 46 ms
4,348 KB
testcase_11 AC 45 ms
4,348 KB
testcase_12 AC 39 ms
4,348 KB
testcase_13 AC 9 ms
4,348 KB
testcase_14 AC 35 ms
4,348 KB
testcase_15 AC 48 ms
4,348 KB
testcase_16 AC 14 ms
4,348 KB
testcase_17 AC 18 ms
4,348 KB
testcase_18 AC 71 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main () {
  int t = 0;
  long long a = 0LL;
  long long b = 0LL;
  long long c = 0LL;
  long long k = 0LL;
  
  int res = 0;
  
  res = scanf("%d", &t);
  while (t > 0) {
    res = scanf("%lld", &a);
    res = scanf("%lld", &b);
    res = scanf("%lld", &c);
    res = scanf("%lld", &k);
    while (k > 0LL && (a != b || b != c)) {
      long long na = (b+c)/2LL;
      long long nb = (c+a)/2LL;
      long long nc = (a+b)/2LL;
      a = na;
      b = nb;
      c = nc;
      k -= 1LL;
    }
    printf("%lld\n", a+b+c);
    t--;
  }
  
  return 0;
}
0