c++ performance improvement

using vector<int> instead of bitset