# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
503326 | rainboy | Kućice (COCI21_kucice) | C11 | 3 ms | 280 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 <stdio.h>
#define N 100
#define MD 1000000007
int pp2[N + 1];
void init() {
int i;
pp2[0] = 1;
for (i = 1; i <= N; i++)
pp2[i] = pp2[i - 1] * 2 % MD;
}
int xx[N], yy[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() {
int n, i, j, k, ans;
init();
scanf("%d", &n);
if (n > N) {
printf("%lld\n", (long long) pp2[n - 1] * n % MD);
return 0;
}
for (i = 0; i < n; i++)
scanf("%d%d", &xx[i], &yy[i]);
ans = (long long) (pp2[n] - 1) * n % MD;
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
if (j != i) {
int cnt = 0;
for (k = 0; k < n; k++)
if (k != i && cross(i, j, k) < 0)
cnt++;
ans = (ans - pp2[cnt] + MD) % MD;
}
printf("%d\n", ans);
return 0;
}
Compilation message (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |