結果

問題 No.2648 [Cherry 6th Tune D] 一次元の馬
ユーザー 👑 kakel-sankakel-san
提出日時 2024-02-23 21:32:35
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 178 ms / 2,000 ms
コード長 967 bytes
コンパイル時間 8,473 ms
コンパイル使用メモリ 157,496 KB
実行使用メモリ 205,956 KB
最終ジャッジ日時 2024-02-23 21:32:54
合計ジャッジ時間 15,896 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
32,676 KB
testcase_01 AC 152 ms
53,028 KB
testcase_02 AC 140 ms
53,156 KB
testcase_03 AC 139 ms
53,156 KB
testcase_04 AC 139 ms
51,032 KB
testcase_05 AC 140 ms
50,592 KB
testcase_06 AC 142 ms
48,292 KB
testcase_07 AC 139 ms
50,836 KB
testcase_08 AC 152 ms
46,268 KB
testcase_09 AC 136 ms
50,392 KB
testcase_10 AC 137 ms
50,492 KB
testcase_11 AC 138 ms
49,060 KB
testcase_12 AC 166 ms
49,956 KB
testcase_13 AC 140 ms
50,820 KB
testcase_14 AC 138 ms
50,296 KB
testcase_15 AC 165 ms
50,300 KB
testcase_16 AC 138 ms
50,300 KB
testcase_17 AC 137 ms
50,300 KB
testcase_18 AC 137 ms
50,300 KB
testcase_19 AC 139 ms
50,300 KB
testcase_20 AC 138 ms
50,300 KB
testcase_21 AC 138 ms
50,296 KB
testcase_22 AC 138 ms
50,296 KB
testcase_23 AC 153 ms
50,296 KB
testcase_24 AC 134 ms
50,296 KB
testcase_25 AC 134 ms
44,708 KB
testcase_26 AC 134 ms
50,296 KB
testcase_27 AC 136 ms
49,700 KB
testcase_28 AC 135 ms
50,332 KB
testcase_29 AC 138 ms
50,756 KB
testcase_30 AC 159 ms
50,328 KB
testcase_31 AC 134 ms
50,328 KB
testcase_32 AC 133 ms
50,328 KB
testcase_33 AC 133 ms
50,028 KB
testcase_34 AC 135 ms
50,328 KB
testcase_35 AC 178 ms
205,956 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (102 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 long[] NList => ReadLine().Split().Select(long.Parse).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var t = NN;
        var ans = new int[t];
        for (var u = 0; u < t; ++u)
        {
            var n = NN;
            var a = NList;
            var ok = 1_000_000_000;
            var ng = -1;
            while (ok - ng > 1)
            {
                var mid = (ok + ng) / 2;
                var flg = true;
                for (var i = 0L; i + 1 < n; ++i) if (a[i] + (i + 1) * mid >= a[i + 1] + (i + 2) * mid) flg = false;
                if (flg) ok = mid;
                else ng = mid;
            }
            ans[u] = ok;
        }
        WriteLine(string.Join("\n", ans));
    }
}
0