Language: C++

#include <iostream>
#include <map>
#include <vector>

__int64 gcd(__int64 a,__int64 b){
  __int64 r=a%b;
  while(r!=0){
   //std::cout<<a<<" "<<b<<" "<<r<<std::endl;
   a=b;
   b=r;
   r=a%b;
  }
  return b;
}

 __int64 pow(__int64 a,__int64 b, __int64 d){
  if(b==1){
   return a%d;
  }else if(b==0){
   return 1;
  }else{
   a=a%d;
   a=(a*a)%d;
   if(b%2==0){
    return pow(a,b/2,d);
   }else{
    return (pow(a,b/2,d)*a)%d;
   }
  }
 }

int main(){

 int N;
 std::cin>>N;
 std::map<std::pair<__int64,__int64>,int> mp;

 __int64 a,b;
 __int64 zero=0;
 for(int i=0;i<N;i++){
  std::cin>>a>>b;

  if(a==0&&b==0){
   zero++;
  }else if(a==0){
   mp[{0,1}]++;
  }else if(b==0){
   mp[{1,0}]++;
  }else{
   if(a<0&&b<0){
    __int64 g=gcd(-a,-b);
    mp[{(-a/g),(-b/g)}]++;
   }else if(a<0){
    __int64 g=gcd(-a,b);
    mp[{(a/g),(b/g)}]++;
   }else if(b<0){
    __int64 g=gcd(a,-b);
    mp[{(-a/g),(-b/g)}]++;
   }else{
    __int64 g=gcd(a,b);
    mp[{(a/g),(b/g)}]++;
   }
  }
 }

 __int64 d=1000000007;

 __int64 ans=1;
 __int64 al=0;
 __int64 be=0;
 __int64 ga=0;
 for(auto p:mp){
  //std::cout<<"(<"<<p.first.first<<","<<p.first.second<<">"<<","<<p.second<<")"<<std::endl;
  al=p.first.first;
  be=p.first.second;
  ga=1;
  ga+=pow(2,mp[{al,be}],d)-1;
  mp[{al,be}]=0;
  if(al>=0){
   if(mp[{-be,al}]!=0){
    ga+=pow(2,mp[{-be,al}],d)-1;
    mp[{-be,al}]=0;
   }
  }else{
   if(mp[{be,-al}]!=0){
    ga+=pow(2,mp[{be,-al}],d)-1;
    mp[{be,-al}]=0;
   }
  }
  //std::cout<<ga<<std::endl;
  ans*=ga;
  ans=ans%d;
 }
 
 ans+=zero;
 ans=ans%d;
 ans--;
 if(ans<0){
  ans+=d;
 }
 std::cout<<ans<<std::endl;
}

