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<unordered_map>
#include "trilib.h"
#define rep(i,a,b) for(int i=int(a);i<int(b);i++)
#define rrep(i,a,b) for(int i=int(a);i>int(b);i--)
#define all(v) v.begin(),v.end()
#define trav(a,v) for(auto&a:v)
#define sz(a) a.size()
typedef long double ld;
using namespace std;
const long long inf = 1e15;
typedef long long ll;
typedef unsigned long long ull;
int n = get_n();
int main() {
vector<ll> res(n + 1, -1);
rep(i, 1, n + 1) {
if (res[i] != -1) {
continue;
}
rep(j, 1, n + 1) {
if (i == j)continue;
if (j == 0)continue;
ll cur = 0;
bool done = true;
rep(z, 1, n + 1) {
if (z == i || z == j)continue;
if (is_clockwise(i, j, z)) {
done = false;
if (cur == -1)break;
cur = 1;
}
else if (is_clockwise(i, j, z)) {
done = false;
if (cur == 1)break;
cur = -1;
}
}
if (done) {
res[i] = 1;
res[j] = 1;
break;
}
}
if (res[i] == -1)res[i] = 0;
}
ll ans = 0;
rep(i, 1, n + 1)ans += res[i];
give_answer(ans);
return 0;
}
# | 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... |