Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
using namespace std;
const ll mod=1000000007;
int main(void){
    ll n;cin>>n;
    vector<ll> a(n),b(n);
    map<pair<ll,ll>,ll> mp;
    rep(i,n){
        cin>>a[i]>>b[i];
        ll buf=gcd(a[i],b[i]);
        //cout<<a[i]<<" "<<b[i]<<" "<<buf<<endl;
        mp[{a[i]/buf,b[i]/buf}]++;
    }
    
    vector<ll> s(n+1,1);//2^n
    rep(i,n) s[i+1]=s[i]*2;
    ll res=s[n]-1;
    ll inv=0,inv0=0;
    vector<int> memo;
    for(auto& p:mp){
        ll a=p.first.first,b=p.first.second,x=p.second;
        ll tmp=0;
        if(a==0&&b==0){
            inv0+=(s[x]-1)*s[n-x]-x;
            continue;
        }
        ll t1=mp[{-b,a}],t2=mp[{b,-a}];
        tmp+=(s[x]-1)*(s[t1]-1)*s[n-x-t1];
        tmp+=(s[x]-1)*(s[t2]-1)*s[n-x-t2];
        
        //ToDo 重複の処理
        
        if(t1!=0)memo.push_back({x,t1});
        if(t2!=0)memo.push_back({x,t2});
        inv+=tmp;
        inv%=mod;
    }
    inv/=2;
    cout<<inv<<endl;
    res=(mod+res-inv)%mod;
    cout<<res<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:32: error: no matching function for call to 'std::vector<int>::push_back(<brace-enclosed initializer list>)'
   37 |         if(t1!=0)memo.push_back({x,t1});
      |                  ~~~~~~~~~~~~~~^~~~~~~~
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 '<brace-enclosed initializer list>' 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 '<brace-enclosed initializer list>' to 'std::vector<int>::value_type&&' {aka 'int&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:38:32: error: no matching function for call to 'std::vector<int>::push_back(<brace-enclosed initializer list>)'
   38 |         if(t2!=0)memo.push_back({x,t2});
      |                  ~~~~~~~~~~~~~~^~~~~~~~
/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 '<brace-enclosed initializer list>' 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 '<brace-enclosed initializer list>' to 'std::vector<int>::value_type&&' {aka 'int&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~