BZOJ 1192 鬼谷子的钱袋 (二进制思想)
题解:鉴于二进制的思想来划分
#include <cstdio>
int main(){
int n,d=0;scanf("%d",&n);
while(1<<d<=n)d++;
printf("%d\n",d);
}
愿你出走半生,归来仍是少年
题解:鉴于二进制的思想来划分
#include <cstdio>
int main(){
int n,d=0;scanf("%d",&n);
while(1<<d<=n)d++;
printf("%d\n",d);
}
愿你出走半生,归来仍是少年