1168 -- 奋斗的小蜗牛
来源:互联网 发布:linux netcat反向shell 编辑:程序博客网 时间:2024/06/14 13:53
奋斗的小蜗牛
Time Limit:1000MS Memory Limit:65536K
Total Submit:139 Accepted:89
Description
传说中能站在金字塔顶的只有两种动物,一种是鹰,一种是蜗牛。一只小蜗牛听了这个传说后,大受鼓舞,立志要爬上金字塔。为了实现自己的梦想,蜗牛找到了老鹰,老鹰告诉它金字塔高H米,小蜗牛知道一个白天自己能向上爬10米,但由于晚上要休息,自己会下滑5米。它想知道自己在第几天能站在金字塔顶,它想让你帮他写个程序帮助它。
Input
第一行有一个整数t,表示t组测试数据。
第二行一个整数H(0 < H < 10^9)代表金字塔的高度。
Output
输出一个整数n表示小蜗牛第n天站在金字塔顶上
Sample Input
215
Sample Output
11
Source
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace AK1168 { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); while (n-- > 0) { int h = int.Parse(Console.ReadLine()); if (h <= 10) Console.WriteLine("1"); else { if (h % 5 == 0) Console.WriteLine(h / 5 - 1); else Console.WriteLine(h / 5); } } } } }
0 0
- 1168 -- 奋斗的小蜗牛
- 奋斗的小蜗牛
- 奋斗的小蜗牛
- 奋斗的小蜗牛
- 奋斗的小蜗牛
- 奋斗的小蜗牛
- 奋斗的小蜗牛
- 奋斗的小蜗牛
- 奋斗的小蜗牛
- 奋斗的小蜗牛
- 奋斗的小蜗牛
- 奋斗的小蜗牛
- 奋斗的小蜗牛
- NYOJ - 奋斗的小蜗牛
- NYOJ_599奋斗的小蜗牛
- 599 奋斗的小蜗牛
- nyoj599奋斗的小蜗牛
- ACM-奋斗的小蜗牛
- 1167 -- 变态最大值
- MySql的join(连接)查询 (三表 left join 写法)
- hdoj 2157 How many ways?? 【矩阵快速幂】【求任意两点间的路径上 经过k个点的方案数】
- thinkphp 前台html调用函数 格式化输出
- 查看oracle数据库的连接数以及用户
- 1168 -- 奋斗的小蜗牛
- Hadoop入门进阶课程3--Hadoop2.X64位环境搭建
- 使用线程的几种方式(2)工作组
- JSP 文件与HTML文件
- 解决spring mvc No mapping found for HTTP request with URI错误的三种方法
- 配置Nginx来支持PHP----重点介绍Nginx如何通过PHP_FPM的FastCGI进程对PHP进行解析处理。
- C++--------------------------结构体struct
- 1169 -- 车牌号
- zabbix 流量问题