Skip to content

Commit 17fdf22

Browse files
committed
atcoder/abc181C
1 parent 5a2b7cd commit 17fdf22

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

atcoder/abc181/C/main.cpp

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#include <bits/stdc++.h>
2+
3+
using namespace std;
4+
using ll = int64_t;
5+
using ff = long double;
6+
7+
int N;
8+
vector<int> xs, ys;
9+
10+
bool solve() {
11+
for (int i = 0; i < N; ++i) {
12+
for (int j = 0; j < N; ++j) {
13+
if (i == j) continue;
14+
for (int k = 0; k < N; ++k) {
15+
if (k == i || k == j) continue;
16+
int lhs = (ys[j] - ys[i]) * (xs[k] - xs[j]);
17+
int rhs = (ys[k] - ys[j]) * (xs[j] - xs[i]);
18+
if (lhs == rhs) return true;
19+
}
20+
}
21+
}
22+
return false;
23+
}
24+
25+
int main() {
26+
ios_base::sync_with_stdio(false);
27+
cin.tie(0); cout.tie(0);
28+
29+
cin >> N;
30+
xs.assign(N, 0);
31+
ys.assign(N, 0);
32+
for (int i = 0; i < N; ++i) {
33+
cin >> xs[i] >> ys[i];
34+
}
35+
36+
auto ans = solve() ? "Yes" : "No";
37+
cout << ans << endl;
38+
39+
return 0;
40+
}

0 commit comments

Comments
 (0)