結果
| 問題 |
No.1137 Circles
|
| ユーザー |
|
| 提出日時 | 2022-10-07 17:21:12 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 20 ms / 2,000 ms |
| コード長 | 482 bytes |
| コンパイル時間 | 1,687 ms |
| コンパイル使用メモリ | 194,816 KB |
| 最終ジャッジ日時 | 2025-02-07 22:41:10 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main(){
cin.tie(0);
ios::sync_with_stdio(0);
// (x-r, x+r)
int N; cin >> N;
int BASE = 2e5;
vector<int> sum(BASE + BASE + 1, 0);
rep(i,N) {
int x,r; cin >> x >> r;
sum[x - r + BASE]++, sum[x + r + BASE]--;
}
rep(i,BASE+BASE) sum[i + 1] += sum[i];
cout << *max_element(sum.begin(), sum.end()) << endl;
}