Изменения рейтингов за последние раунды временно удалены. Скоро они будут возвращены. ×

Блог пользователя The-Winner

Автор The-Winner, история, 3 часа назад, По-английски

Hello! I came up with the following problem, tried to solve it (faster than $$$O(N^2)$$$) and failed. I asked some other people (all much smarter than me) but neither of them could solve it.

The problem statement:

There is an array of positive integers. Count the number of even length subarrays such that the first half has the same sum as the second half.

Is it possible to solve this faster than $$$O(N^2)$$$? Maybe if we add additional constraints like the values are small or randomly generated (this one does not seem to help but I included it anyways). If it cannot be done faster than $$$O(N^2)$$$, could you provide a proof? Thank you for your time.

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

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

If the sum of all numbers is bounded by $$$C$$$, we can solve the problem in $$$O\left(\frac{nC} {64}\right) $$$ using bitsets.