Please read the new rule regarding the restriction on the use of AI tools. ×

LIS ON TUPLE?

Revision en4, by Parsa_Abolhassani, 2024-10-07 22:14:18

you are given N and in each line you are given a 3-tuple (xi, yi, zi) that -1e9 <= xi, yi, zi <=1e9 find the LIS of these 3-tuples

a 3-tuple A is greater than B if B1 < A1 and B2 < A2 and B3 < A3

N <= 200000

sample 1 :

5

1 2 3

3 1 2

1 2 2

1 1 1

6 7 8

output :

2

(1, 2, 3)-(6, 7, 8) or (3, 1, 2)-(6, 7, 8) are the LIS

please share your best solution :)

Tags lis, education, dp problem

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English Parsa_Abolhassani 2024-10-07 22:14:18 13
en3 English Parsa_Abolhassani 2024-10-07 22:13:51 4 Tiny change: 'ple 1 : \n5\n\n\n1' -> 'ple 1 : \n\n\n5\n\n\n1'
en2 English Parsa_Abolhassani 2024-10-07 22:07:34 12 Tiny change: 'than B if and only if B1 < A' -> 'than B if B1 < A'
en1 English Parsa_Abolhassani 2024-10-07 22:06:30 443 Initial revision (published)