Need helps for Binary Flips problem on CSAcademy

Правка en1, от Hd7, 2019-07-01 21:07:24

I have read editorial all day but i can't figure out how it works. Could you give me a understandable explanation for this problem. Thanks in advance.
The problem link: https://csacademy.com/contest/archive/task/binary-flips/statement/
The Editorial link: https://csacademy.com/contest/archive/task/binary-flips/solution/
For me, i read editorial and think:
D(N,K,P) is the number of ways flips K times to construct a matrix with P columns all 1.
and when we discover $$$i\ col (all 1) * N + j\ row (all 1) * M - 2ij$$$ equals to S, we add D(N,K,i)* D(M,K,j) but i am pretty confused that: What guarantee K operations that construct i col 1 also construct j row 1. What wrong with my understand?

Теги #dp

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Hd7 2019-07-01 21:07:24 754 Initial revision (published)