# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
152600 | josecruz | Organizing the Best Squad (FXCUP4_squad) | C++17 | 2705 ms | 89968 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 "squad.h"
#include <vector>
#include <algorithm>
#include <cassert>
#include <functional>
using namespace std;
struct PT {
typedef long long T;
T x, y;
PT(T xx = 0, T yy = 0) : x(xx), y(yy){}
PT operator +(const PT &p) const { return PT(x+p.x,y+p.y); }
PT operator -(const PT &p) const { return PT(x-p.x,y-p.y); }
PT operator *(T c) const { return PT(x*c,y*c); }
T operator *(const PT &p) const { return x*p.x+y*p.y; }
T operator %(const PT &p) const { return x*p.y-y*p.x; }
// be careful using this without eps!
bool operator<(const PT &p)const { return x != p.x ? x < p.x : y < p.y; }
bool operator==(const PT &p)const{ return x == p.x && y == p.y; }
};
vector<PT> splitHull(const vector<PT> &hull) {
vector<PT> ans(hull.size());
for(int i = 0, j = (int) hull.size()-1, k = 0; k < (int) hull.size(); k++) {
if(hull[i] < hull[j]) {
ans[k] = hull[i++];
} else {
ans[k] = hull[j--];
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... |