Hd7's blog

By Hd7, history, 5 years ago, In English

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?

Tags #dp
  • Vote: I like it
  • 0
  • Vote: I do not like it