POJ 3684 Physics Experiment
和蚂蚁问题类似。
#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std; int c,n;
double h,r,t,T;
double ans[]; double cal(double time)
{
if(time<=) return h;
int f=;
while()
{
if(time<=T)
{
if(f==) return h-0.5*10.0*time*time;
return h-0.5*10.0*(T-time)*(T-time);
}
f=f^;
time=time-T;
}
} int main()
{
scanf("%d",&c);
while(c--)
{
scanf("%d%lf%lf%lf",&n,&h,&r,&t);
T=sqrt(*h/10.0);
for(int i=;i<n;i++) ans[i]=cal(1.0*t-1.0*i);
sort(ans,ans+n);
for(int i=;i<n;i++) ans[i]=ans[i]+2.0*r*i/;
for(int i=;i<n;i++)
{
printf("%.2lf",ans[i]);
if(i<n-) printf(" ");
else printf("\n");
}
}
return ;
}
POJ 3684 Physics Experiment的更多相关文章
- POJ 3684 Physics Experiment(弹性碰撞)
Physics Experiment Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2936 Accepted: 104 ...
- poj 3684 Physics Experiment 弹性碰撞
Physics Experiment Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 1489 Accepted: 509 ...
- poj 3684 Physics Experiment(数学,物理)
Description Simon ), the first ball is released and falls down due to the gravity. After that, the b ...
- Physics Experiment(POJ 3684)
原题如下: Physics Experiment Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3583 Accepte ...
- poj 3684
Physics Experiment Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 784 Accepted: 266 ...
- [POJ3684]Physics Experiment
Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 1363 Accepted: 476 Special Judge ...
- POJ3684 Physics Experiment 【物理】
Physics Experiment Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 1031 Accepted: 365 ...
- POJ:3684-Physics Experiment(弹性碰撞)
Physics Experiment Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3392 Accepted: 1177 Sp ...
- 弹性碰撞 poj 3684
Simon is doing a physics experiment with N identical balls with the same radius of R centimeters. Be ...
随机推荐
- win驱动安装记录
工具:devcon64.exe 安装/更新/删除等记录:c:\windows\inf\setupapi.dev.log
- Linux环境下手动配置sbt
一.下载sbt安装包 从sbt官网下载地址:http://www.scala-sbt.org/download.html下载安装包,以sbt-0.13.13.tgz为例. 二.安装 1.将下载的二进制 ...
- SEO 第六章
SEO第六章 本次课程目标: 1. 掌握网站的内链优化 2. 网站的URL优化 一. 网站地图 1. 什么是网站地图? 网站地图也叫站点地图,英文名叫sitemap,指的网站所有内 ...
- HTTP隧道代理
reGeorg的前身是2008年SensePost在BlackHat USA 2008 的 reDuh延伸与扩展.也是目 前安全从业人员使用最多,范围最广,支持多丰富的一款http隧道.从本质上讲,可 ...
- vue iview render里面 没有双向绑定 renderHeader 要序列化 反序列 一下
vue iview render里面 没有双向绑定 renderHeader 要序列化 反序列 一下 renderHeader: (h, params) => { return [ h('Rad ...
- ideal取消按下两次shift弹出搜索框 修改idea,webstrom,phpstrom 快捷键double shift 弹出search everywhere
因为经常需要在中英文之间切换,所以时常使用shift键,一不小心就把这个Searchwhere 对话框调出来了,很是麻烦. 因此痛定思痛, 我决定将这个按两下shift键就弹出搜索框的快捷键禁用了! ...
- myBatis的binding错误:Invalid bound statement (not found)
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误这个问题我找了好久,终于找到了正确的写 ...
- fossil 使用
~$ fossil updateCannot figure out who you are! Consider using the --usercommand line option, setting ...
- JS动态添加元素的事件动态绑定
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- Shell获取多行输入并输出每行的第3个字符
#!/bin/bash echo "$(cut -c3 /dev/stdin)" 标准输入的文件名是/dev/stdin,如果在cut后面输入了这个参数,那么shell会提示你输入 ...