Rip_Van_Winkle's blog

By Rip_Van_Winkle, history, 9 years ago, In English

Why am i getting WA? my code here. Please help :(

Also i tried to find the editorial. But couldn't find any. Was the editorial ever published?

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

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

http://codeforces.net/blog/entry/6864. Here's the editorial, but it's on russian.

  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    thanks :) but the translator isn't so good :( can u plz explain the idea?

    • »
      »
      »
      9 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Let's use two arrays. le[i] = the leftmost index that the sequence a[le[i]], a[le[i] + 1], a[i] — decreases. re[i] = the rightmost index that the sequence a[i], a[i + 1], a[re[i]] — increases. A sequence l,r is ladder if (re[l] >= le[l]).