Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

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

Автор tinymon, 6 лет назад, По-английски

Hi, Can someone help me with this problem from NOI.

Thanks for any help.

PS:ko_osaga can you provide hints as u already ACd it.

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

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

This is a system of difference constraints on the prefix sum of the sequence.

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

My idea might not be correct, but, still :

Consider l1 > l0. something like dp[n][k][0/1][0/1][0/1][0/1] which denotes, if we are processing the nth element, the range of 1's from n-l0 to n-l1, if there are k 1's in range n ... n-l0 and the [0/1] states basically determines some of the important values of the array, like n-l0, n-l0-1, n-l1, n-l1+1