# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
920057 | jay22 | timeismoney (balkan11_timeismoney) | C++14 | 0 ms | 0 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>
typedef long long ll;
const int LEN = 1e4;
const int V_LEN = 201;
const ll INF = 1e9;
int N, M;
struct Pos { ll x, y; ll f() const { return x * y; } };
ll cross(const Pos& d1, const Pos& d2, const Pos& d3) { return (d2.x - d1.x) * (d3.y - d2.y) - (d2.y - d1.y) * (d3.x - d2.x); }
int ccw(const Pos& d1, const Pos& d2, const Pos& d3) {
ll c = cross(d1, d2, d3);
return c > 0 ? 1 : c < 0 ? -1 : 0;
}
int p[V_LEN];
int find(int i) { return p[i] < 0 ? i : p[i] = find(p[i]); }
int join(int a, int b) {
a = find(a), b = find(b);
if (a == b) return 0;
if (p[a] < p[b]) p[a] += p[b], p[b] = a;
else p[b] += p[a], p[a] = b;
return 1;
}
ll A, B;
struct Edge {