結果

問題 No.1137 Circles
ユーザー kokatsukokatsu
提出日時 2021-11-16 19:56:21
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 362 bytes
コンパイル時間 1,711 ms
コンパイル使用メモリ 199,948 KB
実行使用メモリ 4,980 KB
最終ジャッジ日時 2023-09-04 14:59:28
合計ジャッジ時間 3,556 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
4,940 KB
testcase_01 AC 50 ms
4,936 KB
testcase_02 AC 4 ms
4,900 KB
testcase_03 AC 27 ms
4,900 KB
testcase_04 AC 38 ms
4,908 KB
testcase_05 AC 9 ms
4,900 KB
testcase_06 AC 43 ms
4,896 KB
testcase_07 AC 22 ms
4,884 KB
testcase_08 AC 43 ms
4,564 KB
testcase_09 AC 16 ms
4,900 KB
testcase_10 AC 24 ms
4,964 KB
testcase_11 AC 28 ms
4,980 KB
testcase_12 AC 59 ms
4,884 KB
testcase_13 AC 17 ms
4,936 KB
testcase_14 AC 55 ms
4,944 KB
testcase_15 AC 19 ms
4,880 KB
testcase_16 AC 27 ms
4,888 KB
testcase_17 AC 6 ms
4,892 KB
testcase_18 AC 45 ms
4,884 KB
testcase_19 AC 18 ms
4,888 KB
testcase_20 AC 13 ms
4,896 KB
testcase_21 AC 4 ms
4,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

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

    int M = 2 * 10 ^^ 5;
    auto dp = new int[](M*2+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*2+1) {
        dp[i] += dp[i-1];

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

    res.writeln;
}
0