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

Автор sandeepgogarla61, история, 9 месяцев назад, По-английски

Hi guys!

Problem Link : 1923C - Найти 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 ?

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

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

Think about "1".

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

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

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

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