URAL 1902 Neo-Venice(简单物理相遇问题)_Sun_AC的博客-程序员宅基地

技术标签: URAL  

1902. Neo-Venice

Time limit: 1.0 second
Memory limit: 64 MB
Mars was the first planet colonized by humans. After a long terraforming process its appearance has changed completely. From the red desert it has become a blue planet covered by water. There was so much water that some of the cities were built not on land, but on stilts over the water. The most famous one was Neo-Venice. There are canals instead of roads and numerous gondolas instead of cars in this city. All this attracts huge crowds of tourists from the Earth to Neo-Venice. The most popular activities among them are boat excursions. Gondolas are steered by young girls who can not only bring tourists through the canals but also tell them about the history of the city or sing a song along the way. Due to their love for the water these girls are called undines.
The undine Anna has just received a license to steer a gondola. Tomorrow she will carry tourists on excursion to the St. Peter's canal. This canal is narrow, but many popular routes are passing through it, so there are always a lot of gondolas. Anna is afraid that her excitement may lead to a crash with another gondola during the excursion. However, all undines are trained to steer the gondola smoothly and with the same speed, so the only threat comes from gondolas sailing in the opposite direction. Anna knows the schedule of her colleagues and when she herself will enter the canal. Now she wants to know exactly when she will encounter other gondolas, in order to be extra careful around them.

Input

The first line of the input contains integers  nt and  sn is the number of undines who will go through the St. Peter’s canal in the opposite direction (1 ≤  n ≤ 100).  t is the time needed for the gondola to sail through the entire length of the canal (1 ≤  t ≤ 100).  s is the moment of time at which the Anna's gondola will enter the canal (360 ≤  s ≤ 1200). The second line contains integers  s 1, …,  s n that define the moments of time at which the gondolas of Anna’s colleagues will appear on the opposite side of the canal.  s −  t <  s 1 < … <  s n <  s +  t.

Output

Output  n numbers that are the points of time when Anna will meet her colleagues, with absolute or relative error no more than 10 −6. Numbers should be separated with spaces or line feeds.

Sample

input output
2 60 600
600 630
630.000000
645.000000
AC代码:
#include <stdio.h>
int main(){
	int n,t,s,a;
	double tt;
	scanf("%d%d%d",&n,&t,&s);
	while(n--){
		scanf("%d",&a);
		tt=(s+t+a)/2.0;
		printf("%.6lf\n",tt);
	}
	return 0;
}


版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/YJX_xx/article/details/38010983

智能推荐

[ACM] POJ 3273 Monthly Expense (二分解决最小化最大值)_larger minimum_同学少年的博客-程序员宅基地

Monthly ExpenseTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 14158 Accepted: 5697DescriptionFarmer John is an astounding accounting wizard and has r

最小二乘法推导_橘猫非猫gkd的博客-程序员宅基地

