POJ 3684 Physics Experiment——弹性碰撞
来源:互联网 发布:dvr监控软件下载 编辑:程序博客网 时间:2024/06/06 01:50
#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>#include <cmath>using namespace std;int main(){ double ans[200]; int T, n, h, r, t; scanf("%d", &T); for (int kase = 1; kase <= T; kase++) { scanf("%d %d %d %d", &n, &h, &r, &t); for (int i = 0; i < n; i++) { if (t - i <= 0) { ans[i] = h; continue; } double cycle = sqrt(1.0 * h / 5.0); int cnt = (int)((t - i) / cycle); double tt = t - i - cycle * cnt; if (cnt % 2) { ans[i] = sqrt(20.0 * h) * tt - 5.0 * tt * tt; } else { ans[i] = 1.0 * h - 5.0 * tt * tt; } } sort(ans, ans + n); printf("%.2lf", ans[0]); for (int i = 1; i < n; i++) { printf(" %.2lf", ans[i] + 2.0 * r * i / 100.0); } printf("\n"); } return 0;}
阅读全文
0 0
- POJ 3684 Physics Experiment——弹性碰撞
- Physics Experiment poj 3684 弹性碰撞
- POJ 3684 Physics Experiment(弹性碰撞)
- POJ - 3684 Physics Experiment(弹性碰撞)
- POJ 3684 Physics Experiment(弹性碰撞)
- POJ 3684 Physics Experiment 弹性碰撞
- POJ 3684 Physics Experiment(弹性碰撞)
- POJ 3684 Physics Experiment【弹性碰撞】
- POJ-3684 Physics Experiment(弹性碰撞)
- 158_弹性碰撞 Physics Experiment (POJ No 3684)
- [POJ 3684] Physics Experiment (脑洞+弹性碰撞模型)
- poj 3684--Physics Experiment(碰撞)
- POJ-3684-Physics Experiment
- POJ 3684 Physics Experiment
- poj 3684 Physics Experiment
- POJ 3684 Physics Experiment
- poj-3684-Physics-Experiment
- 【POJ 3684 Physics Experiment】 + 思维
- 【树形dp】POJ
- Truck History (并查集)
- mysql 备份与恢复
- 夜间模式1
- Struts1和Spring的整合
- POJ 3684 Physics Experiment——弹性碰撞
- 【转】【Unity3D】利用预设、实例化Instantiate和协程完成生成器
- Numpy(一)
- 贪心基础 最大整数
- POJ 1094 Sorting It All Out(拓扑排序 入度性质)
- 树状数组的两道基本题
- 2017.8.7 序列计数 思考记录
- 成员变量和局部变量的区别,静态变量和成员变量的区别
- 函数重载