lalalalalalalaalalla

Untitled

Dec 17th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <string>
  4. #include <iomanip>
  5. #include <queue>
  6. #include <cmath>
  7. #include <algorithm>
  8. #include <unordered_map>
  9. #include <tuple>
  10. #include <iomanip>
  11. #include <stdio.h>
  12. #include <map>
  13. #include <bitset>
  14. #include <set>
  15. #include <stack>
  16. #include <queue>
  17. #include <unordered_set>
  18. #include <cassert>
  19. #include <stdlib.h>
  20. #include <time.h>
  21. #include <random>
  22.  
  23.  
  24. //#pragma GCC optimize("Ofast,no-stack-protector")
  25. //#pragma GCC target("sse,sse2,sse3,sse3,sse4")
  26. //#pragma GCC optimize("unroll-loops")
  27. //#pragma GCC optimize("fast-math")
  28. //#pragma GCC target("avx2")
  29. //#pragma GCC optimize("section-anchors")
  30. //#pragma GCC optimize("profile-values,profile-reorder-functions,tracer")
  31. //#pragma GCC optimize("vpt")
  32. //#pragma GCC optimize("rename-registers")
  33. //#pragma GCC optimize("move-loop-invariants")
  34. //#pragma GCC optimize("unswitch-loops")
  35. //#pragma GCC optimize("function-sections")
  36. //#pragma GCC optimize("data-sections")
  37.  
  38. #define int long long
  39. #define ll long long
  40. #define ull unsigned long long
  41. #define all(a) (a).begin(), (a).end()
  42. #define pii pair<int, int>
  43. #define pb push_back
  44. #define ld long double
  45.  
  46.  
  47. using namespace std;
  48.  
  49. //const int INF = 1e17;
  50. //const int mod = 2600000069;
  51. //const int p = 179;
  52. const ld PI = 3.141592653589793238463;
  53.  
  54. struct Point {
  55. int x, y;
  56. Point() {}
  57. Point(int x_, int y_) {
  58. x = x_;
  59. y = y_;
  60. }
  61. };
  62.  
  63. istream& operator >> (istream& in, Point& a) {
  64. return in >> a.x >> a.y;
  65. }
  66.  
  67. ostream& operator << (ostream& out, Point& a) {
  68. return out << a.x << " " << a.y;
  69. }
  70.  
  71. Point operator-(Point& a, Point& b) {
  72. return Point(a.x - b.x, a.y - b.y);
  73. }
  74.  
  75. void operator-=(Point& a, Point& b) {
  76. a = a - b;
  77. }
  78.  
  79. void operator*=(Point& a, int k) {
  80. a.x *= k;
  81. a.x *= k;
  82. }
  83.  
  84. int operator%(Point a, Point b) { //scalar
  85. return a.x * b.x + a.y * b.y;
  86. }
  87.  
  88. bool operator*(Point a, Point b) { //vec
  89. return (a.x * b.y - a.y * b.x) >= 0;
  90. }
  91.  
  92. ld angle(Point a, Point b) {
  93. return abs(atan2(a * b, a % b)) * (360.0/PI);
  94. }
  95.  
  96. signed main() {
  97. ios_base::sync_with_stdio(0);
  98. cin.tie(0);
  99. cout.tie(0);
  100. Point a, o, c, p;
  101. cin >> a >> o >> c >> p;
  102. a -= o;
  103. c -= o;
  104. p -= o;
  105. o = Point(0, 0);
  106. if (a * p == p * c && a * p == a * c) cout << "YES\n";
  107. else cout << "NO\n";
  108. }
  109. /*
  110. 0 0
  111. 3 0
  112. 0 4
  113. */
Add Comment
Please, Sign In to add comment