Physics Experiment 物理题

知道下面这两个结论题目就会辣

1.球心发生弹性碰撞的相同两球,相当于速度交换

2.每个球只能在h范围内进行变化,因为之前落下的会占据高度,这个球下面一定有前面落下球的个数

然后把所有时间求得的高度排序就好了


/*  ^^ ====== ^^ 
ID: meixiuxiu
PROG: test
LANG: C++11
*/
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <climits>
#include <string>
#include <vector>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <sstream>
#include <cctype>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int ,int> pii;
#define MEM(a,b) memset(a,b,sizeof a)
#define CLR(a) memset(a,0,sizeof a);
#define pi acos(-1.0)
#define maxn 40000
#define maxv 100005
const int inf = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
//#define LOCAL
double ans[105];
int n,h,r,t;
double cal(int t){
	if(t<0)return h;
	double t1 = sqrt(2.0*h/10);
	int cnt = (int)t/t1;
	double remid = t - cnt*t1;
	double v0 = sqrt(2*10.0*h);
	if(cnt%2){
		remid = cnt*t1+t1-t;
		return h-1.0/2*10*remid*remid;
	}
	else return h-1.0/2*10*remid*remid;
}
int main()
{
#ifdef LOCAL
	freopen("in.txt", "r", stdin);
//	freopen("out.txt","w",stdout);
#endif
	int c;scanf("%d",&c);
	while(c--){
		scanf("%d%d%d%d",&n,&h,&r,&t);
		for(int i=0;i<n;i++){
			double hh = cal(t-i);
			ans[i] = hh;
		}
		sort(ans,ans+n);
		for(int i=0;i<n;i++){
			printf("%.2f%c",ans[i]+2*r*i/100.0,i==n-1?'\n':' ');
		}
	}
	return 0;
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值