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 ...
随机推荐
- Oracle Storage in Action : 删除物理数据文件
ALTER TABLESPACE XH_DM DROP DATAFILE 'F:\DEV\ORACLE-DATA\ORCL\XH_DM_1.DBF'; SQL> ALTER TABLESPACE ...
- 全文索引Elasticsearch,Solr,Lucene
最近项目组安排了一个任务,项目中用到了全文搜索,基于全文搜索 Solr,但是该 Solr 搜索云项目不稳定,经常查询不出来数据,需要手动全量同步,而且是其他团队在维护,依赖性太强,导致 Solr 服务 ...
- AI学习一:环境安装
对于Python开发用户来讲,PIP安装软件包是家常便饭.但国外的源下载速度实在太慢,浪费时间.而且经常出现下载后安装出错问题.所以把PIP安装源替换成国内镜像,可以大幅提升下载速度,还可以提高安装成 ...
- PMP项目管理学习笔记(6)——整合管理之制订项目管理计划
制订项目管理计划 输入:项目章程.组织过程资产.企业环境要素.计划过程的输出(): 工具:专家判断 输出:项目管理计划 项目管理计划使你在问题发生之前做出规划 你要在计划过程组中明确如何完成项目——因 ...
- jeecms标签
.@cms_content_list--新闻单页 [@cms_content channelId=' dateFormat='MM-dd' ] [#if tag_list?size>0] < ...
- Java后端学习路线_备战
SpringCloud项目实战 Dubbo项目实战 项目实战应涵括哪些技术: 缓存.消息队列 WEB应用服务器(Weblogic.Jetty.JBoss.WebSphere) NoSQL(MongoD ...
- tensorflow-gpu install check
https://gist.github.com/mrry/ee5dbcfdd045fa48a27d56664411d41c#file-tensorflow_self_check-py-L16
- ç7—UIViewController
UIViewController继承了UIResponder,而UIResponder继承了NSObject,UIViewController是所有视图控制器的父类. 在MVC模式中,UIViewCo ...
- mysql5.7配置
my3306.cnf [client] port = 3306 #端口socket = /data/mysql3306/mysql3306.sock #mysql以socket方式运行的soc ...
- 同一SQL语句在PLSQL Developer与SQL * PLUS工具中执行结果不一致
背景 今天遇到如下问题,同一sql语句在PLSQL Developer与SQL*PLUS工具中执行结果不一致, sql语句如下 SELECT 'GROUPHEALTH_SEND_EMAIL' as i ...