結果

問題 No.1137 Circles
ユーザー firiexpfiriexp
提出日時 2020-11-29 15:29:12
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 786 bytes
コンパイル時間 984 ms
コンパイル使用メモリ 106,292 KB
実行使用メモリ 4,752 KB
最終ジャッジ日時 2023-10-11 02:27:23
合計ジャッジ時間 3,950 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 34 ms
4,352 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 17 ms
4,352 KB
testcase_04 AC 25 ms
4,372 KB
testcase_05 AC 5 ms
4,348 KB
testcase_06 WA -
testcase_07 AC 13 ms
4,352 KB
testcase_08 AC 31 ms
4,352 KB
testcase_09 WA -
testcase_10 AC 15 ms
4,348 KB
testcase_11 AC 17 ms
4,348 KB
testcase_12 AC 38 ms
4,752 KB
testcase_13 AC 10 ms
4,348 KB
testcase_14 AC 36 ms
4,416 KB
testcase_15 AC 11 ms
4,352 KB
testcase_16 WA -
testcase_17 AC 3 ms
4,352 KB
testcase_18 WA -
testcase_19 AC 11 ms
4,356 KB
testcase_20 AC 8 ms
4,352 KB
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;

int main() {
    int n;
    cin >> n;
    vector<pair<int, int>> v(2*n);
    for (int i = 0; i < n; ++i) {
        int x, r;
        scanf("%d %d", &x, &r);
        v[i] = {x-r, 1};
        v[i+n] = {x+r+1, -1};
    }
    sort(v.begin(),v.end());
    int ans = 0, cur = 0;
    for (int i = 0; i < 2*n; ++i) {
        cur += v[i].second;
        ans = max(ans, cur);
    }
    cout << ans << "\n";
    return 0;
}
0