arc060 a
arc060_a
2^50, so it's impossible.
Is it better to loose than to determine if it matches A for 2^50 streets?
But even 2^25 is a tough call, and the worst case is 2^49.
If we take the bottom frequency table as L, the top frequency table as U, and the number of zeros as Z, then Li x Ri x 2^Z.
To be -1 because it includes cases where no one card is selected.
computational complexity
Split by sign with N
Make a frequency table with DP in N^3
Frequency table collation with N^2
Official Explanation
The move to reduce the order was to make the objective "sum to zero" by drawing A, regardless of the number of cards
I counted the "sum to zero" by comparing the two frequency tables, but the official solution is to DP them together and look at the point where the sum reaches zero.
---
This page is auto-translated from /nishio/arc060 a. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.