結果

問題 No.1137 Circles
ユーザー furafura
提出日時 2020-07-26 23:49:22
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 351 bytes
コンパイル時間 2,047 ms
コンパイル使用メモリ 199,192 KB
実行使用メモリ 6,320 KB
最終ジャッジ日時 2023-09-11 05:21:18
合計ジャッジ時間 3,756 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,084 KB
testcase_01 AC 26 ms
6,152 KB
testcase_02 AC 5 ms
6,204 KB
testcase_03 AC 15 ms
6,076 KB
testcase_04 AC 21 ms
6,248 KB
testcase_05 AC 8 ms
6,320 KB
testcase_06 AC 24 ms
6,244 KB
testcase_07 AC 14 ms
6,204 KB
testcase_08 AC 23 ms
6,160 KB
testcase_09 AC 9 ms
6,252 KB
testcase_10 AC 14 ms
6,116 KB
testcase_11 AC 17 ms
6,244 KB
testcase_12 AC 28 ms
6,228 KB
testcase_13 AC 10 ms
6,084 KB
testcase_14 AC 27 ms
6,240 KB
testcase_15 AC 11 ms
6,156 KB
testcase_16 AC 15 ms
6,128 KB
testcase_17 AC 5 ms
6,124 KB
testcase_18 AC 23 ms
6,316 KB
testcase_19 AC 11 ms
6,128 KB
testcase_20 AC 10 ms
6,264 KB
testcase_21 AC 5 ms
6,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

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

	vector<int> cum(800001);
	rep(i,n){
		int x,r; scanf("%d%d",&x,&r);
		cum[400000+2*(x-r)+1]++;
		cum[400000+2*(x+r)]--;
	}
	rep(x,800000) cum[x+1]+=cum[x];

	printf("%d\n",*max_element(cum.begin(),cum.end()));

	return 0;
}
0