Codeforces Round #384 (Div. 2) B. Chloe and the sequence 找规律
2016-12-15 14:03
615 查看
对于k,二进制数最后一个1在第t位的话,答案就是t+1
#include <cstdio> typedef long long ll; int n; ll k; int main() { scanf("%d%lld",&n,&k); int res=0; for (int i=0;i<=n;++i) if ((k>>i)&1) { res=i+1; break; } printf("%d\n",res); return 0; }
相关文章推荐
- Codeforces Round #384 B. Chloe and the sequence
- Codeforces Round #384 B. Chloe and the sequence
- Codeforces Round #384 B. Chloe and the sequence
- Codeforces Round #384 B. Chloe and the sequence
- Codeforces Round #384 B. Chloe and the sequence
- Codeforces Round #384 B. Chloe and the sequence
- Codeforces Round #384 B. Chloe and the sequence
- Codeforces Round #384 B. Chloe and the sequence
- Codeforces Round #384 B. Chloe and the sequence
- Codeforces Round #384 B. Chloe and the sequence
- Codeforces Round #384 B. Chloe and the sequence
- Codeforces Round #384 B. Chloe and the sequence
- Codeforces Round #384 B. Chloe and the sequence
- Codeforces Round #384 B. Chloe and the sequence
- Codeforces Round #384 (Div. 2)D. Chloe and pleasant prizes(树DP)
- Codeforces Round #195 (Div. 2) B. Vasily the Bear and Fly - 找规律
- Codeforces Round #250 (Div. 1) D. The Child and Sequence
- Codeforces Round #384 (Div. 2) D. Chloe and pleasant prizes
- Codeforces Round #250 (Div. 1) D. The Child and Sequence
- Codeforces Round #250 (Div. 1) D. The Child and Sequence