結果

問題 No.1137 Circles
ユーザー 🍮かんプリン🍮かんプリン
提出日時 2020-07-29 01:36:33
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 560 bytes
コンパイル時間 1,152 ms
コンパイル使用メモリ 144,596 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-11 06:58:17
合計ジャッジ時間 2,839 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 48 ms
4,376 KB
testcase_02 AC 3 ms
4,376 KB
testcase_03 AC 26 ms
4,376 KB
testcase_04 AC 37 ms
4,376 KB
testcase_05 AC 8 ms
4,376 KB
testcase_06 AC 42 ms
4,376 KB
testcase_07 AC 20 ms
4,376 KB
testcase_08 AC 43 ms
4,380 KB
testcase_09 AC 15 ms
4,380 KB
testcase_10 AC 23 ms
4,376 KB
testcase_11 AC 26 ms
4,380 KB
testcase_12 AC 55 ms
4,376 KB
testcase_13 AC 16 ms
4,376 KB
testcase_14 AC 52 ms
4,376 KB
testcase_15 AC 17 ms
4,376 KB
testcase_16 AC 27 ms
4,376 KB
testcase_17 AC 5 ms
4,380 KB
testcase_18 AC 43 ms
4,380 KB
testcase_19 AC 16 ms
4,376 KB
testcase_20 AC 12 ms
4,380 KB
testcase_21 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
 *   @FileName	a.cpp
 *   @Author	kanpurin
 *   @Created	2020.07.29 01:36:27
**/

#include "bits/stdc++.h" 
using namespace std; 
typedef long long ll;

int main() {
    int n;
    cin >> n;
    vector< int > d(200001,0);
    for (int i = 0; i < n; i++) {
        int x, r;
        cin >> x >> r;
        d[max(0, x + 100000 - r)]++;
        if (x + r <= 100000) d[x + 100000 + r]--;
    }
    int ans = d[0];
    for (int i = 0; i < 200000; i++) {
        d[i + 1] += d[i];
        ans = max(ans, d[i + 1]);
    }
    cout << ans << endl;
    return 0;
}
0