#include #include #include #include #include #include using namespace std; typedef unsigned int u8; typedef int i8; const u8 MAX = 1e5+1; constexpr std::array initLog2(){ std::array log2{}; log2[1]=0; for(int i=2;i<=(int)MAX-1;i++){ log2[i]=log2[i/2]+1; } return log2; } class BitIntSet{ private: constexpr static const std::array log2=initLog2(); public: i8 data; explicit BitIntSet(i8 n):data{n}{ // checkLog2IsInitalized(); } int getLowbit()const{ return this->data&((~this->data)+1); } int getLowbit(u8 n)const{ return n&((~n)+1); } std::vector get1Dir()const{ std::vector ret; int temp=this->data; while(temp>0){ ret.push_back(log2[this->getLowbit()]); temp-=getLowbit(temp); } return ret; } }; int main(){ BitIntSet b(10); std::cout<