結果

問題 No.2233 Average
ユーザー 👑 kakel-sankakel-san
提出日時 2023-07-25 22:38:24
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 337 ms / 2,000 ms
コード長 771 bytes
コンパイル時間 1,099 ms
コンパイル使用メモリ 111,680 KB
実行使用メモリ 35,832 KB
最終ジャッジ日時 2024-04-10 14:04:19
合計ジャッジ時間 5,658 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
25,648 KB
testcase_01 AC 28 ms
25,128 KB
testcase_02 AC 28 ms
25,316 KB
testcase_03 AC 28 ms
25,316 KB
testcase_04 AC 29 ms
25,380 KB
testcase_05 AC 28 ms
25,444 KB
testcase_06 AC 28 ms
25,316 KB
testcase_07 AC 29 ms
27,356 KB
testcase_08 AC 204 ms
33,600 KB
testcase_09 AC 290 ms
33,052 KB
testcase_10 AC 233 ms
32,504 KB
testcase_11 AC 229 ms
32,244 KB
testcase_12 AC 198 ms
29,768 KB
testcase_13 AC 68 ms
31,528 KB
testcase_14 AC 175 ms
31,124 KB
testcase_15 AC 224 ms
33,796 KB
testcase_16 AC 87 ms
29,500 KB
testcase_17 AC 102 ms
29,780 KB
testcase_18 AC 337 ms
35,832 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