結果

問題 No.1137 Circles
ユーザー Sooh31
提出日時 2020-08-19 12:11:13
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 505 bytes
コンパイル時間 2,277 ms
コンパイル使用メモリ 193,252 KB
最終ジャッジ日時 2025-01-13 03:44:15
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;

const ll mod = 1000000007;
const int INF = 1001001001;

int main(){
    int n; cin >> n;
    vector<int> ans(500000,0);
    for(int i = 0; i < n; i++){
        int x, r; cin >> x >> r;
        x += 200000;
        ans[x-r]++;
        ans[x+r]--;
    }
    for(int i = 0; i < 450000; i++){
        ans[i+1] += ans[i];
    }
    int res = *max_element(ans.begin(), ans.end());
    cout << res << endl;
}
0