結果

問題 No.1137 Circles
ユーザー umezoumezo
提出日時 2020-07-28 03:42:48
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 436 bytes
コンパイル時間 2,131 ms
コンパイル使用メモリ 200,192 KB
実行使用メモリ 4,924 KB
最終ジャッジ日時 2023-09-11 06:18:14
合計ジャッジ時間 3,918 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,536 KB
testcase_01 AC 51 ms
4,616 KB
testcase_02 AC 4 ms
4,568 KB
testcase_03 AC 27 ms
4,924 KB
testcase_04 AC 38 ms
4,628 KB
testcase_05 AC 9 ms
4,672 KB
testcase_06 AC 45 ms
4,680 KB
testcase_07 AC 21 ms
4,620 KB
testcase_08 AC 46 ms
4,740 KB
testcase_09 AC 15 ms
4,736 KB
testcase_10 AC 23 ms
4,620 KB
testcase_11 AC 27 ms
4,680 KB
testcase_12 AC 57 ms
4,756 KB
testcase_13 AC 16 ms
4,576 KB
testcase_14 AC 55 ms
4,580 KB
testcase_15 AC 19 ms
4,576 KB
testcase_16 AC 28 ms
4,536 KB
testcase_17 AC 6 ms
4,592 KB
testcase_18 AC 46 ms
4,632 KB
testcase_19 AC 17 ms
4,684 KB
testcase_20 AC 13 ms
4,736 KB
testcase_21 AC 3 ms
4,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

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

int main(){
  int n;
  cin>>n;
  
  vector<int> A(400020);
  
  int x,r;
  rep(i,n){
    cin>>x>>r;
    
    x+=200000;
    A[x-r]++;
    A[x+r]--;
  }
  for(int i=1;i<400020;i++) A[i]+=A[i-1];
  
  int ma=0;
  rep(i,400020) ma=max(ma,A[i]);
  
  cout<<ma<<endl;
  
  return 0;
}
0