提出 #68531607


ソースコード 拡げる

function Main(inputText) {
    /** @type {String[][]} - スペース区切りと改行区切りをそのまま2次元配列に変えた状態 */
    const input = inputText.trim().split("\n").map(row => row.split(" "));
    /* ==== 本体 ==== */
    const N = +input[0][0];
    const R = [];
    const C = [];
    for (let i = 1; i <= N; i++) {
        R.push(+input[i][0]);
        C.push(+input[i][1]);
    }
    // Rの最大最小値の差、Cの最大最小値の差を求める
    R.sort((a, b) => a - b);
    C.sort((a, b) => a - b);
    const R_diff = R.at(-1) - R[0];
    const C_diff = C.at(-1) - C[0];
    const diff_max = Math.max(R_diff, C_diff);
    console.log(Math.ceil(diff_max / 2));
}
/* ==== これを書かないといけないらしい ==== */
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

提出情報

提出日時
問題 C - King's Summit
ユーザ AXT_AyaKoto
言語 JavaScript (Node.js 18.16.1)
得点 300
コード長 843 Byte
結果 AC
実行時間 326 ms
メモリ 138584 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 3
AC × 26
セット名 テストケース
Sample sample00.txt, sample01.txt, sample02.txt
All sample00.txt, sample01.txt, sample02.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt, testcase13.txt, testcase14.txt, testcase15.txt, testcase16.txt, testcase17.txt, testcase18.txt, testcase19.txt, testcase20.txt, testcase21.txt, testcase22.txt
ケース名 結果 実行時間 メモリ
sample00.txt AC 43 ms 42732 KiB
sample01.txt AC 40 ms 42720 KiB
sample02.txt AC 40 ms 42500 KiB
testcase00.txt AC 40 ms 42752 KiB
testcase01.txt AC 41 ms 42696 KiB
testcase02.txt AC 40 ms 42832 KiB
testcase03.txt AC 227 ms 95196 KiB
testcase04.txt AC 325 ms 138584 KiB
testcase05.txt AC 91 ms 66664 KiB
testcase06.txt AC 211 ms 135744 KiB
testcase07.txt AC 247 ms 109540 KiB
testcase08.txt AC 313 ms 136616 KiB
testcase09.txt AC 99 ms 62960 KiB
testcase10.txt AC 315 ms 137204 KiB
testcase11.txt AC 318 ms 137468 KiB
testcase12.txt AC 192 ms 91252 KiB
testcase13.txt AC 122 ms 68088 KiB
testcase14.txt AC 41 ms 42952 KiB
testcase15.txt AC 58 ms 50528 KiB
testcase16.txt AC 165 ms 84140 KiB
testcase17.txt AC 326 ms 137268 KiB
testcase18.txt AC 324 ms 137292 KiB
testcase19.txt AC 324 ms 138156 KiB
testcase20.txt AC 326 ms 137016 KiB
testcase21.txt AC 323 ms 137280 KiB
testcase22.txt AC 325 ms 136800 KiB