Chloe and the sequence
来源:互联网 发布:网络电缆 编辑:程序博客网 时间:2024/06/17 23:23
题目地址
题目大意:按照他的那个创造数组的方式,数第k个数是几。
思路:看他给的数组例子,会发现奇数时都是1,当去处1时奇数又都是2了,以此类推。
#include <cstdio>#include <cstring>#include <iostream>#include <string>#define ll long longusing namespace std;int n;ll k, cnt = 0;int main(){ cin >> n >> k; while(k) { cnt++; if(k % 2) { cout << cnt << endl; return 0; } k /= 2; } cout << cnt << endl; return 0;}
阅读全文
0 0
- Chloe and the sequence
- B. Chloe and the sequence
- Chloe and the sequence CodeForces
- Chloe and the sequence CodeForces
- Codeforces 743B Chloe and the sequence
- 743B. Chloe and the sequence codeforces
- Codeforces 743B-Chloe and the sequence
- ***CodeForces - 743B Chloe and the sequence
- 【47.40%】【codeforces 743B】Chloe and the sequence
- Codeforces Round #384 (Div. 2) B Chloe and the sequence
- codeforces 743 B Chloe and the sequence(递归)
- Codeforces Round #384 B. Chloe and the sequence
- codeforce B. Chloe and the sequence (递归)
- codeforces 743 B. Chloe and the sequence (规律题)
- Codeforces Round #384 (Div. 2) B. Chloe and the sequence
- Codeforces Round #384(Div. 2)B. Chloe and the sequence【思维+lowbit】
- Codeforces Round #384 (Div. 2) B. Chloe and the sequence 找规律
- Codeforces-743B-Chloe and the sequence(二进制思维题)
- property-placeholder源码解析
- JAVA薪资计算
- php.ini
- 11. Servlet 文件上传
- shell脚本
- Chloe and the sequence
- Unable to restore source lookup path
- vue动态添加class
- python 发送邮件(文字、表格、附件)
- AngularJS 服务(Service)
- c语言对执行文件的简单保护
- iOS远程控制问题,系统远端事件remoteControlReceivedWithEvent捕获不到的问题
- Android开发之路——文静小菜鸟要开始努力啦
- 提高PHP性能的实用方法+40个技巧优化您的PHP代码