# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
132085 | onjo0127 | Fences (JOI18_fences) | C++11 | 28 ms | 23928 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using pid = pair<int, double>;
using pdi = pair<double, int>;
using pdd = pair<double, double>;
#define X first
#define Y second
const double eps = 1e-6;
struct line { pdd S, E; };
struct dot { pdd D; int id; };
struct node { double v; int c, id; };
bool operator <(node PP, node QQ) { return PP.v > QQ.v; }
inline double f(double x) { return max(x, -x); }
inline double dst(pdd A, pdd B) { return sqrt((A.X-B.X) * (A.X-B.X) + (A.Y-B.Y) * (A.Y-B.Y)); }
inline double CCW(pdd A, pdd B, pdd C) { return A.X*B.Y + B.X*C.Y + C.X*A.Y - A.Y*B.X - B.Y*C.X - C.Y*A.X; }
inline int CCWs(pdd A, pdd B, pdd C) {
double tmp = CCW(A, B, C);
if(f(tmp) < eps) return 0;
if(tmp < 0) return -1;
if(tmp > 0) return +1;
}
inline bool on(line A, pdd B) {
if(A.S > A.E) swap(A.S, A.E);
if(B < A.S || A.E < B) return false;
return f(CCW(A.S, A.E, B)) < eps;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |