# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
444142 | Haruto810198 | 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.cpp"
using namespace std;
#define int long long
#define double long double
#define FOR(i, l, r, d) for(int i=(l); i<=(r); i+=(d))
#define szof(x) ((int)(x).size())
#define vi vector<int>
#define pii pair<int, int>
#define F first
#define S second
#define pb push_back
#define eb emplace_back
#define mkp make_pair
const int INF = 2147483647;
const int LNF = INF*INF;
const int MOD = 1000000007;
const int mod = 998244353;
const int MAX = 40010;
int N;
bool is_CH[MAX];
int res;
void is_CH_edge(int u, int v){
bool L=0, R=0;
FOR(i, 1, N, 1){
if(i==u or i==v) continue;
bool ans = is_clockwise(u, v, i);
if(ans == true){
R = 1;
}
else{
L = 1;
}
}
if(L==0 or R==0){
is_CH[u] = 1;
is_CH[v] = 1;
}
}
signed main(){
//ios_base::sync_with_stdio(false);
//cin.tie(0);
//cout.tie(0);
N = get_n();
FOR(i, 1, N, 1){
is_CH[MAX] = 0;
}
FOR(i, 1, N, 1){
FOR(j, i+1, N, 1){
is_CH_edge(i, j);
}
}
res = 0;
FOR(i, 1, N, 1){
res += is_CH[i];
}
give_answer(res);
return 0;
}