fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define el "\n"
  4. #define ll long long
  5. #define ull unsigned long long
  6. #define se second
  7. #define fi first
  8. #define be begin()
  9. #define en end()
  10. #define Faster cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
  11. struct toado
  12. {
  13. double x,y;
  14. friend istream& operator >> (istream& in, toado &a)
  15. {
  16. in >> a.x >> a.y;
  17. return in;
  18. }
  19. };
  20. double Stamgiac(toado a, toado b, toado c)
  21. {
  22. return fabs(a.x*(b.y - c.y) + b.x*(c.y - a.y) + c.x*(a.y - b.y))/ 2.0;
  23.  
  24. }
  25. bool check(toado a, toado b, toado c, toado d)
  26. {
  27. if(Stamgiac(a,b,c) == Stamgiac(a,b,d) + Stamgiac(a,d,c) + Stamgiac(d,b,c)) return true;
  28. return false;
  29. }
  30. int main()
  31. {
  32. Faster;
  33. toado a, b, c, d;
  34. cin >> a >> b >> c >> d;
  35. if(check(a,b,c,d)) cout << "Yes";
  36. else cout << "No";
  37. return 0;
  38. }
  39. //code by chat gpt
Success #stdin #stdout 0.01s 5280KB
stdin
2 2 0 0 1 0 0 1
stdout
No