Can anyone help me solve this problem?

Правка en1, от jarvis_yash, 2023-10-06 02:00:36

each Person has two attibutes A , B

for two diffirent persons i and j Ai<=Aj && Bi<=Bj then ith person is considered as inferior person & ith person will be removed from list if i and j have equal to case then one of them is removed from list this operation is executed when new Person is added to the list

there are two types of queries

1: add Ai,Bi to the list 2: show size of list

1<=N<=1e5 1<=Ai,Bi<=1e9

Sample Test Case:

5 
1 1 3
1 2 1
2
1 2 2
2

Output:

2 
2
Теги query, greedy

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский jarvis_yash 2023-10-06 02:00:36 578 Initial revision (published)