# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
872886 | 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;
for(int i=1;i<=n;i++){
int mn=-1;
int mx=-1;
int st=-1;
for(int j=1;j<=n;j++){
if(i==j){
continue;
}
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;
}
}
}
//cout<<i<<' '<<mx<<' '<<mn<<endl;
if(mx==-1||mn==-1||mx==mn||is_clockwise(i,mn,mx)){
ans++;
}
}
give_answer(ans);
return 0;
}