結果

問題 No.1137 Circles
ユーザー tentententen
提出日時 2020-08-17 21:49:08
言語 Java21
(openjdk 21)
結果
AC  
実行時間 742 ms / 2,000 ms
コード長 542 bytes
コンパイル時間 2,663 ms
コンパイル使用メモリ 78,344 KB
実行使用メモリ 53,792 KB
最終ジャッジ日時 2024-04-19 19:08:24
合計ジャッジ時間 14,134 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
43,380 KB
testcase_01 AC 704 ms
53,792 KB
testcase_02 AC 199 ms
47,560 KB
testcase_03 AC 584 ms
49,516 KB
testcase_04 AC 658 ms
50,664 KB
testcase_05 AC 328 ms
49,284 KB
testcase_06 AC 646 ms
53,088 KB
testcase_07 AC 532 ms
49,756 KB
testcase_08 AC 637 ms
52,864 KB
testcase_09 AC 438 ms
49,912 KB
testcase_10 AC 568 ms
50,120 KB
testcase_11 AC 594 ms
49,752 KB
testcase_12 AC 742 ms
53,712 KB
testcase_13 AC 469 ms
49,580 KB
testcase_14 AC 729 ms
53,576 KB
testcase_15 AC 450 ms
49,504 KB
testcase_16 AC 510 ms
49,476 KB
testcase_17 AC 244 ms
48,668 KB
testcase_18 AC 640 ms
51,588 KB
testcase_19 AC 467 ms
49,428 KB
testcase_20 AC 412 ms
49,572 KB
testcase_21 AC 118 ms
42,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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