結果

問題 No.2648 [Cherry 6th Tune D] 一次元の馬
ユーザー parukiparuki
提出日時 2024-03-02 23:46:35
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 1,079 ms / 2,000 ms
コード長 809 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 6,676 KB
実行使用メモリ 65,924 KB
最終ジャッジ日時 2024-03-02 23:46:47
合計ジャッジ時間 11,076 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
37,632 KB
testcase_01 AC 502 ms
55,196 KB
testcase_02 AC 179 ms
48,624 KB
testcase_03 AC 203 ms
49,392 KB
testcase_04 AC 210 ms
58,476 KB
testcase_05 AC 214 ms
64,876 KB
testcase_06 AC 216 ms
62,364 KB
testcase_07 AC 213 ms
64,620 KB
testcase_08 AC 210 ms
57,584 KB
testcase_09 AC 220 ms
65,132 KB
testcase_10 AC 238 ms
64,364 KB
testcase_11 AC 220 ms
58,348 KB
testcase_12 AC 226 ms
64,676 KB
testcase_13 AC 226 ms
65,260 KB
testcase_14 AC 196 ms
65,004 KB
testcase_15 AC 193 ms
65,004 KB
testcase_16 AC 207 ms
63,088 KB
testcase_17 AC 196 ms
65,004 KB
testcase_18 AC 194 ms
65,004 KB
testcase_19 AC 198 ms
65,004 KB
testcase_20 AC 196 ms
65,004 KB
testcase_21 AC 198 ms
65,260 KB
testcase_22 AC 200 ms
65,004 KB
testcase_23 AC 191 ms
65,004 KB
testcase_24 AC 207 ms
65,772 KB
testcase_25 AC 230 ms
57,068 KB
testcase_26 AC 202 ms
65,772 KB
testcase_27 AC 236 ms
65,644 KB
testcase_28 AC 204 ms
65,540 KB
testcase_29 AC 229 ms
65,924 KB
testcase_30 AC 210 ms
65,540 KB
testcase_31 AC 209 ms
65,540 KB
testcase_32 AC 203 ms
65,540 KB
testcase_33 AC 205 ms
65,900 KB
testcase_34 AC 205 ms
65,540 KB
testcase_35 AC 1,079 ms
62,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

Main(require("fs").readFileSync("/dev/stdin", "utf8").split("\n"));

function Main(lines) {
    const T = parseInt(lines[0]);
    for(let i=0; i<T; ++i) {
        const N = parseInt(lines[i*2+1]);
        const A = lines[i*2+2].split(" ").map(Number);

        // (l, r]
        let l = -1;
        let r = 1000000000;
        while(r-l>1) {
            let m = Math.floor((l+r)/2);
            let pre = -1;
            let ok = true;
            for(let i=0; i<N; ++i) {
                let cur = A[i] + m * (i+1);
                if(pre>=cur) {
                    ok = false;
                    break;
                }
                pre = cur;
            }
            if(ok) {
                r = m;
            } else {
                l = m;
            }
        }
        console.log(r);
    }
}
0