diff --git a/02xxx/02389.cpp b/02xxx/02389.cpp new file mode 100644 index 00000000..d5326f59 --- /dev/null +++ b/02xxx/02389.cpp @@ -0,0 +1,65 @@ +#include +#include +#include +#include +#include +using namespace std; + +typedef struct Point { + double x, y; + Point(void) : x(0), y(0) {} + Point(double x, double y) : x(x), y(y) {} +} Point; + +inline double dist(const Point& a, const Point& b) { + return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y)); +} + +inline Point circle(const Point& a, const Point& b, const Point& c) { + return Point( + ((b.x*b.x-c.x*c.x+b.y*b.y-c.y*c.y)*(a.y-b.y)-(b.x*b.x-a.x*a.x+b.y*b.y-a.y*a.y)*(c.y-b.y)) / (2*(a.x-b.x)*(c.y-b.y)-2*(c.x-b.x)*(a.y-b.y)), + ((b.y*b.y-c.y*c.y+b.x*b.x-c.x*c.x)*(a.x-b.x)-(b.y*b.y-a.y*a.y+b.x*b.x-a.x*a.x)*(c.x-b.x)) / (2*(a.y-b.y)*(c.x-b.x)-2*(c.y-b.y)*(a.x-b.x)) + ); +} + +bool check(const Point& mid, const vector& v, double r) { + for (const auto& p : v) { + if (dist(mid, p) > r) return false; + } + return true; +} + +void solve(void) { + int n; cin >> n; + vector v(n); + for (int i=0; i> v[i].x >> v[i].y; + + pair ans = make_pair(Point(0, 0), 1e9); + for (int i=0; i