Submission #2489122


Source Code Expand

Copy
from operator import itemgetter
N = int(input())
A = []
B = []
for i in range(N):
u, v = map(int, input().split())
A.append((u, v))
for i in range(N):
u, v = map(int, input().split())
B.append((u, v))
A.sort()
B.sort()
num = 0
for i in range(N):
K = [A[k] for k in range(len(A)) if (A[k][0] <B[i][0]) and (A[k][1] < B[i][1])]
if K:
num += 1
t = sorted(K, key=itemgetter(1))[-1]
A.remove(t)
print(num)
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
from operator import itemgetter
N = int(input())
A = []
B = []
for i in range(N):
    u, v = map(int, input().split())
    A.append((u, v))
for i in range(N):
    u, v = map(int, input().split())
    B.append((u, v))
A.sort()
B.sort()
num = 0
for i in range(N):
    K = [A[k] for k in range(len(A)) if (A[k][0] <B[i][0]) and (A[k][1] < B[i][1])]
    if K:
        num += 1
        t = sorted(K, key=itemgetter(1))[-1]
        A.remove(t)
print(num)

Submission Info

Submission Time
Task C - 2D Plane 2N Points
User okumura
Language Python (3.4.3)
Score 400
Code Size 467 Byte
Status AC
Exec Time 20 ms
Memory 3064 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 5
AC × 17
Set Name Test Cases
Sample example_0, example_1, example_2, example_3, example_4
All example_0, example_1, example_2, example_3, example_4, line_0, line_1, line_2, line_3, maxrand_0, maxrand_1, maxrand_2, maxrand_3, maxrand_4, rand_0, rand_1, rand_2
Case Name Status Exec Time Memory
example_0 AC 18 ms 3064 KB
example_1 AC 18 ms 3064 KB
example_2 AC 18 ms 3064 KB
example_3 AC 18 ms 3064 KB
example_4 AC 18 ms 3064 KB
line_0 AC 18 ms 3064 KB
line_1 AC 20 ms 3064 KB
line_2 AC 18 ms 3064 KB
line_3 AC 18 ms 3064 KB
maxrand_0 AC 19 ms 3064 KB
maxrand_1 AC 19 ms 3064 KB
maxrand_2 AC 20 ms 3064 KB
maxrand_3 AC 20 ms 3064 KB
maxrand_4 AC 19 ms 3064 KB
rand_0 AC 20 ms 3064 KB
rand_1 AC 19 ms 3064 KB
rand_2 AC 19 ms 3064 KB


2025-04-08 (Tue)
03:02:55 +00:00