New_and_simple's blog

By New_and_simple, history, 5 hours ago, In English

Participated in the recent div4 contest. Got stuck in this problem CF 1003 div 4 C2 during the contest. The editorial used a left to right approach, I have used a meet at middle approach. What have I missed? I also learnt the modified binary search after the contest.

My code

It's not that I want to shove off my load to someone else, I can't access the problematic test case. Would appreciate help.

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

»
5 hours ago, # |
  Vote: I like it +1 Vote: I do not like it

Do you enter the contest?

  • »
    »
    5 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I did but performed bad. Only solved A which was free. Could have solved B too but I was greedy and jumped to C. Spent two hours, best I could come up with was a O(n2) solution, but it didn't work. My current one is O(nlogn) but it's getting WA on test 3.

»
43 minutes ago, # |
  Vote: I like it 0 Vote: I do not like it
1
4 1
3 6 1 2
5

Check for this testcase