結果

問題 No.1137 Circles
ユーザー けーむけーむ
提出日時 2020-07-27 14:49:59
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 956 bytes
コンパイル時間 1,558 ms
コンパイル使用メモリ 164,948 KB
実行使用メモリ 4,856 KB
最終ジャッジ日時 2023-09-11 05:51:14
合計ジャッジ時間 2,844 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,676 KB
testcase_01 AC 21 ms
4,516 KB
testcase_02 AC 3 ms
4,580 KB
testcase_03 AC 12 ms
4,628 KB
testcase_04 AC 17 ms
4,664 KB
testcase_05 AC 5 ms
4,584 KB
testcase_06 WA -
testcase_07 AC 10 ms
4,572 KB
testcase_08 AC 19 ms
4,524 KB
testcase_09 WA -
testcase_10 AC 11 ms
4,692 KB
testcase_11 AC 12 ms
4,700 KB
testcase_12 AC 23 ms
4,664 KB
testcase_13 AC 8 ms
4,684 KB
testcase_14 AC 23 ms
4,572 KB
testcase_15 AC 9 ms
4,680 KB
testcase_16 WA -
testcase_17 AC 4 ms
4,524 KB
testcase_18 WA -
testcase_19 AC 8 ms
4,668 KB
testcase_20 AC 7 ms
4,576 KB
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())
#define endl "\n"

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll n;
    cin >> n;
    vector<ll> dp(2 * 1e5 + 2, 0);
    rep(i, n) {
        ll x, r;
        cin >> x >> r;
        x += 1e5;
        dp[max(0LL, x - r)]++;
        dp[min(sz(dp) - 1, x + r + 1)]--;
    }
    rep(i, sz(dp) - 1) dp[i + 1] += dp[i];
    ll ans = 0;
    rep(i, sz(dp)) ans = max(ans, dp[i]);
    cout << ans << endl;
    return 0;
}
0