Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⣠⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⢀⣠⡯⠀⠀⠀⢠⡐⠀⠀⠀⠀⠀
- ⠀⠀⠀⢀⣤⠔⠂⠀⠀⠀⢤⣤⣤⣤⣄⣀⣀⣀⣀⡀⠀⢀⣀⣀⣀⡀⠀⠀⠀⢀⢀⣀⣠⣤⣴⣶⣾⠉⠉⠙⣶⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⣰⣿⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀
- ⠀⠀⠰⣿⣷⣾⣿⣷⣴⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏⠉⠛⢿⣿⣿⣿⣿⣿⣿⣿⠿⠿⣿⣶⣿⣿⣿⣿⣤⣂⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⣤⣤⣤⣴⣦⣾⣿⣿⣿⣶⣦⣴⣶⣶⠀
- ⠀⠀⠀⣿⣿⣿⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⣤⣶⣶⣿⣿⣿⣿⣿⣿⣿⣯⣤⣤⣿⡿⠿⠿⠿⠛⠛⠛⠛⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣽⣿⣿⡟⢻⣿⣿⣿⡟⣿⣿⣿⣿⠉⠉⠁⠀
- ⠀⠀⠀⣹⣟⣿⣦⠈⠻⠋⢉⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⣠⣾⣿⣿⣏⣤⣾⣿⣿⣿⡆⠀
- ⠀⠀⢀⣿⣿⣿⣿⣦⠀⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠟⢿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡧⠀
- ⠀⠀⢸⣿⣿⣿⣿⣿⡀⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡈⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⡿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⡄⠀
- ⠀⠀⠈⠿⠿⠁⣿⣿⣿⠎⠻⣯⠉⠉⠉⠈⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⢹⣿⢻⠉⠉⠁⠈⠻⢦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠁⠉⠙⠛⠛⢿⣿⠟⠋⠁⠀⠀⠀⠈⠀
- ⠀⠀⠀⠀⠀⠀⢹⣿⡟⠀⠀⠈⠳⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⠞⠀⠀⠀⠀⠀⠀⠙⠳⠤⠤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠁⠀⠀⠀⠀⠀⠸⣿⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⠀
- ⠀⠀⠀⠀⠀⠀⢈⡟⠇⠀⠀⠀⠀⠈⠁⠤⠤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣶⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⢹⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
- ⠀⠀⠀⠀⠀⠀⠀⠙⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠻⠂⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⡘⡀⠀
- ⠀⠀⠀⠀⠀⠀ ⠀⠀⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
- */
- #include <iostream>
- #include <string>
- #include <sstream>
- #include <vector>
- #include <cmath>
- #include <algorithm>
- #include <memory.h>
- #include <stdio.h>
- #include <stack>
- #include <deque>
- #include <queue>
- #include <set>
- #include <iterator>
- #include <map>
- #include <iomanip>
- #include <unordered_set>
- #include <array>
- #include <random>
- #include <ctime>
- #include <chrono>
- #include <cstdlib>
- //#define int long long
- #define pb push_back
- #define fir first
- #define sec second
- #define double long double
- #define endl "\n"
- #define un unsigned
- #define INF 1000000000009
- #define EPS 0.00000001
- #define pii pair<int, int>
- #define all(v) v.begin(), v.end()
- using namespace std;
- const int N = 1000007, MOD = 1e9 + 7, R = 1 << 20, logn = 19, ABC = 26;
- const double PI = acos(-1);
- mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
- struct Point
- {
- int x, y;
- Point(int a, int b) : x(a), y(b) {}
- Point() : x(0), y(0) {}
- };
- struct Vector
- {
- Point a;
- Vector(Point a) : a(a) {}
- Vector(Point a, Point b) : a({ b.x - a.x, b.y - a.y }) {}
- Vector(int x, int y) : a({ x, y }) {}
- Vector(int x1, int y1, int x2, int y2) : a({ x2 - x1, y2 - y1 }) {}
- };
- istream& operator >> (istream& in, Point& a)
- {
- in >> a.x >> a.y;
- return in;
- }
- int dot_product(Point a, Point b)
- {
- return a.x * b.x + a.y * b.y;
- }
- int cross_product(Point a, Point b)
- {
- return a.x * b.y - a.y * b.x;
- }
- double angle(Point a, Point b)
- {
- double an = atan2(cross_product(a, b), dot_product(a, b));
- return abs(an);
- }
- signed main()
- {
- ios_base::sync_with_stdio(false);
- cin.tie(0);
- cout.tie(0);
- cout.precision(20);
- Point a, b, c, p;
- cin >> a >> b >> c >> p;
- Vector aa(b, a), bb(b, c), cc(b, p);
- double q = angle(aa.a, cc.a), w = angle(cc.a, bb.a), e = angle(aa.a, bb.a);
- if (abs(q + w - e) <= EPS)
- {
- cout << "YES";
- }
- else
- {
- cout << "NO";
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment