Skip to content

Commit 751d315

Browse files
committed
solved 12781
1 parent 0240050 commit 751d315

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

12000/12781/12781.cpp

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
4+
typedef long long ll;
5+
6+
ll commutator(int x1, int y1, int x2, int y2){
7+
return x1*y2-x2*y1;
8+
}
9+
10+
ll ccw(int x1, int y1, int x2, int y2, int x3, int y3){
11+
return commutator(x1, y1, x2, y2) + commutator(x2, y2, x3, y3) + commutator(x3, y3, x1, y1);
12+
}
13+
14+
15+
int main() {
16+
ios::sync_with_stdio(false); cin.tie(NULL);
17+
18+
int x1, y1, x2, y2, x3, y3, x4, y4;
19+
20+
cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
21+
22+
if(ccw(x1, y1, x2, y2, x3, y3) * ccw(x1, y1, x2, y2, x4, y4) < 0)
23+
cout << 1 << "\n";
24+
else
25+
cout << 0 << "\n";
26+
27+
return 0;
28+
}

0 commit comments

Comments
 (0)