I recently read somewhere that some DP solutions like knapsack can be optimised and the overall complexity can be reduced by a factor of 32 using std::bitset in C++.
Can someone explain this optimisation and the kinds of DP on which this works ?
# | User | Rating |
---|---|---|
1 | tourist | 3880 |
2 | jiangly | 3669 |
3 | ecnerwala | 3654 |
4 | Benq | 3627 |
5 | orzdevinwang | 3612 |
6 | Geothermal | 3569 |
6 | cnnfls_csy | 3569 |
8 | jqdai0815 | 3532 |
9 | Radewoosh | 3522 |
10 | gyh20 | 3447 |
# | User | Contrib. |
---|---|---|
1 | awoo | 161 |
1 | maomao90 | 161 |
3 | adamant | 156 |
4 | maroonrk | 153 |
5 | atcoder_official | 149 |
6 | -is-this-fft- | 148 |
6 | SecondThread | 148 |
8 | Petr | 147 |
9 | nor | 144 |
10 | TheScrasse | 143 |
I recently read somewhere that some DP solutions like knapsack can be optimised and the overall complexity can be reduced by a factor of 32 using std::bitset in C++.
Can someone explain this optimisation and the kinds of DP on which this works ?
Problem Link.
I've seen the public solutions but I am unable to understand them.
This is a game theory problem with Grundy Numbers but I am unable to break this game into smaller independent games in order to apply the Grundy theorem.
Can somebody please provide the solution with explanation ?
Name |
---|