結果

問題 No.1137 Circles
ユーザー 小野寺健小野寺健
提出日時 2021-11-03 08:43:36
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,144 ms / 2,000 ms
コード長 224 bytes
コンパイル時間 51 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 25,344 KB
最終ジャッジ日時 2024-04-20 22:14:12
合計ジャッジ時間 12,011 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
12,160 KB
testcase_01 AC 1,020 ms
25,088 KB
testcase_02 AC 87 ms
12,032 KB
testcase_03 AC 510 ms
17,920 KB
testcase_04 AC 742 ms
21,248 KB
testcase_05 AC 168 ms
13,440 KB
testcase_06 AC 866 ms
21,888 KB
testcase_07 AC 390 ms
16,128 KB
testcase_08 AC 881 ms
22,912 KB
testcase_09 AC 278 ms
14,720 KB
testcase_10 AC 460 ms
17,536 KB
testcase_11 AC 523 ms
19,072 KB
testcase_12 AC 1,144 ms
25,344 KB
testcase_13 AC 306 ms
15,232 KB
testcase_14 AC 1,077 ms
25,344 KB
testcase_15 AC 336 ms
15,744 KB
testcase_16 AC 508 ms
19,072 KB
testcase_17 AC 122 ms
12,800 KB
testcase_18 AC 862 ms
22,272 KB
testcase_19 AC 319 ms
15,744 KB
testcase_20 AC 235 ms
14,464 KB
testcase_21 AC 76 ms
11,904 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i

coord = []

N.times {
	x, r = gets.split(" ").map{|s| s.to_i}
	coord << [x-r, 1]
	coord << [x+r, -1]
}

coord.sort!

cnt = 0
maxcnt = -1
coord.each{|x, d|
	cnt += d
	maxcnt = cnt if cnt > maxcnt
}

puts maxcnt
0