Submission #18298133


Source Code Expand

Copy
import bisect

N = int(input())

circle = [list(map(int, input().split())) for _ in range(N)]

left_right = []
for i in range(N):
    left_right.append([circle[i][0] - circle[i][1], circle[i][0] + circle[i][1]])

left_right.sort(key=lambda lr: -lr[1])
left_right.sort(key=lambda lr: -lr[0])

dp = [float('inf')] * N

for i in range(N):
    dp[bisect.bisect_left(dp, left_right[i][1])] = left_right[i][1]

print(bisect.bisect_left(dp, float('inf')))


Submission Info

Submission Time
Task K - ターゲット
User oniku
Language PyPy3 (7.3.0)
Score 5
Code Size 472 Byte
Status AC
Exec Time 505 ms
Memory 104804 KB

Judge Result

Set Name All
Score / Max Score 5 / 5
Status
AC × 10
Set Name Test Cases
All 00, 01, 02, 03, 04, 05, 06, 07, 90, 91
Case Name Status Exec Time Memory
00 AC 496 ms 104604 KB
01 AC 498 ms 104804 KB
02 AC 492 ms 104592 KB
03 AC 505 ms 104444 KB
04 AC 480 ms 104384 KB
05 AC 487 ms 104792 KB
06 AC 294 ms 104296 KB
07 AC 282 ms 104396 KB
90 AC 54 ms 61996 KB
91 AC 52 ms 62104 KB