dp, floyd, bitmask