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

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

Hi, I'm really perplexed by this problem. If anyone could give me pointers, that would be greatly appreciated.

My submission is http://codeforces.com/contest/446/submission/33328941 and it failed on problem 41. I'm really confused on how the answer could be 4. The possible subsegments of length 4 created from [7 2 3 1 4 5] are [7 2 3 1] [2 3 1 4] [3 1 4 5] and none of them can be turned into strictly increasing arrays when changing only up to one element.

Maybe I totally misinterpreted the problem but if that's the case, I don't know how I manged to get 40 problems correct...

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

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

In this problem you need to find the maximum length of subsegment which will be an increasing subsegment after removal of one element. In the above case:

[7 2 3 1 4 5] — > [2 3 1 4 5]

Here, after removing 1 you get an increasing subsegment [2 3 4 5] so the answer should be 4.

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

You can change 3 to 0 and it will be a strictly increasing sequence of length 4.

[0 1 4 5]