题目链接:hdu 5572 An Easy Physics Problem
解题思路
注意精度误差,发射的情况可以对应求出B点的对称点再判断
代码
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
const double eps = 1e-8;
const double inf = 1e20;
inline int dcmp(double x) { if (fabs(x) < eps) return 0; return x < 0 ? -1 : 1; }
struct Point {
double x, y;
Point (double x = 0, double y = <