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

Автор Vedhachala, история, 8 лет назад, По-английски

The problem link is http://www.spoj.com/problems/LIS2/

I used the nlogn algorithm for longest increasing subsequence. This is my code http://ideone.com/rmaQSE#

I am getting the correct answer for the sample test case given in the problem in g++11 compiler. But i am getting wrong answer #1 for my submission in spoj. could someone go through my code and tell me where i am going wrong!

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

»
8 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Check Brian Bi's answer to this: http://stackoverflow.com/questions/8716934/longest-increasing-subsequence-lis-with-two-numbers/8719900#8719900

I recommend you try think and find out what he means with a "staircase-like data structure"("coastline"). However I could try to explain it.