Codeforces и Polygon могут быть недоступны в период с 23 мая, 7:00 (МСК) по 23 мая, 11:00 (МСК) в связи с проведением технических работ. ×

Understanding the jury's solution in 543A — Writing Code (#302, Div1A, Div2C)

Правка en2, от marlonbymendes, 2016-10-26 06:55:46

For the following problem 543A - Writing Code, the jury's solution 11035704 optimize the DP solution explained in the contest's editorial http://codeforces.com/blog/entry/17773.

I understood the approach explained in the editorial, but what's the intuition behind the optimization and how it works? Specially the lines with bitwise operations:

    int i = it & 1;
        ...
        z[i][j][k] = z[i ^ 1][j][k];
  ...
    ans += z[n & 1][bl][i];
  ...

Thanks.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский marlonbymendes 2016-10-26 07:14:51 280
en3 Английский marlonbymendes 2016-10-26 06:56:26 14
en2 Английский marlonbymendes 2016-10-26 06:55:46 4
en1 Английский marlonbymendes 2016-10-26 06:54:42 574 Initial revision (published)