# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
679914 | mjhmjh1104 | Triangles (CEOI18_tri) | C++17 | 1 ms | 340 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 "trilib.h"
#include <vector>
#include <algorithm>
using namespace std;
int ccw(int x, int y, int z) {
return is_clockwise(x + 1, y + 1, z + 1);
}
void _sort(vector<int> &v, int l, int r, bool counterclockwise) {
if (l >= r) return;
int m = (l + r) / 2;
_sort(v, l, m, counterclockwise);
_sort(v, m + 1, r, counterclockwise);
vector<int> u;
int x = l, y = m + 1;
while (x <= m && y <= r) {
if ((ccw(v[x], v[0], v[y]) > 0) ^ counterclockwise) u.push_back(v[x++]);
else u.push_back(v[y++]);
}
while (x <= m) u.push_back(v[x++]);
while (y <= r) u.push_back(v[y++]);
for (int i = 0; i < (int)u.size(); i++) v[l + i] = u[i];
}
int hull(vector<int> &v) {
vector<int> st;
st.push_back(0);
st.push_back(1);
for (int i = 2; i < (int)v.size(); i++) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |