akashAgrawal's blog

By akashAgrawal, history, 3 years ago, In English

Problem — https://cses.fi/problemset/task/1163 13

I am not getting this problem. I think the sample output is incorrect!

Input: 8 3 3 6 2

Output: 5 3 3

According to the sample, the input answer should be: 5 3 2 but the sample output is 5 3 3

Demonstration:

0 1 2 3 4 5 6 7 8 ! ! ! I mean after adding 2 how the longest path without traffic light is 3 and not 2? Somebody, please help. Is there a catch that I am losing?

Full text and comments »

  • Vote: I like it
  • +6
  • Vote: I do not like it