| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 537116 | rainboy | 별자리 2 (JOI14_constellation2) | C11 | 9070 ms | 340 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#include <string.h>
#define N 3000
int xx[N], yy[N], cc[N];
long long cross(int i, int j, int k) {
return (long long) (xx[j] - xx[i]) * (yy[k] - yy[i]) - (long long) (xx[k] - xx[i]) * (yy[j] - yy[i]);
}
int main() {
static int kk[3], ll[3];
int n, i, j, k;
long long ans;
scanf("%d", &n);
for (i = 0; i < n; i++)
scanf("%d%d%d", &xx[i], &yy[i], &cc[i]);
ans = 0;
for (i = 0; i < n; i++)
for (j = i + 1; j < n; j++) {
memset(kk, 0, sizeof kk);
memset(ll, 0, sizeof ll);
for (k = 0; k < n; k++)
if (k != i && k != j) {
if (cross(i, j, k) < 0)
kk[cc[k]]++;
else
ll[cc[k]]++;
}
ans += (long long) kk[(cc[i] + 1) % 3] * kk[(cc[i] + 2) % 3] * ll[(cc[j] + 1) % 3] * ll[(cc[j] + 2) % 3];
}
printf("%lld\n", ans);
return 0;
}컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
