結果

問題 No.1137 Circles
ユーザー tnakao0123tnakao0123
提出日時 2020-07-31 00:32:29
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 905 bytes
コンパイル時間 670 ms
コンパイル使用メモリ 90,456 KB
実行使用メモリ 6,540 KB
最終ジャッジ日時 2023-09-18 09:18:45
合計ジャッジ時間 5,379 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
6,540 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 7 ms
6,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/* -*- coding: utf-8 -*-
 *
 * 1137.cc:  No.1137 Circles - yukicoder
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int R = 200000;
const int M = R * 2 * 2 + 1;

/* typedef */

/* global variables */

int cs[M];

/* subroutines */

/* main */

int main() {
  int n;
  scanf("%d", &n);

  for (int i = 0; i < n; i++) {
    int xi, ri;
    scanf("%d%d", &xi, &ri);
    xi *= 2, ri *= 2;
    cs[R + xi - ri + 1]++, cs[R + xi + ri]--;
  }

  int maxc = cs[0];
  for (int i = 1; i < M; i++) {
    cs[i] += cs[i - 1];
    if (maxc < cs[i]) maxc = cs[i];
  }

  printf("%d\n", maxc);


  return 0;
}
0