最小二乘法推导假设一组数据线性关系为 &nbsp;y=β0+β1x\ y=\beta_0 +\beta_1x&nbsp;y=β0​+β1​x实际建模中系数&nbsp;β0,β1\ \beta_0,\beta_1&nbsp;β0​,β1​是未知的,但是我们的数据是已知的,为了让我们估计的&nbsp;y^\ \hat{y}&nbsp;y^​与实际的&nbsp;y\ y&nbsp;y 尽可能接近,我们使&nbsp;RSS=(y1−y^1)2+(y2−y^2)2+……+(yn−y^n)2\ RSS = (y_

手机写python爬虫_python爬虫——分页爬取京东商城商品信息(手机为例)-Go语言中文社区..._weixin_39727005的博客-程序员宅基地

1、最近刚开始学习python 写了个爬虫练习,感觉主要是得会用F12查询网站结构代码。还涉及到反爬虫,每个网站都不一样,拿到的解析出的json数据格式也不同。得有些Web知识的基础才行。2、上代码import urllib.requestimport time# xpath lxml第三方包 将html转化为树形结构from lxml import etree# re系统包 正则im...

python的pillow给图片加文字_python PIL(pillow)图像处理-图片上添加文字_weixin_39682412的博客-程序员宅基地

from PIL import Image, ImageDraw, ImageFontdef gen_img(size=None):if size is None:size = 400#生成大小为400x400RGBA是四通道图像,RGB表示R,G,B三通道,A表示Alpha的色彩空間image = Image.new(mode='RGBA', size=(400, 400), color=(25...

linux 鼠标绝对坐标,鼠标使用绝对坐标,它的描述符的问题_weixin_39647186的博客-程序员宅基地

这是我做的USB红外触摸屏定义的HID描述符,已经在产品上正常工作,你可以参考一下(REPORT_ID为0x02部分)。//126 byte0x05, 0x01, // USAGE_PAGE (Generic Desktop)0x09, 0x02, // USAGE (Mouse)0xa1, 0x01, ...

GIthub创建文件夹、跳转链接、Read.me添加图片和换行显示等操作_github 项目 外链文件夹_小小谢先生的博客-程序员宅基地

有些小伙伴在GitHub创建一个仓库,想在仓库的文件夹下创建一个跳转链接,比如点击一个题目就跳转到微信公众号链接,那具体怎么操作呢?且听我慢慢道来~其实在GitHub上Read.me创建链接就相当于在Markdown下创建一个链接,只要会Markdown语法的人就能创建连接,具体语法如下:[文本](URL)其中()要英语语法下的括号,比如下面的例子[独家整理的神奇](https:...

随便推点

测序是测量你的遗传信息_质粒测序拼接后末尾200bp处有碱基缺失_wangchuang2017的博客-程序员宅基地

测序是测量你的遗传信息遗传信息,大家应该都清楚,如果不清楚的话麻烦各位翻一翻高中的肺炎双球菌实验,讲的就是啥是遗传信息,如何发现遗传信息的。放张图,方便大家回忆。原来的科学家们通过老鼠死没死,最终得到的结论是DNA是主要的遗传物质,部分物种的遗传物质是RNA。在弄清楚这个事情之后,大家也都知道沃森和克里克还有一些被遗忘的科学家一起努力弄清楚了DNA是双螺旋结构。并且(A-T,G...

matlab可以做什么项目,关于matlab:做开源界的MATLAB这个项目需要更多热爱开源的你加入..._weixin_39517241的博客-程序员宅基地

MATLAB 和 Mathematica、Maple 并称为三大数学软件。它在数学类科技应用软件中在数值计算方面名列前茅。MATLAB 能够进行矩阵运算、绘制函数和数据、实现算法、创立用户界面、连贯其余编程语言的程序等。前一段时间 MATLAB 进入实体清单实际,也让局部国内开发者有了危机意识,明天介绍的这款我的项目就是试图打造「开源界的 MATLAB」,目前我的项目刚刚起步,还须要更多酷爱开源或...

python下载网页中的pdf文件_Python + wGet 合璧,一键下载网页上所有的PDF_weixin_39600319的博客-程序员宅基地

背景介绍:在Python方面,我是一名不折不扣的菜鸟。在Linux方面,算是懂些皮毛。就这么一个知识水平,还搞懂了一件事情。说明什么呢?不是运气好,而是证明“ 学习,只要带着强烈的目标,终有收获。”用过三种wGet: 其中Office2016所带的wget,和WSUS所带的wget,均能在Windows的命令行下正常执行。唯独用cygWin编译后的,若离开cygwin,则报错不断: 何必对着干?那...

lns linux服务器,LAC与LNS是什么服务器_weixin_39624716的博客-程序员宅基地

LAC:location area code 位置区码 (移动通信系统中)。LNS:表示L2TP网络服务器(L2TP Network Server)。LAC是为寻呼而设置的一个区域,覆盖一片地理区域,初期一般按行政区域划分(一个县或一个区),现在很灵活了,按寻呼量划分。LNS是PPP端系统上用于处理L2TP协议服务器端部分的设备。它作为L2TP隧道的另一侧端点,是LAC的对端设备,是被LAC进行隧...

jade ajax,javascript - Ajax with node.js/jade - Stack Overflow_weixin_39636176的博客-程序员宅基地

I have a problem with ajax callServer side:router.get('/user/letterlist', function(req, res) {// ... some operationsres.render('userLetterList', { title: 'test', rows : rows? rows: null, pageCount: pa...

SpringBoot之拦截器_逆流而上的龟的博客-程序员宅基地

我们为什么要使用拦截器?拦截用户的每一个请求,在真正开始处理业务之前做一些附属逻辑,比如日志记录、登录验证等。下面我们来看看SpringBoot中的拦截器是如何做的?1.定义拦截器继承HandlerInterceptorAdapter类,该接口有三个方法,分别如下:a.preHandle:预处理回调方法,实现处理器的预处理(如请求执行前的日志记录、登录检查) 返回值: ...

推荐文章

热门文章

相关标签