# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
121217 | _7_7_ | Triangles (CEOI18_tri) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "trilib.h"
using namespace std;
const int N = 1e5 + 11;
int n, is_inited;
long long x[N], y[N];
int queries=0;
bool was[N];
void init() {
if (is_inited)
return;
is_inited=1;
assert(scanf("%d", &n)==1);
for (int i=1; i<=n; i++)
assert(scanf("%lld%lld", &x[i], &y[i])==2);
}
/*
int get_n() {
init();
return n;
}*/
/*
int is_clockwise(int a, int b, int c) {
init();
assert(a>=1 && a<=n);
assert(b>=1 && b<=n);
assert(c>=1 && c<=n);
assert(a!=b && a!=c && b!=c);
queries++;
if(queries == 1000 * 1000 + 1)
printf("Too many queries!");
return (x[b]-x[a])*(y[c]-y[a])-(x[c]-x[a])*(y[b]-y[a])<0;
}*/
void give_answer(int s) {
init();
s = 0;
for (int i = 1; i <= n; ++i)
for (int j = 1; j <= n; ++j) {
if (i == j)
continue;
bool ok = 1;
for (int x = 1; x <= n; ++x) {
if (i == x || j == x)
continue;
if (!is_clockwise(i, j, x)) {
ok = 0;
break;
}
}
if (ok) {
if (!was[i]) {
++s;
was[i] = 1;
}
if (!was[j]) {
was[j] = 1;
++s;
}
}
}
printf("%d\n", s);
}