We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2298b4d commit bfde30dCopy full SHA for bfde30d
1 file changed
live11/test114/문제2/박희경.py
@@ -0,0 +1,23 @@
1
+import sys
2
+
3
4
+input = sys.stdin.readline
5
6
+n = int(input())
7
+radius = []
8
+for _ in range(n):
9
+ x, r = map(int, input().split())
10
+ radius.append((x-r, x+r))
11
12
+radius.sort()
13
+flag = 'YES'
14
+for i in range(len(radius) - 1):
15
+ if radius[i][0] < radius[i+1][0]:
16
+ if radius[i][1] > radius[i+1][1]: # 안에 있는 경우
17
+ continue
18
+ else:
19
+ flag = 'NO'
20
+ if radius[i][1] < radius[i+1][0]:
21
22
23
+print(flag)
0 commit comments