Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using P = pair<ll, ll>;
#define debug(var) cerr << "[" << #var << "] " << var << endl
#define chmin(x, y) x = min(x, y)
const ll mod = 1000000007;
const double eps = 1E-18;

struct mint {
    ll x; // typedef long long ll;
    mint(ll x=0):x((x%mod+mod)%mod){}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const {
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }
    
    // for prime mod
    mint inv() const {
        return pow(mod-2);
    }
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res/=a;
    }
};

struct V {
  double x, y;
  V(double x=0, double y=0): x(x), y(y) {}
  V& operator+=(const V& v) { x += v.x; y += v.y; return *this;}
  V operator+(const V& v) const { return V(*this) += v;}
  V& operator-=(const V& v) { x -= v.x; y -= v.y; return *this;}
  V operator-(const V& v) const { return V(*this) -= v;}
  V& operator*=(double s) { x *= s; y *= s; return *this;}
  V operator*(double s) const { return V(*this) *= s;}
  V& operator/=(double s) { x /= s; y /= s; return *this;}
  V operator/(double s) const { return V(*this) /= s;}
  double dot(const V& v) const { return x*v.x + y*v.y;}
  double cross(const V& v) const { return x*v.y - v.x*y;}
  double norm2() const { return x*x + y*y;}
  double norm() const { return sqrt(norm2());}
  V rotate90() const { return V(y, -x);}
  int ort() const { // orthant
    if (abs(x) < eps && abs(y) < eps) return 0;
    if (y > 0) return x>0 ? 1 : 2;
    else return x>0 ? 4 : 3;
  }
  bool operator<(const V& v) const {
    int o = ort(), vo = v.ort();
    if (o != vo) return o < vo;
    return cross(v) > 0;
  }
};


bool eq[200005];

int main(){
    ll n;
    cin >> n;
    ll special = 0;
    vector<P> v(n);
    rep(i, n) {
        cin >> v[i].first >> v[i].second;
        if (v[i].second<0) {
            v[i].first *= -1;
            v[i].second *= -1;
        }
        if (v[i].second==0 && v[i].first<0) {
            v[i].first *= -1;
            v[i].second *= -1;
        }
        if (v[i].first==0 && v[i].second==0) {
            special++;
            v.pop_back();
            n--;
        }
    }

    auto comp = [](P a, P b) {
        V va(a.first, a.second);
        V vb(b.first, b.second);
        return va<vb;
    };
    sort(v.begin(), v.end(), comp);

/*
    rep(i, n) {
        debug(v[i].first);
        debug(v[i].second);
        debug(atan2(v[i].second, v[i].first));
    }
*/
    ll l = 0;
    ll r = 0;
    rep(i, n) {
        if (v[i].first<=0) {
            r = i;
            break;
        }
    }
    ll r0 = r;
    

    rep(i, n-1) {
        P p1 = v[i];
        P p2 = v[i+1];
        ll x1 = p1.first;
        ll y1 = p1.second;
        ll x2 = p2.first;
        ll y2 = p2.second;
        ll dot = -x1*y2+y1*x2;
        if (dot==0) eq[i] = true;
    }

    vector<P> all;
    //debug(r0);
    

    while (l<r0 || r<n) {
        //debug(l);
        //debug(r);
        if (l==r0) {
            r++;
            all.emplace_back(0, 1);
            continue;
        }
        if (r==n) {
            l++;
            all.emplace_back(1, 0);
            continue;
        }
        P p1 = v[l];
        P p2 = v[r];
        ll x1 = p1.first;
        ll y1 = p1.second;
        ll x2 = p2.first;
        ll y2 = p2.second;
        ll dot = x1*x2+y1*y2;
        if (dot>0) {
            r++;
            all.emplace_back(0, 1);
            continue;
        }
        if (dot<0) {
            l++;
            all.emplace_back(1, 0);
            continue;
        }
        P res = P(1, 1);
        //debug(x1);
        if ((!eq[l]) && (!eq[r])) {
            l++;
            r++;
            all.push_back(res);
            continue;
        }
        while (l<r0 && eq[l]) {
            l++;
            res.first++;
        }
        while (r<n && eq[r]) {
            r++;
            res.second++;
        }
        l++;
        r++;
        //debug(res.first);
        //debug(res.second);
        all.push_back(res);
    }


    //debug(all.size());

    
    mint ans(1);
    for (auto p: all) {
        //debug(p.first);
        //debug(p.second);
        ll num1 = p.first;
        ll num2 = p.second;
        mint add = mint(1);
        add += (mint(2).pow(num1)-1);
        add += (mint(2).pow(num2)-1);
        ans *= add;
    }
    if (special>0) {
        ans += special*(mint(2).pow(n));
    }
    ans -= mint(1);
    
    cout << ans.x << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:225:23: error: no match for 'operator*' (operand types are 'll' {aka 'long long int'} and 'mint')
  225 |         ans += special*(mint(2).pow(n));
      |                ~~~~~~~^~~~~~~~~~~~~~~~~
      |                |                   |
      |                |                   mint
      |                ll {aka long long int}
In file included from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
                 from a.cc:1:
/usr/include/c++/14/complex:400:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const complex<_Tp>&)'
  400 |     operator*(const complex<_Tp>& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/complex:400:5: note:   template argument deduction/substitution failed:
a.cc:225:39: note:   mismatched types 'const std::complex<_Tp>' and 'll' {aka 'long long int'}
  225 |         ans += special*(mint(2).pow(n));
      |                                       ^
/usr/include/c++/14/complex:409:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const _Tp&)'
  409 |     operator*(const complex<_Tp>& __x, const _Tp& __y)
      |     ^~~~~~~~
