結果

問題 No.2233 Average
ユーザー 👑 kakel-sankakel-san
提出日時 2023-07-25 22:26:10
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 294 ms / 2,000 ms
コード長 801 bytes
コンパイル時間 814 ms
コンパイル使用メモリ 114,324 KB
実行使用メモリ 34,984 KB
最終ジャッジ日時 2024-04-10 13:38:41
合計ジャッジ時間 4,963 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
27,172 KB
testcase_01 AC 26 ms
25,316 KB
testcase_02 AC 25 ms
23,216 KB
testcase_03 AC 26 ms
25,648 KB
testcase_04 AC 24 ms
27,180 KB
testcase_05 AC 25 ms
25,260 KB
testcase_06 AC 24 ms
27,436 KB
testcase_07 AC 26 ms
25,136 KB
testcase_08 AC 185 ms
29,380 KB
testcase_09 AC 267 ms
34,984 KB
testcase_10 AC 211 ms
34,288 KB
testcase_11 AC 208 ms
34,280 KB
testcase_12 AC 186 ms
33,724 KB
testcase_13 AC 60 ms
27,548 KB
testcase_14 AC 161 ms
33,032 KB
testcase_15 AC 209 ms
29,580 KB
testcase_16 AC 78 ms
29,480 KB
testcase_17 AC 90 ms
29,912 KB
testcase_18 AC 294 ms
33,400 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;
class Program
{
    static int NN => int.Parse(ReadLine());
    static long[] NList => ReadLine().Split().Select(long.Parse).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var t = NN;
        var ans = new long[t];
        for (var u = 0; u < t; ++u)
        {
            var p = NList;
            var (a, b, c) = (p[0], p[1], p[2]);
            for (var i = 0; i < p[3]; ++i)
            {
                if (a == b && b == c) break;
                (a, b, c) = ((b + c) / 2, (c + a) / 2, (a + b) / 2);
            }
            ans[u] = a + b + c;
        }
        WriteLine(string.Join("\n", ans));
    }
}
0