| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 585081 | Jomnoi | Triangles (CEOI18_tri) | C++17 | 1 ms | 224 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 <bits/stdc++.h>
#include "trilib.h"
using namespace std;
bool ask(int a, int b, int c) {
return is_clockwise(a, b, c);
}
int main() {
int N = get_n();
vector <int> cand, hull;
for(int i = 1; i <= N; i++) {
cand.push_back(i);
}
sort(cand.begin() + 1, cand.end(), [&](const int &a, const int &b) {
return ask(1, a, b) == false;
});
for(auto p : cand) {
while(hull.size() >= 2 and ask(hull[hull.size() - 2], hull.back(), p) == true) {
hull.pop_back();
}
hull.push_back(p);
}
cand.pop_back();
reverse(cand.begin(), cand.end());
int len = hull.size();
for(auto p : cand) {
while(hull.size() > len and ask(hull[hull.size() - 2], hull.back(), p) == true) {
hull.pop_back();
}
hull.push_back(p);
}
hull.pop_back();
give_answer(hull.size());
return 0;
}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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
