# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
872914 | Darren0724 | Triangles (CEOI18_tri) | C++17 | 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 <bits/stdc++.h>
#include "trilib.h"
#include "trilib.c"
using namespace std;
int32_t main() {
int n=get_n();
int cnt=0;
int ans=0;
int i=1;
int mn=-1;
int mx=-1;
int st=-1;
for(int j=2;j<=n;j++){
if(st==-1){
st=j;
mn=mx=j;
continue;
}
int t=is_clockwise(i,st,j);
if(t){
if(mx==-1||is_clockwise(i,mx,j)){
mx=j;
}
}
else{
if(mn==-1||!is_clockwise(i,mn,j)){
mn=j;
}
}
}
vector<int> pt;
for(int i=1;i<=n;i++){
if(i==mn){
continue;
}
pt.push_back(i);
}
sort(pt.begin(),pt.end(),[&](int a,int b){return is_clockwise(mn,a,b);});
give_answer(ans);
return 0;
}