結果

問題 No.3039 配信者
ユーザー Atake-MKU
提出日時 2025-02-28 21:39:26
言語 JavaScript
(node v23.5.0)
結果
AC  
実行時間 1,777 ms / 2,000 ms
コード長 450 bytes
コンパイル時間 115 ms
コンパイル使用メモリ 6,944 KB
実行使用メモリ 243,780 KB
最終ジャッジ日時 2025-02-28 21:39:54
合計ジャッジ時間 17,523 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main(input) {
    const [[N, H], ...AB] = input.split("\n").map(e => e.split(" ").map(Number));
    let sum = new Array(H + 1).fill(0);
    for (let i = 0; i < N; i++) {
        const [A, B] = AB[i];
        sum[A]++;
        sum[B + 1]--; 
    }
    let now = 0;
    let max = 0;
    for (let i = 0; i <= H; i++) {
        now += sum[i];
        max = Math.max(now, max);
    }
    console.log(max);
}
Main(require("fs").readFileSync(0)+"")
0