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
100
 
Sample Output
12367
1
 
 
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的更多相关文章

  1. 【BZOJ-1863】trouble 皇帝的烦恼 二分 + DP

    1863: [Zjoi2006]trouble 皇帝的烦恼 Time Limit: 1 Sec  Memory Limit: 64 MBSubmit: 559  Solved: 295[Submit] ...

  2. 快速幂 --- CSU 1556: Jerry's trouble

    Jerry's trouble Problem's Link:   http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1556 Mean: 略. ana ...

  3. HDU 4334 Trouble (暴力)

    Trouble Time Limit: 5000MS   Memory Limit: 32768KB   64bit IO Format: %I64d & %I64u Submit Statu ...

  4. The trouble of Xiaoqian

    The trouble of Xiaoqian Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Oth ...

  5. Linux 常见的trouble shooting故障排错

    Linux 常见的trouble shooting故障排错 备份开机所必须运行的程序对一个运维人员来说是非常有必要的.在实际生产环境中,系统和数据基本都是安装在不同的硬盘上面,因为企业最关心的还是数据 ...

  6. HDU 4334 Trouble

    Trouble Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Su ...

  7. 【BZOJ】【1863】【ZJOI2006】trouble 皇帝的烦恼

    二分+DP Orz KuribohG 神题啊= = 满足单调性是比较显然的…… 然而蒟蒻并不会判断能否满足……QwQ 神一样的DP姿势:f[i]表示第 i 个与第1个最多有多少个相同,g[i]表示最少 ...

  8. 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 ...

  9. 【DP/二分】BZOJ 1863:[Zjoi2006]trouble 皇帝的烦恼

    863: [Zjoi2006]trouble 皇帝的烦恼 Time Limit: 1 Sec  Memory Limit: 64 MBSubmit: 465  Solved: 240[Submit][ ...

随机推荐

  1. ACM学习之路__HDU 1045

    Fire Net Description : Suppose that we have a square city with straight streets. A map of a city is ...

  2. 翻译连载 |《你不知道的JS》姊妹篇 |《JavaScript 轻量级函数式编程》- 引言&前言

    原文地址:Functional-Light-JS 原文作者:Kyle Simpson-<You-Dont-Know-JS>作者 译者团队(排名不分先后):阿希.blueken.brucec ...

  3. 小知识点-ios跳过app store更新版本

    版本更新实现的思路 获取自身的版本号 获取AppStore的版本号 自身的版本号和AppStore的比较 弹窗提示所需数据的获取的方式 1.获取自身的版本号 2.AppStore的版本号 Wechat ...

  4. ActiveMQ 入门helloworld

    1.下载安装ActiveMQ 官网下载地址:http://activemq.apache.org/download.html ActiveMQ 提供了Windows 和Linux.Unix 等几个版本 ...

  5. linux kill 命令

    kill 命令的用途 kill 命令很容易让人产生误解,以为它仅仅就是用来杀死进程的.我们来看一下 man page 对它的解释:kill - send a signal to a process. ...

  6. 数据库服务器构建和部署列表(For SQL Server 2012)

    前言 我们可能经常安装和部署数据库服务器,但是可能突然忘记了某个设置,为后来的运维造成隐患.下面是国外大牛整理的的检查列表. 其实也包含了很多我们平时数据库配置的最佳实践.比如TEMPDB 文件的个数 ...

  7. 分享基于分布式Http长连接框架--代码模型

    好的代码应该是方便客户端使用,代码能够自描述,规范化,大众标准化. 而且我相信代码也是有生命的,需要不断的维护它,你以什么样的态度对待它,它就会以同样的态度回敬你,所以在写代码前,先摆好自己的态度(一 ...

  8. UI自动化测试(四)AutoIT工具使用和robot对象模拟键盘按键操作

    AutoIT简介 AutoIt 目前最新是v3版本,这是一个使用类似BASIC脚本语言的免费软件,它设计用于Windows GUI(图形用户界面)中进行自动化操作.它利用模拟键盘按键,鼠标移动和窗口/ ...

  9. The Moving Points hdu4717

    The Moving Points Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others ...

  10. C# readonly

    当某个字段是引用类型,并且该字段被标记为readonly时,不可改变的是引用,而非字段引用的对象,例如: