Language: C++

#include <bits/stdc++.h>

using namespace std;

#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

typedef complex<double> P;
struct Line : public vector<int>
{
  Line(P a=P(), P b=P()) {
    push_back(a); push_back(b);
  }
};
typedef Line Segment;

#define EPS (1e-7)

bool operator < (P const& a, P const& b) {
  return (a.real() != a.real()) ? a.real() < b.real() : a.imag() < b.imag();
}

double dot(P const& a, P const& b) {
  return real(conj(a)*b);
}

double cross(P const& a, P const& b) {
  return imag(conj(a)*b);
}

P projection_point(P const& a, P const& b, P const& c) {
  double k = dot(b-a, c-a) / norm(b-a);
  return a+k*(b-a);
}

P reflection_point(P const& a, P const& b, P const& c) {
  return c + 2.*(projection_point(a, b, c) - c);
}

bool is_parallel(Segment const& s, Segment const& t) {
  return abs(cross(s[1]-s[0], t[1]-t[0])) < EPS;
}

bool is_orthogonal(Segment const& s, Segment const& t) {
  return abs(dot(s[1]-s[0], t[1]-t[0])) < EPS;
}

int ccw(P a, P b, P c) {
  b -= a, c -= a;
  if(cross(b, c) > 0) return +1; // counter clockwise
  if(cross(b, c) < 0) return -1;  // clockwise
  if(dot(b, c) < 0) return +2;    // c-a-b
  if(norm(b) < norm(c)) return -2;  // a-b-c
  return 0; // on segment
}

bool is_intersect_ss(Segment s, Segment t) {
  return ccw(s[0], s[1], t[0]) * ccw(s[0], s[1], t[1]) <= 0
         && ccw(t[0], t[1], s[0]) * ccw(t[0], t[1], s[1]) <= 0;
}

int main () {
  
  int q; cin >> q;
  for(;q--;) {
    Segment s, t;
    cin >> s[0].real() >> s[0].imag();
    cin >> s[1].real() >> s[1].imag();
    cin >> t[0].real() >> t[0].imag();
    cin >> t[1].real() >> t[1].imag();
    
    cout << is_intersect(s, t) << endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In constructor 'Line::Line(P, P)':
a.cc:12:14: error: no matching function for call to 'Line::push_back(P&)'
   12 |     push_back(a); push_back(b);
      |     ~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'P' {aka 'std::complex<double>'} to 'const std::vector<int>::value_type&' {aka 'const int&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'P' {aka 'std::complex<double>'} to 'std::vector<int>::value_type&&' {aka 'int&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:12:28: error: no matching function for call to 'Line::push_back(P&)'
   12 |     push_back(a); push_back(b);
      |                   ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'P' {aka 'std::complex<double>'} to 'const std::vector<int>::value_type&' {aka 'const int&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'P' {aka 'std::complex<double>'} to 'std::vector<int>::value_type&&' {aka 'int&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc: In function 'int main()':
a.cc:67:17: error: request for member 'real' in 's.Line::std::vector<int>.std::vector<int>::operator[](0)', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   67 |     cin >> s[0].real() >> s[0].imag();
      |                 ^~~~
a.cc:67:32: error: request for member 'imag' in 's.Line::std::vector<int>.std::vector<int>::operator[](0)', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   67 |     cin >> s[0].real() >> s[0].imag();
      |                                ^~~~
a.cc:68:17: error: request for member 'real' in 's.Line::std::vector<int>.std::vector<int>::operator[](1)', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   68 |     cin >> s[1].real() >> s[1].imag();
      |                 ^~~~
a.cc:68:32: error: request for member 'imag' in 's.Line::std::vector<int>.std::vector<int>::operator[](1)', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   68 |     cin >> s[1].real() >> s[1].imag();
      |                                ^~~~
a.cc:69:17: error: request for member 'real' in 't.Line::std::vector<int>.std::vector<int>::operator[](0)', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   69 |     cin >> t[0].real() >> t[0].imag();
      |                 ^~~~
a.cc:69:32: error: request for member 'imag' in 't.Line::std::vector<int>.std::vector<int>::operator[](0)', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   69 |     cin >> t[0].real() >> t[0].imag();
      |                                ^~~~
a.cc:70:17: error: request for member 'real' in 't.Line::std::vector<int>.std::vector<int>::operator[](1)', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   70 |     cin >> t[1].real() >> t[1].imag();
      |                 ^~~~
a.cc:70:32: error: request for member 'imag' in 't.Line::std::vector<int>.std::vector<int>::operator[](1)', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   70 |     cin >> t[1].real() >> t[1].imag();
      |                                ^~~~
a.cc:72:13: error: 'is_intersect' was not declared in this scope; did you mean 'is_intersect_ss'?
   72 |     cout << is_intersect(s, t) << endl;
      |             ^~~~~~~~~~~~
      |             is_intersect_ss