#include<iostream> (5488)#include<algorithm> using namespace std; int t,n,cnt; int main(){ cin >> t; int nowm;//nowm表示现在最长绳长 for(int i = 1; i <= t; i++){ cin >> n; cnt = 1;//第一天啥也不干 nowm = n; while(nowm > 1){ if(nowm%2==0){//只考虑最长的那部分 nowm = nowm/2; } else{ nowm = nowm / 2 +1; } cnt ++; } cout << cnt << endl; } return 0; }
点赞 评论

相关推荐

07-02 13:52
武汉大学 golang
骗你的不露头也秒
牛客87776816...:😃查看图片
点赞 评论 收藏
分享
头顶尖尖的程序员:我也是面了三四次才放平心态的。准备好自我介绍,不一定要背熟,可以记事本写下来读。全程控制语速,所有问题都先思考几秒,不要急着答,不要打断面试官说话。
点赞 评论 收藏
分享
07-01 19:00
门头沟学院 Java
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务