sandeepgogarla61's blog

By sandeepgogarla61, history, 7 weeks ago, In English

Hi guys!

Problem Link : 1923C - Find B Submission : 248005674

My approach :

I have tried to calculate the minimum possible sum of subarray for every query range and compared it with actual sum of the subarray using prefix sum , My code passes sample test case but I'm unable to figure out why it is showing wrong answer for hidden testcases . Can anyone help me with this ?

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Think about "1".

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

For the same problem I had wrong answer on test 3 in the 59831st excepted "NO" found "YES" and I did not know why it is wrong until now this is my submission 247968754

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

When a number in C is not 1, it can be 1 in your good array, when it's 1 it can be 2. Speaking in a "greedy" manner obviously. You can build an auxiliary array like that and compare the sums in the subarrays using normal prefix sums. You can check my implementation : 248017967