Submission #53717715
Source Code Expand
// LUOGU_RID: 159742336
#include <bits/stdc++.h>
using namespace std;
typedef long long i64;
const int P = 998244353;
const int N = 205;
inline int poww(int a, int b) {
int r = 1;
for (; b; b >>= 1, a = 1ll * a * a % P) if (b & 1) r = 1ll * r * a % P;
return r;
}
int n;
int x[N], y[N];
set<pair<i64, i64>> s;
pair<i64, i64> calc(int i, int j) {
if (x[i] == x[j]) return make_pair(1e18, (i64)(x[i] * 1e9 + 0.5));
double k = 1.0 * (y[i] - y[j]) / (x[i] - x[j]);
double b = y[i] - k * x[i];
return make_pair((i64)(k * 1e9 + 0.5), (i64)(b * 1e9 + 0.5));
}
int main(void) {
ios::sync_with_stdio(0);
cin >> n;
int ans = poww(2, n) - n - 1;
for (int i = 1; i <= n; ++i) cin >> x[i] >> y[i];
for (int i = 1; i < n; ++i)
for (int j = i + 1; j <= n; ++j) {
auto it = calc(i, j);
if (s.count(it)) continue;
int cnt = 0;
for (int k = 1; k <= n; ++k)
if (i == k || j == k || calc(i, k) == it) ++cnt;
ans = (ans - poww(2, cnt) + cnt + 1) % P;
s.insert(it);
}
cout << (ans + P) % P << "\n";
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | E - ConvexScore |
| User | james1BadCreeper |
| Language | C++ 17 (gcc 12.2) |
| Score | 700 |
| Code Size | 1229 Byte |
| Status | AC |
| Exec Time | 21 ms |
| Memory | 4732 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 700 / 700 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 0_000.txt, 0_001.txt, 0_002.txt |
| All | 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt, 1_018.txt, 1_019.txt, 1_020.txt, 1_021.txt, 1_022.txt, 1_023.txt, 1_024.txt, 1_025.txt, 1_026.txt, 1_027.txt, 1_028.txt, 1_029.txt, 1_030.txt, 1_031.txt, 1_032.txt, 1_033.txt, 1_034.txt, 1_035.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 0_000.txt | AC | 1 ms | 3480 KiB |
| 0_001.txt | AC | 1 ms | 3384 KiB |
| 0_002.txt | AC | 1 ms | 3324 KiB |
| 1_003.txt | AC | 1 ms | 3320 KiB |
| 1_004.txt | AC | 1 ms | 3416 KiB |
| 1_005.txt | AC | 6 ms | 3932 KiB |
| 1_006.txt | AC | 1 ms | 3612 KiB |
| 1_007.txt | AC | 7 ms | 3788 KiB |
| 1_008.txt | AC | 5 ms | 3720 KiB |
| 1_009.txt | AC | 7 ms | 3816 KiB |
| 1_010.txt | AC | 3 ms | 3640 KiB |
| 1_011.txt | AC | 9 ms | 4016 KiB |
| 1_012.txt | AC | 10 ms | 4128 KiB |
| 1_013.txt | AC | 6 ms | 3884 KiB |
| 1_014.txt | AC | 1 ms | 3412 KiB |
| 1_015.txt | AC | 1 ms | 3332 KiB |
| 1_016.txt | AC | 1 ms | 3328 KiB |
| 1_017.txt | AC | 21 ms | 4664 KiB |
| 1_018.txt | AC | 21 ms | 4628 KiB |
| 1_019.txt | AC | 11 ms | 4072 KiB |
| 1_020.txt | AC | 12 ms | 4040 KiB |
| 1_021.txt | AC | 13 ms | 4236 KiB |
| 1_022.txt | AC | 16 ms | 4352 KiB |
| 1_023.txt | AC | 19 ms | 4556 KiB |
| 1_024.txt | AC | 19 ms | 4560 KiB |
| 1_025.txt | AC | 18 ms | 4396 KiB |
| 1_026.txt | AC | 16 ms | 4608 KiB |
| 1_027.txt | AC | 1 ms | 3476 KiB |
| 1_028.txt | AC | 1 ms | 3532 KiB |
| 1_029.txt | AC | 16 ms | 4412 KiB |
| 1_030.txt | AC | 21 ms | 4732 KiB |
| 1_031.txt | AC | 20 ms | 4636 KiB |
| 1_032.txt | AC | 20 ms | 4620 KiB |
| 1_033.txt | AC | 20 ms | 4676 KiB |
| 1_034.txt | AC | 21 ms | 4700 KiB |
| 1_035.txt | AC | 12 ms | 4076 KiB |