結果

問題 No.1137 Circles
ユーザー tenten
提出日時 2020-08-17 21:49:08
言語 Java
(openjdk 27 + ACL)
コンパイル:
javac -J-Duser.language=en -encoding UTF8 -cp /opt/aclib/ac_library.jar _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true -cp .:/opt/aclib/ac_library.jar _class_
結果
AC  
実行時間 607 ms / 2,000 ms
+ 127µs
コード長 542 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,709 ms
コンパイル使用メモリ 91,008 KB
実行使用メモリ 73,244 KB
最終ジャッジ日時 2026-10-19 07:09:43
合計ジャッジ時間 13,517 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge6_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.util.*;

public class Main {
    static final int BASE = 100000;
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] imos = new int[BASE * 4 + 1];
		for (int i = 0; i < n; i++) {
		    int x = sc.nextInt();
		    int r = sc.nextInt();
		    imos[x + BASE * 2 - r]++;
		    imos[x + BASE * 2 + r]--;
		}
		int max = imos[0];
		for (int i = 1; i < imos.length; i++) {
		    imos[i] += imos[i - 1];
		    max = Math.max(max, imos[i]);
		}
		System.out.println(max);
	}
}
0