Language: C++

#include<bits/stdc++.h>
using namespace std;

using ll=long long;
using P=pair<ll,ll>;
#define mod 1000000007

ll gcd(ll a,ll b){
  if(a%b==0) return b;
  else{
    return gcd(b,a%b);
  }
}

ll modpow(ll n,ll m=mod-2){
  ll r=1;
  while(m) r=r*((m%2)?n:1)%mod,n=n*n%mod,m>>=1;
  return r;
}

int main(){

  int n;
  cin >> n;

  map<P,P> mp;
  long long zero=0;
  ll sum = 1;

  for(int i=0;i<n;i++){
    ll a,b;
    cin >> a >> b;
    if(a==0 && b==0) zero++;
    else if(a==0){
      mp[{1,0}].first++;
    }else if(b==0){
      mp[{1,0}}].second++;
    }else{
      ll g = gcd(a, b);
      a=a/g;
      b=b/g;
      if(mp[{b,-a}})].first>0) mp[{b,-a}].second++;
      else if({-b,a}].first>0) mp[{-b,a}].second++;
      else mp[{a,b}].first++;
    }
  }

  for(auto p:mp){
    ll s = p.second.first%mod;
    ll t = p.second.second%mod;
    ll now = 1;
    now += modpow(2,s)-1;
    now += modpow(2,t)-1;
    sum *= now;
    sum = sum%mod;
  }

  cout << (sum+zero-1+mod)%mod << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:15: error: expected ']' before '}' token
   37 |       mp[{1,0}}].second++;
      |               ^
      |               ]
a.cc:37:15: error: expected ';' before '}' token
   37 |       mp[{1,0}}].second++;
      |               ^
      |               ;
a.cc:37:16: error: expected primary-expression before ']' token
   37 |       mp[{1,0}}].second++;
      |                ^
a.cc:38:6: error: 'else' without a previous 'if'
   38 |     }else{
      |      ^~~~
a.cc:39:18: error: 'a' was not declared in this scope
   39 |       ll g = gcd(a, b);
      |                  ^
a.cc:39:21: error: 'b' was not declared in this scope
   39 |       ll g = gcd(a, b);
      |                     ^
a.cc:42:19: error: expected ']' before '}' token
   42 |       if(mp[{b,-a}})].first>0) mp[{b,-a}].second++;
      |                   ^
      |                   ]
a.cc:42:12: error: no match for 'operator[]' (operand types are 'std::map<std::pair<long long int, long long int>, std::pair<long long int, long long int> >' and '<brace-enclosed initializer list>')
   42 |       if(mp[{b,-a}})].first>0) mp[{b,-a}].second++;
      |            ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::pair<long long int, long long int>; _Tp = std::pair<long long int, long long int>; _Compare = std::less<std::pair<long long int, long long int> >; _Alloc = std::allocator<std::pair<const std::pair<long long int, long long int>, std::pair<long long int, long long int> > >; mapped_type = std::pair<long long int, long long int>; key_type = std::pair<long long int, long long int>]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::map<std::pair<long long int, long long int>, std::pair<long long int, long long int> >::key_type&' {aka 'const std::pair<long long int, long long int>&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::pair<long long int, long long int>; _Tp = std::pair<long long int, long long int>; _Compare = std::less<std::pair<long long int, long long int> >; _Alloc = std::allocator<std::pair<const std::pair<long long int, long long int>, std::pair<long long int, long long int> > >; mapped_type = std::pair<long long int, long long int>; key_type = std::pair<long long int, long long int>]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::map<std::pair<long long int, long long int>, std::pair<long long int, long long int> >::key_type&&' {aka 'std::pair<long long int, long long int>&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
a.cc:42:19: error: expected ')' before '}' token
   42 |       if(mp[{b,-a}})].first>0) mp[{b,-a}].second++;
      |         ~         ^
      |                   )
a.cc:42:19: error: expected primary-expression before '}' token
a.cc:42:20: error: expected primary-expression before ')' token
   42 |       if(mp[{b,-a}})].first>0) mp[{b,-a}].second++;
      |                    ^
a.cc:42:41: error: expected primary-expression before ']' token
   42 |       if(mp[{b,-a}})].first>0) mp[{b,-a}].second++;
      |                                         ^
a.cc:43:7: error: 'else' without a previous 'if'
   43 |       else if({-b,a}].first>0) mp[{-b,a}].second++;
      |       ^~~~
a.cc:43:15: error: expected primary-expression before '{' token
   43 |       else if({-b,a}].first>0) mp[{-b,a}].second++;
      |               ^
a.cc:43:15: error: expected ')' before '{' token
   43 |       else if({-b,a}].first>0) mp[{-b,a}].second++;
      |              ~^
      |               )
a.cc:43:21: error: expected primary-expression before ']' token
   43 |       else if({-b,a}].first>0) mp[{-b,a}].second++;
      |                     ^
a.cc:43:41: error: expected primary-expression before ']' token
   43 |       else if({-b,a}].first>0) mp[{-b,a}].second++;
      |                                         ^
a.cc:44:7: error: 'else' without a previous 'if'
   44 |       else mp[{a,b}].first++;
      |       ^~~~
a.cc:44:16: error: 'a' was not declared in this scope
   44 |       else mp[{a,b}].first++;
      |                ^
a.cc:44:18: error: 'b' was not declared in this scope
   44 |       else mp[{a,b}].first++;
      |                  ^
a.cc:44:14: error: no match for 'operator[]' (operand types are 'std::map<std::pair<long long int, long long int>, std::pair<long long int, long long int> >' and '<brace-enclosed initializer list>')
   44 |       else mp[{a,b}].first++;
      |              ^
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::pair<long long int, long long int>; _Tp = std::pair<long long int, long long int>; _Compare = std::less<std::pair<long long int, long long int> >; _Alloc = std::allocator<std::pair<const std::pair<long long int, long long int>, std::pair<long long int, long long int> > >; mapped_type = std::pair<long long int, long long int>; key_type = std::pair<long long int, long long int>]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::map<std::pair<long long int, long long int>, std::pair<long long int, long long int> >::key_type&' {aka 'const std::pair<long long int, long long int>&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::pair<long long int, long long int>; _Tp = std::pair<long long int, long long int>; _Compare = std::less<std::pair<long long int, long long int> >; _Alloc = std::allocator<std::pair<const std::pair<long long int, long long int>, std::pair<long long int, long long int> > >; mapped_type = std::pair<long long int, long long int>; key_type = std::pair<long long int, long long int>]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::map<std::pair<long long int, long long int>, std::pair<long long int, long long int> >::key_type&&' {aka 'std::pair<long long int, long long int>&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
a.cc: At global scope:
a.cc:46:3: error: expected declaration before '}' token
   46 |   }
      |   ^
a.cc:48:3: error: expected unqualified-id before 'for'
   48 |   for(auto p:mp){
      |   ^~~
a.cc:58:3: error: 'cout' does not name a type
   58 |   cout << (sum+zero-1+mod)%mod << endl;
      |   ^~~~
a.cc:60:1: error: expected declaration before '}' token
   60 | }
      | ^