水题。直接解二次方程判断点的高度即可。

#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#define g 10
using namespace std; double vx,vy,s,h,t1,t2,T;
int n,t; int main()
{
scanf("%d",&t);
while (t--)
{
scanf("%lf%lf%lf%lf",&s,&h,&vx,&vy);
if (vy*vy/(*g)<h)
{
puts("poor Merida!");
continue;
}
T=s/vx;
t1=(vy-sqrt(vy*vy-*g*h))/g,t2=(vy+sqrt(vy*vy-*g*h))/g;
if (T>=t1 && T<=t2) puts("good done!");
else puts("poor Merida!");
}
return ;
}
05-07 15:42