結果

問題 No.1137 Circles
ユーザー trineutrontrineutron
提出日時 2020-07-31 01:46:43
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 2,168 ms
コンパイル使用メモリ 204,964 KB
実行使用メモリ 10,144 KB
最終ジャッジ日時 2023-09-18 13:22:54
合計ジャッジ時間 5,577 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 117 ms
9,672 KB
testcase_02 AC 3 ms
4,380 KB
testcase_03 AC 54 ms
7,012 KB
testcase_04 AC 85 ms
8,116 KB
testcase_05 AC 13 ms
4,380 KB
testcase_06 AC 97 ms
9,016 KB
testcase_07 AC 41 ms
6,072 KB
testcase_08 AC 103 ms
8,920 KB
testcase_09 AC 26 ms
5,240 KB
testcase_10 AC 48 ms
6,484 KB
testcase_11 AC 56 ms
6,840 KB
testcase_12 AC 137 ms
10,144 KB
testcase_13 AC 29 ms
5,432 KB
testcase_14 AC 129 ms
9,824 KB
testcase_15 AC 34 ms
5,648 KB
testcase_16 AC 57 ms
6,928 KB
testcase_17 AC 6 ms
4,376 KB
testcase_18 AC 99 ms
8,860 KB
testcase_19 AC 32 ms
5,560 KB
testcase_20 AC 22 ms
4,888 KB
testcase_21 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    map<int, int> m;
    for (int i = 0; i < n; i++) {
        int x, r;
        cin >> x >> r;
        m[x - r]++;
        m[x + r]--;
    }
    
    int incircle = 0, ans = 0;
    for (auto t : m) {
        int v = t.second;
        incircle += v;
        ans = max(ans, incircle);
    }
    cout << ans << endl;
}
0