The solution to HIRING is dp[i] += dp[j] if a[i] & a[j] = 0
Divide a mask into 2 parts, the first 8 bits and the last 8 bits. Then to calculate sum of submasks of a mask m, only care about submasks of the first 8 bits. And when adding to the preprocess array, only care about submasks of the last 8 bits. N * 2^8 should pass.
SAVEJEW: An obvious observation is we only prevent a theft if the item that was prevented from being stolen will never be stolen again. So for each item i, we want to know: If it exist at all times, what is the last heist it will be stolen? This can be easily done by binary search, and the complexity is O(N * log^2)