# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
951081 | vjudge1 | Printed Circuit Board (CEOI12_circuit) | C++17 | 33 ms | 4984 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 <iostream>
#include <algorithm>
#include <vector>
typedef long long ll;
const int LEN = 200'001;
struct Pos {
ll x, y;
int i;
ll s() const { return x * x + y * y; }
bool operator<(const Pos& r) const { return y * r.x < r.y * x; }
bool operator==(const Pos& r) const { return y * r.x == r.y * x; }
friend std::istream& operator>>(std::istream& is, Pos& p) { is >> p.x >> p.y; return is; }
} O = { 0, 0 }, p[LEN];
ll cross(const Pos& p1, const Pos& p2, const Pos& p3) { return (p2.x - p1.x) * (p3.y - p2.y) - (p2.y - p1.y) * (p3.x - p2.x); }
ll ccw(const Pos& p1, const Pos& p2, const Pos& p3) {
ll ret = cross(p1, p2, p3);
return ret < 0 ? -1 : !!ret;
}
bool invisible(const Pos& p1, const Pos& p2, const Pos& t) {
return ccw(O, p1, t) <= 0 && ccw(O, p2, t) >= 0 && ccw(p1, p2, t) >= 0;
}
int N, L, R;
int main() {
std::cin.tie(0)->sync_with_stdio(0);
std::cin >> N >> p[0];
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |