Snail’s trouble
Snail’s trouble |
Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) |
Total Submission(s): 74 Accepted Submission(s): 51 |
Problem Description
Once upon a time, there was a poor snail. Every day, it tried very hard to crawl forward, while there was a keeper who’d like to maltreat this poor little snail. The snail was crawling on a one-meter rubber band at first, and it can move on k cm every minute. But after that, the keeper stretches the rubber band quickly, and it would be elongated one meter, during that the distances ratio between the snail and the two endpoints remain unchanged. In the next minute, little snail tried to keep moving forward again.
“Can I finally get to the endpoint?” The snail often asked himself such a question because he was afraid he would never succeed. Now, we hope you can tell this poor snail when he would reach the endpoint. |
Input
Every line of the input contains an integer number k, indicating that the snail moved forward k cm every minute. (5 <= k <= 100)
|
Output
Output an integer t, indicating that the snail doesn’t get to the endpoint until t-1 minutes later, while t minutes later, it finally succeed.
|
Sample Input
10 |
Sample Output
12367 |
Source
2009 Multi-University Training Contest 2 - Host by TJU
|
Recommend
gaojie
|
/*
题意:一个蜗牛初始的时候在一块长1米的橡胶上,速度为一分钟k厘米,在每分钟的末尾橡胶会很快的
拉长一米,但是蜗牛在橡胶上的比例位置不变。蜗牛第一次到达末尾的时间是多少 初步思路:简单的模拟嘛,但是很好时间,所以就打表
*/
#include<bits/stdc++.h>
using namespace std;
int n;
int a[]={,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,};
int main(){
// freopen("in.txt","r",stdin);
// for(int n=5;n<=100;n++){
// int t=0;
// double sum=100;
// double w=0;
// while(true){
// t++;
// w+=n;//蜗牛走的
// if(w>=sum){
// cout<<t<<",";
// break;
// }
// double tmp=sum+100;
// w=tmp*w*1.0/sum;
// sum=tmp;
// }
// }
while(scanf("%d",&n)!=EOF){
printf("%d\n",a[n-]);
}
return ;
}
Snail’s trouble的更多相关文章
- 【BZOJ-1863】trouble 皇帝的烦恼 二分 + DP
1863: [Zjoi2006]trouble 皇帝的烦恼 Time Limit: 1 Sec Memory Limit: 64 MBSubmit: 559 Solved: 295[Submit] ...
- 快速幂 --- CSU 1556: Jerry's trouble
Jerry's trouble Problem's Link: http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1556 Mean: 略. ana ...
- HDU 4334 Trouble (暴力)
Trouble Time Limit: 5000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u Submit Statu ...
- The trouble of Xiaoqian
The trouble of Xiaoqian Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Oth ...
- Linux 常见的trouble shooting故障排错
Linux 常见的trouble shooting故障排错 备份开机所必须运行的程序对一个运维人员来说是非常有必要的.在实际生产环境中,系统和数据基本都是安装在不同的硬盘上面,因为企业最关心的还是数据 ...
- HDU 4334 Trouble
Trouble Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Su ...
- 【BZOJ】【1863】【ZJOI2006】trouble 皇帝的烦恼
二分+DP Orz KuribohG 神题啊= = 满足单调性是比较显然的…… 然而蒟蒻并不会判断能否满足……QwQ 神一样的DP姿势:f[i]表示第 i 个与第1个最多有多少个相同,g[i]表示最少 ...
- UVA 10497 - Sweet Child Makes Trouble 高精度DP
Children are always sweet but they can sometimes make you feel bitter. In this problem, you will see ...
- 【DP/二分】BZOJ 1863:[Zjoi2006]trouble 皇帝的烦恼
863: [Zjoi2006]trouble 皇帝的烦恼 Time Limit: 1 Sec Memory Limit: 64 MBSubmit: 465 Solved: 240[Submit][ ...
随机推荐
- Sublime Text 3 全程详细图文原创教程
Sublime Text 3 全程详细图文原创教程(持续更新中...) 一. 前言 使用Sublime Text 也有几个年头了,版本也从2升级到3了,但犹如寒天饮冰水,冷暖尽自知.最初也是不知道从何 ...
- 前端系列——jquery前端国际化解决方案“填坑日记”
前言:最近,新的平台还没有开发完成,原来的老项目又提出了新的需求:系统国际化.如果是前后端完全分离的开发模式,要做国际化,真的太简单了,有现成的解决方案,基于Node构建的时下热门的任何一种技术选型都 ...
- Python 接口测试(五)
五:使用python进行组织编写接口测试用例 接口测试其实就是几个步骤. 拿到接口的url地址 查看接口是用什么方式发送 添加请求头,请求体 发送查看返回结果,校验返回结果是否正确 明白了接口测试的测 ...
- GCD之并行串行区别
1.用户自定义线程队列,创建时很容易创建 注意创建时的第一个参数:标记值,方便调试查看 1 2 dispatch_queue_t serialqueue=dispatch_queue_create(& ...
- servlet生成验证码
1.因为朋友们都说现在很少用java自带的图形用户接口,所以小白的我就没去看awt和swing组件,因为要抓紧时间学习后面的,完了出去找工作,等以后再回来了解awt和swing:所以制作验证码的代码是 ...
- 学习如何看懂SQL Server执行计划(一)——数据查询篇
一.数据查询部分 1. 看到执行计划有两种方式,对sql语句按Ctrl+L,或按Ctrl+M打开显示执行计划窗口每次执行sql都会显示出相应的执行计划 2. 执行计划的图表是从右向左看的 3. SQL ...
- FPGA在其他领域的应用(四)
工业领域: 从工厂和过程自动化到能源基础设施和机器视觉系统,工业产品有助于改善我们的世界.产品必须安全.可靠.适应性强,而且耐用.同时,商业成功要求你在激烈竞争的市场中行动迅速,同时降低总成本. 英特 ...
- HDU2089 暴力打表
62的判断就是倒过来没有26 hdu2089 #include<cstdio> #include<cstdlib> #include<iostream> #incl ...
- 第七章 DAO模式
第七章 DAO模式 一.JDBC的封装 1.JDBC的封装: DAO位于业务逻辑和持久化数据之间,实现对持久化数据的访问.将数据库都封装起来,对外提供相应的接口 2.DAO模式的作用: 1.隔离业务逻 ...
- 关于master..xp_cmdshell’的几个错误_解决办法(转)
错误一:Error Message:未能找到存储过程 'master..xp_cmdshell'. 第一步先删除:drop procedure sp_addextendedprocdrop proce ...