Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя roni123rohann

Автор roni123rohann, история, 15 месяцев назад, По-английски

Given N dolls of dimensions (wi,hi), i.e w corresponds to width of ith doll and hi corresponds to height of ith doll. Now we can stuff a doll with dimensions (wx,hx) inside another (wy,hy) if wx<wy and hx<hy. Also you cannot change the order i.e x<y. Now if we can stuff a doll A under doll B, then B is said to be increasing with respect to A. Find the largest increasing subsequence.

1<=N<=100000 1<= wi,hi<= 1e9

Note:This is similar to the problem "Russian doll Envelopes" from leetcode ,but with added constraints(order is forced).

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
15 месяцев назад, # |
  Проголосовать: нравится +11 Проголосовать: не нравится

SPOJ LIS2 Another Longest Increasing Subsequence Problem