/usr/include/c++/14/complex:409:5: note:   template argument deduction/substitution failed:
a.cc:225:39: note:   mismatched types 'const std::complex<_Tp>' and 'll' {aka 'long long int'}
  225 |         ans += special*(mint(2).pow(n));
      |                                       ^
/usr/include/c++/14/complex:418:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const complex<_Tp>&)'
  418 |     operator*(const _Tp& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/complex:418:5: note:   template argument deduction/substitution failed:
a.cc:225:39: note:   'mint' is not derived from 'const std::complex<_Tp>'
  225 |         ans += special*(mint(2).pow(n));
      |                                       ^
In file included from /usr/include/c++/14/valarray:605,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)'
  407 |     _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:407:5: note:   template argument deduction/substitution failed:
a.cc:225:39: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'll' {aka 'long long int'}
  225 |         ans += special*(mint(2).pow(n));
      |                                       ^
/usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)'
  407 |     _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:407:5: note:   template argument deduction/substitution failed:
a.cc:225:39: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'll' {aka 'long long int'}
  225 |         ans += special*(mint(2).pow(n));
      |                                       ^
/usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
  407 |     _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:407:5: note:   template argument deduction/substitution failed:
a.cc:225:39: note:   'mint' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
  225 |         ans += special*(mint(2).pow(n));
      |                                       ^
/usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)'
  407 |     _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:407:5: note:   template argument deduction/substitution failed:
a.cc:225:39: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'll' {aka 'long long int'}
  225 |         ans += special*(mint(2).pow(n));
      |                                       ^
/usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
  407 |     _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:407:5: note:   template argument deduction/substitution failed:
a.cc:225:39: note:   'mint' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
  225 |         ans += special*(mint(2).pow(n));
      |                                       ^
/usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const valarray<_Tp>&)'
 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1198:1: note:   template argument deduction/substitution failed:
a.cc:225:39: note:   mismatched types 'const std::valarray<_Tp>' and 'll' {aka 'long long int'}
  225 |         ans += special*(mint(2).pow(n));
      |                                       ^
/usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)'
 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1198:1: note:   template argument deduction/substitution failed:
a.cc:225:39: note:   mismatched types 'const std::valarray<_Tp>' and 'll' {aka 'long long int'}
  225 |         ans += special*(mint(2).pow(n));
      |                                       ^
/usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)'
 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies)
      | ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1198:1: note:   template argument deduction/substitution failed:
a.cc:225:39: note:   'mint' is not derived from 'const std::valarray<_Tp>'
  225 |         ans += special*(mint(2).pow(n));
      |                                       ^