Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <string>
- #include <iomanip>
- #include <queue>
- #include <cmath>
- #include <algorithm>
- #include <unordered_map>
- #include <tuple>
- #include <iomanip>
- #include <stdio.h>
- #include <map>
- #include <bitset>
- #include <set>
- #include <stack>
- #include <queue>
- #include <unordered_set>
- #include <cassert>
- #include <stdlib.h>
- #include <time.h>
- #include <random>
- //#pragma GCC optimize("Ofast,no-stack-protector")
- //#pragma GCC target("sse,sse2,sse3,sse3,sse4")
- //#pragma GCC optimize("unroll-loops")
- //#pragma GCC optimize("fast-math")
- //#pragma GCC target("avx2")
- //#pragma GCC optimize("section-anchors")
- //#pragma GCC optimize("profile-values,profile-reorder-functions,tracer")
- //#pragma GCC optimize("vpt")
- //#pragma GCC optimize("rename-registers")
- //#pragma GCC optimize("move-loop-invariants")
- //#pragma GCC optimize("unswitch-loops")
- //#pragma GCC optimize("function-sections")
- //#pragma GCC optimize("data-sections")
- #define int long long
- #define ll long long
- #define ull unsigned long long
- #define all(a) (a).begin(), (a).end()
- #define pii pair<int, int>
- #define pb push_back
- #define ld long double
- using namespace std;
- //const int INF = 1e17;
- //const int mod = 2600000069;
- //const int p = 179;
- const ld PI = 3.141592653589793238463;
- struct Point {
- int x, y;
- Point() {}
- Point(int x_, int y_) {
- x = x_;
- y = y_;
- }
- };
- istream& operator >> (istream& in, Point& a) {
- return in >> a.x >> a.y;
- }
- ostream& operator << (ostream& out, Point& a) {
- return out << a.x << " " << a.y;
- }
- Point operator-(Point& a, Point& b) {
- return Point(a.x - b.x, a.y - b.y);
- }
- void operator-=(Point& a, Point& b) {
- a = a - b;
- }
- void operator*=(Point& a, int k) {
- a.x *= k;
- a.x *= k;
- }
- int operator%(Point a, Point b) { //scalar
- return a.x * b.x + a.y * b.y;
- }
- bool operator*(Point a, Point b) { //vec
- return (a.x * b.y - a.y * b.x) >= 0;
- }
- ld angle(Point a, Point b) {
- return abs(atan2(a * b, a % b)) * (360.0/PI);
- }
- signed main() {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- Point a, o, c, p;
- cin >> a >> o >> c >> p;
- a -= o;
- c -= o;
- p -= o;
- o = Point(0, 0);
- if (a * p == p * c && a * p == a * c) cout << "YES\n";
- else cout << "NO\n";
- }
- /*
- 0 0
- 3 0
- 0 4
- */
Add Comment
Please, Sign In to add comment