| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 383510 | maximath_1 | Triangles (CEOI18_tri) | C++11 | 1 ms | 384 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 <iostream>
#include <assert.h>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
using namespace std;
void getConvexHull(){
int n = get_n();
vector<int> v(n - 1, 0);
iota(v.begin(), v.end(), 2);
stable_sort(v.begin(), v.end(), [&](int a, int b){
return is_clockwise(1, a, b);
});
vector<int> ch;
ch.push_back(1); ch.push_back(v[0]);
for(int i = 1; i < v.size(); i ++){
while(ch.size() >= 2 && !is_clockwise(ch[ch.size() - 2], ch.back(), v[i])) ch.pop_back();
ch.push_back(v[i]);
}
give_answer(ch.size());
}
int main(){
getConvexHull();
}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... | ||||
