結果

問題 No.91 赤、緑、青の石
ユーザー 👑 kakel-sankakel-san
提出日時 2023-10-21 23:42:42
言語 C#
(.NET 8.0.203)
結果
WA  
実行時間 -
コード長 928 bytes
コンパイル時間 9,633 ms
コンパイル使用メモリ 157,404 KB
実行使用メモリ 176,564 KB
最終ジャッジ日時 2023-10-21 23:42:56
合計ジャッジ時間 13,463 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
32,092 KB
testcase_01 AC 65 ms
32,092 KB
testcase_02 AC 66 ms
32,092 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 69 ms
32,092 KB
testcase_07 AC 70 ms
32,116 KB
testcase_08 AC 68 ms
32,116 KB
testcase_09 WA -
testcase_10 AC 66 ms
32,092 KB
testcase_11 AC 68 ms
32,092 KB
testcase_12 AC 77 ms
32,092 KB
testcase_13 AC 66 ms
32,092 KB
testcase_14 AC 67 ms
32,092 KB
testcase_15 AC 67 ms
32,092 KB
testcase_16 AC 68 ms
32,116 KB
testcase_17 AC 68 ms
32,116 KB
testcase_18 AC 67 ms
32,104 KB
testcase_19 AC 69 ms
32,104 KB
testcase_20 AC 69 ms
32,104 KB
testcase_21 AC 65 ms
32,104 KB
testcase_22 AC 70 ms
32,104 KB
testcase_23 AC 67 ms
32,104 KB
testcase_24 AC 65 ms
32,080 KB
testcase_25 AC 66 ms
32,080 KB
testcase_26 WA -
testcase_27 AC 77 ms
32,080 KB
testcase_28 AC 67 ms
32,080 KB
testcase_29 AC 71 ms
32,080 KB
testcase_30 AC 71 ms
32,080 KB
testcase_31 AC 71 ms
176,564 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (100 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;
            }
            if (more >= less * 2) ok = mid;
            else ng = mid;
        }
        WriteLine(ok);
    }
}
0