POJ 1925 Spiderman
| Time Limit: 5000MS | Memory Limit: 65536K | |
| Total Submissions: 5858 | Accepted: 1143 | 
Description
From Spiderman's apartment, where he starts, to the tower there is a straight road. Alongside of the road stand many tall buildings, which are definitely taller or equal to his apartment. Spiderman can shoot his web to the top of any building between the tower and himself (including the tower), and then swing to the other side of the building. At the moment he finishes the swing, he can shoot his web to another building and make another swing until he gets to the west tower. Figure-1 shows how Spiderman gets to the tower from the top of his apartment – he swings from A to B, from B to C, and from C to the tower. All the buildings (including the tower) are treated as straight lines, and during his swings he can't hit the ground, which means the length of the web is shorter or equal to the height of the building. Notice that during Spiderman's swings, he can never go backwards. 
You may assume that each swing takes a unit of time. As in Figure-1, Spiderman used 3 swings to reach the tower, and you can easily find out that there is no better way.
Input
Output
Sample Input
Sample Output
3
-1
Source
| #include <iostream> #include <cstdio> #include <cstring> using namespace std; typedef long long LL; LL x[5555],h[5555]; int main() | 
* This source code was highlighted by YcdoiT. ( style: Codeblocks )
POJ 1925 Spiderman的更多相关文章
- POJ 1925 Spiderman(DP)
		题目链接 这个破题,好不容易思路清楚了,写的就是过不了..关键部分直接抄的别人的...终于A了,自己写的判断什么的,就是有一组数据过不了. #include <cstdio> #inclu ... 
- [POJ 2397] Spiderman
		Link: POJ 2397 传送门 Solution: 设$dp[i][j]$表示第$i$步走到$j$高度时经过的最高高度 分向上走和向下走两种方式转移即可 注意记录路径,最后输出时要逆序输出 (逆 ... 
- poj很好很有层次感(转)
		OJ上的一些水题(可用来练手和增加自信) (POJ 3299,POJ 2159,POJ 2739,POJ 1083,POJ 2262,POJ 1503,POJ 3006,POJ 2255,POJ 30 ... 
- POJ题目分类推荐 (很好很有层次感)
		著名题单,最初来源不详.直接来源:http://blog.csdn.net/a1dark/article/details/11714009 OJ上的一些水题(可用来练手和增加自信) (POJ 3299 ... 
- poj动态规划列表
		[1]POJ 动态规划题目列表 容易: 1018, 1050, 1083, 1088, 1125, 1143, 1157, 1163, 1178, 1179, 1189, 1208, 1276, 13 ... 
- POJ 动态规划题目列表
		]POJ 动态规划题目列表 容易: 1018, 1050, 1083, 1088, 1125, 1143, 1157, 1163, 1178, 1179, 1189, 1208, 1276, 1322 ... 
- POJ数据的输入输出格式
		POJ在评阅习题时需要向程序提供输入数据,并获取程序的输出结果.因此提交的程序需按照每个习题具体的输入输出格式要求处理输入输出.有的时候,测评系统给出程序的评判结果是“数据错误”或“结果错误”,有可能 ... 
- POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理
		Halloween treats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7644 Accepted: 2798 ... 
- POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理
		Find a multiple Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7192 Accepted: 3138 ... 
随机推荐
- Cookie对象
			Cookie对象用于保存客户端浏览器请求的服务器页面,也可用于存放非敏感性的用户信息,信息保存的时间可以根据用户的需要进行设置.并非所有的浏览器都支持Cookie,并且数据信息是以文本的形式保存在客户 ... 
- Beta版本——第三次冲刺博客
			我说的都队 031402304 陈燊 031402342 许玲玲 031402337 胡心颖 03140241 王婷婷 031402203 陈齐民 031402209 黄伟炜 031402233 郑扬 ... 
- css中关于居中的那点事儿
			css中关于居中的那点事儿 关于居中,无论是水平居中,还是垂直居中都有很多方式,下面我来介绍一些常用的. 第一部分:水平居中 1.实现行内元素的居中.方法:在行内元素外面的块元素的样式中添加:text ... 
- Linux下显示IP地理位置信息的小工具-nali
			一.简介 nali,名字取自中文“哪里”的拼音.nali包含一组命令行程序,其主要功能就是把一些网络工具的输出的IP字符串,附加上地理位置信息(使用纯真数据库QQWry.Dat).例如74.125.1 ... 
- SpringMVC处理请求流程
			SpringMVC核心处理流程: 1.DispatcherServlet前端控制器接收发过来的请求,交给HandlerMapping处理器映射器 2.HandlerMapping处理器映射器,根据请求 ... 
- POJ 2388	Who's in the Middle(水~奇数个数排序求中位数)
			题目链接:http://poj.org/problem?id=2388 题目大意: 奇数个数排序求中位数 解题思路:看代码吧! AC Code: #include<stdio.h> #in ... 
- cookie和浏览器
			XHR API允许应用添加自定义的HTTP首部(通过setRequestHeader()方法),同时也有一些首部都是应用代码不能设定的. Accept-Charset.Accept-Encoding. ... 
- ecshop分页
			php代码 $page = $_GET['page']; //当前是第几页 $count = grab_promote_goods_count(); // 一个有多少条 $size= '; ){ $p ... 
- mac pro在公司连WiFi正常,回家回宿舍就找不到WiFI信号,需要重启才能找到WiFI热点
			解决办法:修改路由器的频段到1-11这个范围. 之前一直没时间去找原因,项目也急,这几天项目不是特别急了,就找找了,原因. 因为之前还是好好的,主要是之前有次修改了下路由器的配置. 改了下默认的发送频 ... 
- UI控件之ListView
			一,一个简单的TextView列表 public class FirstActivity extends Activity { private String[] data = {"Apple ... 
