結果

問題 No.1808 Fullgold Alchemist
ユーザー 👑 kakel-sankakel-san
提出日時 2023-12-21 22:12:14
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 947 bytes
コンパイル時間 6,622 ms
コンパイル使用メモリ 158,536 KB
実行使用メモリ 190,788 KB
最終ジャッジ日時 2023-12-21 22:12:28
合計ジャッジ時間 13,223 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
32,548 KB
testcase_01 AC 73 ms
32,548 KB
testcase_02 AC 73 ms
32,548 KB
testcase_03 AC 73 ms
32,548 KB
testcase_04 AC 72 ms
32,548 KB
testcase_05 AC 141 ms
45,908 KB
testcase_06 AC 130 ms
47,152 KB
testcase_07 AC 109 ms
47,152 KB
testcase_08 AC 118 ms
51,812 KB
testcase_09 AC 118 ms
51,812 KB
testcase_10 AC 118 ms
51,812 KB
testcase_11 AC 114 ms
49,420 KB
testcase_12 AC 110 ms
46,696 KB
testcase_13 AC 111 ms
46,696 KB
testcase_14 AC 112 ms
46,708 KB
testcase_15 AC 114 ms
46,696 KB
testcase_16 AC 76 ms
33,444 KB
testcase_17 AC 73 ms
32,548 KB
testcase_18 AC 82 ms
35,492 KB
testcase_19 AC 75 ms
32,932 KB
testcase_20 AC 86 ms
36,644 KB
testcase_21 AC 80 ms
34,340 KB
testcase_22 AC 73 ms
32,548 KB
testcase_23 AC 77 ms
33,956 KB
testcase_24 AC 74 ms
33,444 KB
testcase_25 AC 75 ms
33,444 KB
testcase_26 AC 80 ms
35,620 KB
testcase_27 AC 85 ms
36,772 KB
testcase_28 AC 118 ms
47,892 KB
testcase_29 AC 89 ms
38,692 KB
testcase_30 AC 87 ms
38,180 KB
testcase_31 AC 111 ms
46,492 KB
testcase_32 AC 104 ms
47,236 KB
testcase_33 AC 104 ms
44,448 KB
testcase_34 AC 112 ms
47,716 KB
testcase_35 AC 100 ms
190,788 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (96 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();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var c = NList;
        var (n, m) = (c[0], c[1]);
        var a = NList;
        var ok = 0;
        var ng = 1_000_000_001;
        while (ng - ok > 1)
        {
            var mid = (ok + ng) / 2;
            var t = 0L;
            var flg = true;
            for (var i = 0; i < n; ++i)
            {
                t += a[i] - mid;
                if (t < 0)
                {
                    flg = false;
                    break;
                }
            }
            if (flg) ok = mid;
            else ng = mid;
        }
        WriteLine(ok / m);
    }
}
0