# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
951105 | vjudge1 | Printed Circuit Board (CEOI12_circuit) | C++17 | 27 ms | 5044 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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];
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |