省赛热身赛之Javabeans
来源:互联网 发布:淘宝网比价 编辑:程序博客网 时间:2024/04/29 12:23
原题:
Description
Javabeans are delicious. Javaman likes to eat javabeans very much.
Javaman has n boxes of javabeans. There are exactly i javabeans in thei-th box (i = 1, 2, 3,...n). Everyday Javaman chooses an integerx. He also chooses several boxes where the numbers of javabeans are all at leastx. Then he eats x javabeans in each box he has just chosen. Javaman wants to eat all the javabeans up as soon as possible. So how many days it costs for him to eat all the javabeans?
Input
There are multiple test cases. The first line of input is an integer T ≈ 100 indicating the number of test cases.
Each test case is a line of a positive integer 0 < n < 231.
Output
For each test case output the result in a single line.
Sample Input
41234
Sample Output
1223
原码:
#include<stdio.h>int main(){ int n,a,t; scanf("%d",&n); while(n--) { a=0; scanf("%d",&t); while(t) { a++; t=t/2; } printf("%d\n",a); } return 0;}
- 省赛热身赛之Javabeans
- 省赛热身赛之Median
- 省赛热身赛之80ers' Memory
- 省赛热身赛之 K-Nice
- 省赛热身赛之Light Bulb
- 省赛热身赛之Ordinal Numbers
- 省赛热身赛之_Taxi Fare
- 省赛热身赛C
- zhejiang省赛热身赛之---周赛第二场
- 省赛热身赛之A Stack or A Queue?
- 2017省赛热身赛总结
- 省赛热身赛之——Yet Another Story of Rock-paper-scissors
- JSP之JavaBeans开发
- JSP之JavaBeans
- 三、JSP之JavaBeans
- 编程之美热身赛
- 编程之美热身赛
- 百度之星热身赛
- 程序员必知道的八大排序
- linux嵌入式系统下实现U盘、SD卡自…
- 我新开了CSDN新家
- 树链剖分小节
- 深入理解Resource 和Non-Resource
- 省赛热身赛之Javabeans
- Error about updating UI in background thread
- 一般网页宽度设置多少像素合适?
- drupal7 region.tpl.php 文件 及其 所用到的变量
- 一道C#面试题
- J2ME中Image加载失败的问题
- 查看应用程序依赖库
- 常见的C#单元测试工具介绍
- android proguard 使用 (一)