NWERC 2020 was finally held this last weekend after a few month delay due to the pandemic. The format was a little different this time around, with each contestant participating from home (i.e. three computers per team) and having full read access to the internet during the contest.

We wanted to let you know that **this Saturday at 12:00 GMT** we will be hosting an open version of the contest on Kattis: https://open.kattis.com/contests/nwerc2020open

The problemset, solution slides, testdata and judges' solutions are already available on our website, but we ask that you please refrain from looking at them until the open contest is over. Good luck, and we hope you enjoy the problems!

This coincides with the div 1 codeforces round :(

That's unfortunate :( I don't think we can change the time now, sadly.

We had a solution to B that is very different from the jury's solution.

We define the function $$$f(i, d)$$$, which is given by

The answer is given by $$$f(0, \infty)$$$, and $$$f(n, d) = 0$$$ for all $$$d$$$.

Now, if $$$a[i] = 0$$$, then $$$f(i, d) = f(i+1, d+1)$$$.

Otherwise,

Then, $$$f(i, d) = f(i+1, d - (a[i] - 1)) + (a[i] - 1)$$$ + $$$a(i, d)$$$, where $$$a(i, d) = 0$$$ if $$$d \in [j_2 + (a[i] - 1), j_1 + (a[i] - 1) - 1]$$$, and $$$1$$$ otherwise.

These updates can be made in $$$\mathcal{O}(\log n)$$$, though our implementation was $$$\mathcal{O}(\log^2 n)$$$. Thus, total complexity is $$$\mathcal{O}(n \log n)$$$.

codeThe problems are available for upsolving on Kattis, but by popular demand we have also uploaded the contest to the Codeforces gym.