The 8th Zhejiang Provincial Collegiate Programming Contest->L - Javabeans
来源:互联网 发布:js数组去重复元素 编辑:程序博客网 时间:2024/04/28 03:42
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3498
题意:一共有n盒爪哇豆,每盒各有1到n个。每天可以选取某几盒,从中各吃掉x个。问最快几天可以吃完。
JAVA豆,采用二分的思想,二分法,每次将不小于n/2个javabeans的盒子拿出n/2个javabeans,
然后规模就小了一半,一直进行此操作,知道所有盒子的球为0为止 .(理解了就是水题了)
#include<stdio.h>int main(void) { int n,t; scanf("%d",&n); while(n--) { scanf("%d",&t); int tt=0; while(t) { tt++; t/=2; } printf("%d\n",tt); } return 0;}
0 0
- The 8th Zhejiang Provincial Collegiate Programming Contest / L - Javabeans
- The 8th Zhejiang Provincial Collegiate Programming Contest->L - Javabeans
- The 12th Zhejiang Provincial Collegiate Programming Contest - L
- The 8th Zhejiang Provincial Collegiate Programming Contest / M - Median
- The 8th Zhejiang Provincial Collegiate Programming Contest
- The 8th Zhejiang Provincial Collegiate Programming Contest-> Kagome Kagome
- The 8th Zhejiang Provincial Collegiate Programming Contest->M - Median
- The 7th Zhejiang Provincial Collegiate Programming Contest
- The 6th Zhejiang Provincial Collegiate Programming Contest
- The 9th Zhejiang Provincial Collegiate Programming Contest
- The 5th Zhejiang Provincial Collegiate Programming Contest 部分题解
- The 10th Zhejiang Provincial Collegiate Programming Contest Solution
- The 11th Zhejiang Provincial Collegiate Programming Contest---Talented Chef
- The 11th Zhejiang Provincial Collegiate Programming Contest
- The 11th Zhejiang Provincial Collegiate Programming Contest
- The 11th Zhejiang Provincial Collegiate Programming Contest
- The 11th Zhejiang Provincial Collegiate Programming Contest
- The 12th Zhejiang Provincial Collegiate Programming Contest
- Nginx+PHP服务器运行原理初探
- HDU 1711 KMP
- java 的堆栈问题
- 2014蓝桥杯 第五届 蚂蚁感冒
- 在Windows上基于VS2013搭建IT++库通信系统仿真平台(it++ 4.3.1&&vs2013)
- The 8th Zhejiang Provincial Collegiate Programming Contest->L - Javabeans
- Linux环境下numpy,scipy,matplotlib的安装
- 环境配置一:在Mac OS X下架设和使用Xcode的SVN版本管理环境
- android SQLite清空表并将自增列归零
- ZOJ 3499Median(数学)
- PyQt5 - QWidgets部件进阶教程之行编辑
- 把int转换为char把int转换为char(例)
- iOS开发进阶之旅-WebViewJavascriptBridge的使用
- ZOJ 3498Javabeans(数学)