vector<int> countBits(int num) { vector<int> res; res.push_back(0); if(num==0)return res; res.push_back(1); for(int i=2;i<=num;i++) { int a=res[i/2]+res[i%2]; res.push_back(a); } return res; }