結果

問題 No.1137 Circles
ユーザー kokatsukokatsu
提出日時 2021-11-16 19:54:46
言語 D
(dmd 2.106.1)
結果
RE  
実行時間 -
コード長 358 bytes
コンパイル時間 2,112 ms
コンパイル使用メモリ 200,000 KB
実行使用メモリ 4,732 KB
最終ジャッジ日時 2023-09-04 14:59:20
合計ジャッジ時間 7,439 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
4,612 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 3 ms
4,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    int N;
    readf("%d\n", N);

    int M = 10 ^^ 5;
    auto dp = new int[](M*3+1);
    foreach (i; 0 .. N) {
        int x, r;
        readf("%d %d\n", x, r);

        ++dp[M+x-r], --dp[M+x+r];
    }

    int res;
    foreach (i; 1 .. M*3+1) {
        dp[i] += dp[i-1];

        res = max(res, dp[i]);
    }

    res.writeln;
}
0