Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_ll.hpp>
//typedef boost::multiprecision::cpp_ll ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E18;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define endl "\n"
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

struct data{
    ll val[2];
};
ll gcd(ll x,ll y){
    if(x<y) return gcd(y,x);
    if(y==0) return x;
    return gcd(y,x%y);
}
ll hpow(ll x,ll y){
    ll ans=1;
    ll i=x;
    if(y==0)return 1;
    while(y>0){
        if(y%2==1){
            ans=(ans*i)%i_7;
        }
        i=(i*i)%i_7;
        y=y/2;
        
    }
    return ans;
}

int main(){fastio
    ll n;cin>>n;
    map<l_l,data> mp;
    ll a[n],b[n];
    rep(i,0,n-1){
        cin>>a[i]>>b[i];
        if(a[i]!=0 && b[i]!=0){
            ll g=gcd(abs(a[i]),abs(b[i]));
            a[i]/=g;
            b[i]/=g;
        }
        ll flag=0;
        if(a[i]>=0 && b[i]>0){
            flag=0;
        }else if(a[i]>0 && b[i]<=0){
            ll aa=a[i];
            ll bb=b[i];
            a[i]=-1*bb;
            b[i]=aa;
            flag=1;
        }else if(a[i]<=0 && b[i]<0){
            a[i]=-a[i];
            b[i]=-b[i];
            flag=0;
        }else{
            ll aa=a[i];
            ll bb=b[i];
            a[i]=bb;
            b[i]=-1*aa;
            flag=1;
        }
        if(a[i]==0){
            if(b[i]==0){
                mp[l_l(a[i],b[i])].val[0]=0;
                mp[l_l(a[i],b[i])].val[1]=0;
                continue;
            }else{
                b[i]=1;
            }
        }
        if(mp.find(l_l(a[i],b[i]))==mp.end()){
            mp[l_l(a[i],b[i])].val[flag]=1;
            mp[l_l(a[i],b[i])].val[1-flag]=0;
        }else{
            mp[l_l(a[i],b[i])].val[flag]++;
        }
        
    }
    ll ans=1;
    //cout<<endl;
    for(auto i=mp.begin();i!=mp.end();++i){
        l_l key=i->first;
        data value;
        value.val[0]=i->second.val[0];
        value.val[1]=i->second.val[1];
        ll x=key.first;
        ll y=key.second;
        //cout<<x<<' '<<y<<endl;
        ans=mod(ans*(hpow(2,value.val[0])+hpow(2,value.val[1])-1));
        //cout<<value.val[0]<<' '<<value.val[1]<<endl;
        //cout<<max(value.val[0],value.val[1])+1<<endl;
    }
    cout<<ans-1<<endl;
    
    
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:53:17: error: template argument 2 is invalid
   53 |     map<l_l,data> mp;
      |                 ^
a.cc:53:17: error: template argument 4 is invalid
a.cc:84:19: error: no match for 'operator[]' (operand types are 'int' and 'l_l' {aka 'std::pair<long long int, long long int>'})
   84 |                 mp[l_l(a[i],b[i])].val[0]=0;
      |                   ^
a.cc:85:19: error: no match for 'operator[]' (operand types are 'int' and 'l_l' {aka 'std::pair<long long int, long long int>'})
   85 |                 mp[l_l(a[i],b[i])].val[1]=0;
      |                   ^
a.cc:91:15: error: request for member 'find' in 'mp', which is of non-class type 'int'
   91 |         if(mp.find(l_l(a[i],b[i]))==mp.end()){
      |               ^~~~
a.cc:91:40: error: request for member 'end' in 'mp', which is of non-class type 'int'
   91 |         if(mp.find(l_l(a[i],b[i]))==mp.end()){
      |                                        ^~~
a.cc:92:15: error: no match for 'operator[]' (operand types are 'int' and 'l_l' {aka 'std::pair<long long int, long long int>'})
   92 |             mp[l_l(a[i],b[i])].val[flag]=1;
      |               ^
a.cc:93:15: error: no match for 'operator[]' (operand types are 'int' and 'l_l' {aka 'std::pair<long long int, long long int>'})
   93 |             mp[l_l(a[i],b[i])].val[1-flag]=0;
      |               ^
a.cc:95:15: error: no match for 'operator[]' (operand types are 'int' and 'l_l' {aka 'std::pair<long long int, long long int>'})
   95 |             mp[l_l(a[i],b[i])].val[flag]++;
      |               ^
a.cc:101:19: error: request for member 'begin' in 'mp', which is of non-class type 'int'
  101 |     for(auto i=mp.begin();i!=mp.end();++i){
      |                   ^~~~~
a.cc:101:33: error: request for member 'end' in 'mp', which is of non-class type 'int'
  101 |     for(auto i=mp.begin();i!=mp.end();++i){
      |                                 ^~~
a.cc:103:9: error: reference to 'data' is ambiguous
  103 |         data value;
      |         ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:28:8: note:                 'struct data'
   28 | struct data{
      |        ^~~~
a.cc:104:9: error: 'value' was not declared in this scope
  104 |         value.val[0]=i->second.val[0];
      |         ^~~~~