結果

問題 No.91 赤、緑、青の石
ユーザー 👑 kakel-sankakel-san
提出日時 2023-10-21 23:43:39
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 80 ms / 5,000 ms
コード長 930 bytes
コンパイル時間 6,878 ms
コンパイル使用メモリ 157,296 KB
実行使用メモリ 176,620 KB
最終ジャッジ日時 2023-10-21 23:43:52
合計ジャッジ時間 10,497 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
32,168 KB
testcase_01 AC 76 ms
32,168 KB
testcase_02 AC 75 ms
32,168 KB
testcase_03 AC 76 ms
32,168 KB
testcase_04 AC 76 ms
32,168 KB
testcase_05 AC 80 ms
32,168 KB
testcase_06 AC 76 ms
32,168 KB
testcase_07 AC 75 ms
32,192 KB
testcase_08 AC 76 ms
32,192 KB
testcase_09 AC 75 ms
32,192 KB
testcase_10 AC 76 ms
32,168 KB
testcase_11 AC 76 ms
32,168 KB
testcase_12 AC 76 ms
32,168 KB
testcase_13 AC 76 ms
32,168 KB
testcase_14 AC 76 ms
32,168 KB
testcase_15 AC 77 ms
32,168 KB
testcase_16 AC 77 ms
32,192 KB
testcase_17 AC 77 ms
32,192 KB
testcase_18 AC 77 ms
32,192 KB
testcase_19 AC 78 ms
32,192 KB
testcase_20 AC 77 ms
32,192 KB
testcase_21 AC 76 ms
32,192 KB
testcase_22 AC 76 ms
32,192 KB
testcase_23 AC 76 ms
32,192 KB
testcase_24 AC 76 ms
32,168 KB
testcase_25 AC 76 ms
32,168 KB
testcase_26 AC 77 ms
32,168 KB
testcase_27 AC 76 ms
32,168 KB
testcase_28 AC 76 ms
32,168 KB
testcase_29 AC 76 ms
32,168 KB
testcase_30 AC 76 ms
32,168 KB
testcase_31 AC 78 ms
176,620 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (101 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static int NN => int.Parse(ReadLine());
    static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var c = NList;
        var ok = 0;
        var ng = 100_000_000;
        while (ng - ok > 1)
        {
            var mid = (ok + ng) / 2;
            var less = 0;
            var more = 0;
            for (var i = 0; i < c.Length; ++i)
            {
                if (mid >= c[i]) less += mid - c[i];
                else more += (c[i] - mid) / 2;
            }
            if (more >= less) ok = mid;
            else ng = mid;
        }
        WriteLine(ok);
    }
}
0