File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments