# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
407167 | Victor | 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.
int main() {
cin.tie(0)->sync_with_stdio(0);
cin.exceptions(cin.failbit);
bitset<501> taken;
int city;
int n = get_n();
rep(i, 1, n + 1) {
int nxt = i == 1 ? 2 : 1;
rep(j, 1, n + 1) {
if (i == j || j == nxt) continue;
if (is_clockwise(i, nxt, j)) nxt = j;
}
bool onborder = true;
rep(j, 1, n + 1) {
if (i == j || j == nxt) continue;
if (is_clockwise(i, nxt, j)) onborder = false;
}
if (onborder) {
city = nxt;
taken[i] = 1;
}
}
while (!taken[city]) {
taken[city] = 1;
int nxt = city == 1 ? 2 : 1;
rep(j, 1, n + 1) {
if (city == j || j == nxt) continue;
if (is_clockwise(city, nxt, j)) nxt = j;
}
city=nxt;
}
cout << taken.count() << endl;
return 0;
}