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

Parsa_Abolhassani's blog

By Parsa_Abolhassani, history, 4 hours ago, In English

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 :)

  • Vote: I like it
  • 0
  • Vote: I do not like it