Compiler output:
a.cc:5:1: error: '__int64' does not name a type; did you mean '__int64_t'?
    5 | __int64 gcd(__int64 a,__int64 b){
      | ^~~~~~~
      | __int64_t
a.cc:16:2: error: '__int64' does not name a type; did you mean '__int64_t'?
   16 |  __int64 pow(__int64 a,__int64 b, __int64 d){
      |  ^~~~~~~
      |  __int64_t
a.cc: In function 'int main()':
a.cc:36:21: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   36 |  std::map<std::pair<__int64,__int64>,int> mp;
      |                     ^~~~~~~
      |                     __int64_t
a.cc:36:36: error: template argument 1 is invalid
   36 |  std::map<std::pair<__int64,__int64>,int> mp;
      |                                    ^
a.cc:36:41: error: template argument 1 is invalid
   36 |  std::map<std::pair<__int64,__int64>,int> mp;
      |                                         ^
a.cc:36:41: error: template argument 3 is invalid
a.cc:36:41: error: template argument 4 is invalid
a.cc:38:9: error: expected ';' before 'a'
   38 |  __int64 a,b;
      |         ^~
      |         ;
a.cc:39:9: error: expected ';' before 'zero'
   39 |  __int64 zero=0;
      |         ^~~~~
      |         ;
a.cc:41:13: error: 'a' was not declared in this scope
   41 |   std::cin>>a>>b;
      |             ^
a.cc:41:16: error: 'b' was not declared in this scope
   41 |   std::cin>>a>>b;
      |                ^
a.cc:44:4: error: 'zero' was not declared in this scope
   44 |    zero++;
      |    ^~~~
a.cc:46:6: error: invalid types 'int[<brace-enclosed initializer list>]' for array subscript
   46 |    mp[{0,1}]++;
      |      ^
a.cc:48:6: error: invalid types 'int[<brace-enclosed initializer list>]' for array subscript
   48 |    mp[{1,0}]++;
      |      ^
a.cc:51:12: error: expected ';' before 'g'
   51 |     __int64 g=gcd(-a,-b);
      |            ^~
      |            ;
a.cc:52:13: error: 'g' was not declared in this scope
   52 |     mp[{(-a/g),(-b/g)}]++;
      |             ^
a.cc:52:7: error: invalid types 'int[<brace-enclosed initializer list>]' for array subscript
   52 |     mp[{(-a/g),(-b/g)}]++;
      |       ^
a.cc:54:12: error: expected ';' before 'g'
   54 |     __int64 g=gcd(-a,b);
      |            ^~
      |            ;
a.cc:55:12: error: 'g' was not declared in this scope
   55 |     mp[{(a/g),(b/g)}]++;
      |            ^
a.cc:55:7: error: invalid types 'int[<brace-enclosed initializer list>]' for array subscript
   55 |     mp[{(a/g),(b/g)}]++;
      |       ^
a.cc:57:12: error: expected ';' before 'g'
   57 |     __int64 g=gcd(a,-b);
      |            ^~
      |            ;
a.cc:58:13: error: 'g' was not declared in this scope
   58 |     mp[{(-a/g),(-b/g)}]++;
      |             ^
a.cc:58:7: error: invalid types 'int[<brace-enclosed initializer list>]' for array subscript
   58 |     mp[{(-a/g),(-b/g)}]++;
      |       ^
a.cc:60:12: error: expected ';' before 'g'
   60 |     __int64 g=gcd(a,b);
      |            ^~
      |            ;
a.cc:61:12: error: 'g' was not declared in this scope
   61 |     mp[{(a/g),(b/g)}]++;
      |            ^
a.cc:61:7: error: invalid types 'int[<brace-enclosed initializer list>]' for array subscript
   61 |     mp[{(a/g),(b/g)}]++;
      |       ^
a.cc:66:9: error: expected ';' before 'd'
   66 |  __int64 d=1000000007;
      |         ^~
      |         ;
a.cc:68:9: error: expected ';' before 'ans'
   68 |  __int64 ans=1;
      |         ^~~~
      |         ;
a.cc:69:9: error: expected ';' before 'al'
   69 |  __int64 al=0;
      |         ^~~
      |         ;
a.cc:70:9: error: expected ';' before 'be'
   70 |  __int64 be=0;
      |         ^~~
      |         ;
a.cc:71:9: error: expected ';' before 'ga'
   71 |  __int64 ga=0;
      |         ^~~
      |         ;
a.cc:72:13: error: 'begin' was not declared in this scope; did you mean 'std::begin'?
   72 |  for(auto p:mp){
      |             ^~
      |             std::begin
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:114:37: note: 'std::begin' declared here
  114 |   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&) noexcept;
      |                                     ^~~~~
a.cc:72:13: error: 'end' was not declared in this scope; did you mean 'std::end'?
   72 |  for(auto p:mp){
      |             ^~
      |             std::end
/usr/include/c++/14/bits/range_access.h:116:37: note: 'std::end' declared here
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
a.cc:74:3: error: 'al' was not declared in this scope
   74 |   al=p.first.first;
      |   ^~
a.cc:75:3: error: 'be' was not declared in this scope
   75 |   be=p.first.second;
      |   ^~
a.cc:76:3: error: 'ga' was not declared in this scope
   76 |   ga=1;
      |   ^~
a.cc:77:15: error: invalid types 'int[<brace-enclosed initializer list>]' for array subscript
   77 |   ga+=pow(2,mp[{al,be}],d)-1;
      |               ^
a.cc:77:25: error: 'd' was not declared in this scope
   77 |   ga+=pow(2,mp[{al,be}],d)-1;
      |                         ^
a.cc:77:7: error: 'pow' was not declared in this scope
   77 |   ga+=pow(2,mp[{al,be}],d)-1;
      |       ^~~
a.cc:78:5: error: invalid types 'int[<brace-enclosed initializer list>]' for array subscript
   78 |   mp[{al,be}]=0;
      |     ^
a.cc:80:9: error: invalid types 'int[<brace-enclosed initializer list>]' for array subscript
   80 |    if(mp[{-be,al}]!=0){
      |         ^
a.cc:81:17: error: invalid types 'int[<brace-enclosed initializer list>]' for array subscript
   81 |     ga+=pow(2,mp[{-be,al}],d)-1;
      |                 ^
a.cc:82:7: error: invalid types 'int[<brace-enclosed initializer list>]' for array subscript
   82 |     mp[{-be,al}]=0;
      |       ^
a.cc:85:9: error: invalid types 'int[<brace-enclosed initializer list>]' for array subscript
   85 |    if(mp[{be,-al}]!=0){
      |         ^
a.cc:86:17: error: invalid types 'int[<brace-enclosed initializer list>]' for array subscript
   86 |     ga+=pow(2,mp[{be,-al}],d)-1;
      |                 ^
a.cc:87:7: error: invalid types 'int[<brace-enclosed initializer list>]' for array subscript
   87 |     mp[{be,-al}]=0;
      |       ^
a.cc:91:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   91 |   ans*=ga;
      |   ^~~
      |   abs
a.cc:95:2: error: 'ans' was not declared in this scope; did you mean 'abs'?
   95 |  ans+=zero;
      |  ^~~
      |  abs
a.cc:95:7: error: 'zero' was not declared in this scope
   95 |  ans+=zero;
      |       ^~~~
a.cc:96:10: error: 'd' was not declared in this scope
   96 |  ans=ans%d;
      |          ^