, State compression dp:
For this we introduce compressed binary state, because any number can be a binary representation, but on every binary representation can represent the current location if there are elements, which constitute the state of compression.
For this problem, up and down & click on the line.
Shaped pressure ;
To determine whether the attack: Current & direct, and look left & right shift and look &
Bit computing tips:
Enumeration of the subsets s;
dp optimization:
It looked like a monotonous queue QWQ.