题解 2103: 狂猎来袭

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

狂猎来袭-题解(C++代码)

```cpp#include#include#include#include#include#include#includeusingnamespacestd;typedeflonglongLL;constintINF=0x3f3f3f3f;constintMAXN=1e5+5;intarr[35];

狂猎来袭 (另一种解法)(C++代码)

#狂猎来袭题解##题目链接[https://www.dotcpp.com/oj/problem2103.html](https://www.dotcpp.com/oj/problem2103.html)##题目简介###题目描述>白狼杰洛特所居住的猎魔人城堡遭到狂猎入侵,

狂猎来袭-题解(C++代码)

#include#includeusingnamespacestd;voidfunc(intn){inta[1000];inti=0,m,p,j;intsum=0;while(n/2!=0){a[i]=n%2;i++;n=n/2;}a[i]=n;//存入最后一个数;m=i;p=0;//定义m为首1;p

狂猎来袭-题解(C++代码)

本题考查二进制数和十进制数的转换,可以使用bitset函数参考https://www.cnblogs.com/magisk/p/8809922.html对于一个叫做foo的bitset:-foo.size()返回大小(位数)-foo.count()返回1的个数-foo.any()返回是否有1-foo.