为什么爆了0???

P1033 [NOIP2002 提高组] 自由落体

```cpp #include<bits/stdc++.h> using namespace std; double h,s,v,l,k,q,p; int n; int main(){ cin>>h>>s>>v>>l>>k>>n; cout<<min(n,int(s-sqrt((h-k)/5)*v+l))-max(0,int(s-sqrt(h/5)*v)); } ```
by MC小萌新 @ 2021-08-07 11:52:46


```cpp #include<iostream> #include<cstdio> #include<cmath> using namespace std; const double eps=0.0001; double h,s,v,l,k; int n,ans; int main(){ int cnt=0; double a,b,c,d; scanf("%lf%lf%lf%lf%lf%d",&h,&s,&v,&l,&k,&n); for(int i=0;i<n;i++){ a=(s-i-eps)/v,b=(s-i+l+eps)/v;//处理精度误差 c=sqrt((h-k)/5.0),d=sqrt(h/5.0); if((c<=a&&a<=d)||(c<=b&&b<=d)||(a<=c&&c<=b)||(a<=d&&d<=b)) cnt++; } printf("%d\n",cnt); return 0; } ```
by emmm123 @ 2021-08-12 20:06:43


@[MC小萌新](/user/183954) 谢谢
by ZinChloride @ 2021-09-05 20:36:33


@[MC小萌新](/user/183954) %%%
by ZinChloride @ 2021-09-05 20:37:13


|