Language: C++

#include <bits/stdc++.h>
#define ref(i,n) for(long long i=0;i<n;i++)
using namespace std;
#define mo 1000000007

typedef pair<long long> P;
set<P> v;
map<P,long long> mp;

long long gcd(long long m,long long n){
    if(m==0) return n;
    if(n==0) return m;
    if(n>m) return gcd(m,n%m);
    else return gcd(n,m%n);

    }

int main()
{
    int n;
    cin>>n;
    long long a0=0,aa=0,a1=0,yy;

    ref(i,n){
        long long x,y;
        cin>>x>>y;
        if(!x&&!y){aa++;continue;}
        if(y==0) {a0++;continue;}
        if(x==0) {a1++;continue;}
        if(x<0){ x=-x;y=-y;}

        if(y>0) yy=y; else yy=-y;

        P p=P(x/gcd(x,yy),y/gcd(x,yy));

        if(v.find(p)!=v.end()) mp[p]++;
        else {mp[p]=1;v.insert(p);}
    }
    long long ans=1;


    auto j=v.begin();

    ref(i,v.size()){

        P t=*j,p;
        if(t.second<0) {
            p=P(-t.second,t.first);
        }
        else p=P(t.second,-t.first);

        if(v.find(p)!=v.end()){

            long long y1=1,y2=1;

            ref(k,mp[t]) y1=y1*2%mo;
            ref(k,mp[p]) y2=y2*2%mo;

            long long yy=(y1+y2-1)%mo;

            ans=ans*yy%mo;
            mp[t]=0;mp[p]=0;

        }
    j++;
    }


    auto i=mp.begin();

    ref(k,mp.size()){
        long long xx=1;
        ref(k,i->second) xx=xx*2%mo;
        ans=ans*xx%mo;
        i++;
    }



        long long y1=1,y2=1;

        ref(k,a0) y1=y1*2%mo;
        ref(k,a1) y2=y2*2%mo;

        long long ye=(y1+y2-1)%mo;

        ans=ans*ye%mo;



    ans+=aa;
    ans%=mo;
    if(ans==0) ans+=mo;
    cout<<ans-1;
    return 0;

}

Compiler output:
a.cc:6:23: error: wrong number of template arguments (1, should be 2)
    6 | typedef pair<long long> P;
      |                       ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:89:12: note: provided for 'template<class _T1, class _T2> struct std::pair'
   89 |     struct pair;
      |            ^~~~
a.cc: In function 'int main()':
a.cc:34:38: error: expression list treated as compound expression in functional cast [-fpermissive]
   34 |         P p=P(x/gcd(x,yy),y/gcd(x,yy));
      |                                      ^
a.cc:47:14: error: request for member 'second' in 't', which is of non-class type 'P' {aka 'int'}
   47 |         if(t.second<0) {
      |              ^~~~~~
a.cc:48:20: error: request for member 'second' in 't', which is of non-class type 'P' {aka 'int'}
   48 |             p=P(-t.second,t.first);
      |                    ^~~~~~
a.cc:48:29: error: request for member 'first' in 't', which is of non-class type 'P' {aka 'int'}
   48 |             p=P(-t.second,t.first);
      |                             ^~~~~
a.cc:48:34: error: expression list treated as compound expression in functional cast [-fpermissive]
   48 |             p=P(-t.second,t.first);
      |                                  ^
a.cc:50:20: error: request for member 'second' in 't', which is of non-class type 'P' {aka 'int'}
   50 |         else p=P(t.second,-t.first);
      |                    ^~~~~~
a.cc:50:30: error: request for member 'first' in 't', which is of non-class type 'P' {aka 'int'}
   50 |         else p=P(t.second,-t.first);
      |                              ^~~~~
a.cc:50:35: error: expression list treated as compound expression in functional cast [-fpermissive]
   50 |         else p=P(t.second,-t.first);
      |                                   ^