跳到正文

题解

P1033题解

Vodyanitsaa约 1 分钟
原文
文章信息与版本

文章信息

发布
2025年2月7日
收录
2026年10月1日
更新
2026年11月9日
篇幅
约 1 分钟
获赞
1
题目
P1033

版本

  1. v1当前

思路

纯纯物理题。

首先,由题可得小球下落距离计算公式为 d=0.5×g×(t2)d = 0.5 \times g \times (t^2),且 g=10g = 10,所以 d=5×t2d = 5 \times t^2。在进一步得到 t=d5t = \sqrt[]{\dfrac{d}{5}}。

计算出小车能接到球的两个边界(中间的肯定都能拿到),就可以得到小车能接受到多少个小球。

solution

C++
#include <bits/stdc++.h>
using namespace std;
int main()
{
    double h,s,v,l,k;
    int n;
	cin>>h>>s>>v>>l>>k>>n;
	double tmx=sqrt(h/5);  
	double tmn=sqrt((h-k)/5); 
	int xegin=s-tmn*v+l;      
	int xnd=s-tmx*v;          
	xegin=min(xegin,n);  
	xend=max(xnd,0);      
	cout<<xegin-xnd;
}
原文