Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <string.h>
#include <stack>
#include <assert.h>
#include <bitset>
namespace combinatorics
{
	int *fac;
	int *ifac;
	int __Tmod;
	inline int add(int a,int b)
	{
		return (a+b)%__Tmod;
	}
	inline int sub(int a,int b)
	{
		return (a-b+__Tmod)%__Tmod;
	}
	inline int mult(int a,int b)
	{
		return (1LL*a*b)%__Tmod;
	}
	inline int fastpow(int basic,int x)
	{
		if(x==0) return 1;
		int res=1;
		while(x)
		{
			if(x&1)	res=mult(res,basic);
			basic=mult(basic,basic);
			x>>=1;
		}
		return res;
	}
	inline int inv(int x)
	{
		return fastpow(x,__Tmod-2);
	}
	void init(int n,int tmod)
	{
		__Tmod=tmod;
		fac=new int[n+5];
		ifac=new int[n+5];
		fac[0]=1;
		for(int i=1;i<=n;i++)
		{
			fac[i]=mult(fac[i-1],i);
		}
		ifac[n]=inv(fac[n]);
		for(int i=n-1;i>=0;i--)
		{
			ifac[i]=mult(ifac[i+1],i+1);
		}
	}
	inline int C(int n,int m)
	{
		return mult(mult(fac[n],ifac[m]),ifac[n-m]);
	}
	inline int Cat(int x)
	{
		return mult(C(x*2,x),inv(x+1));
	}
};
using namespace combinatorics;

#define Endl endl
#define mp make_pair
#define ll long long 
#define ull unsigned long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define over(A) {cout<<A<<endl;exit(0);}
#define all(A) A.begin(),A.end()
#define ceil(a,b) ((a-1)/b+1)
#define quickcin ios_base::sync_with_stdio(false);
template <typename T1,typename T2> inline void chmin(T1 &x,T2 b) {if(b<x) x=b;}
template <typename T1,typename T2> inline void chmax(T1 &x,T2 b) {if(b>x) x=b;}
template <typename T1,typename T2> inline void chmod(T1 &x,T2 b) {x%=b,x+=b;if(x>=b) x-=b;}
const int inf=1039074182;
const int mod=1e9+7;
const ll llinf=1LL*inf*inf;
using namespace std;
int n;
ll a[200005];
ll b[200005];

struct s4
{
	int a[5];
};

map <pair<ll,ll>,s4> m;

int quadrant(ll x,ll y)
{
	if(y==0 && x>0) return 1;
	if(x==0 && y>0) return 2;
	if(y==0 && x<0) return 3;
	if(x==0 && y<0) return 4;
	if(x>0 && y>0) return 1;
	if(x<0 && y>0) return 2;
	if(x<0 && y<0) return 3;
	if(x>0 && y<0) return 4;
}

void zjhua(ll &x,ll &y)
{
	if(x==0 || y==0)
	{
		x=1;
		y=0;
	}
	else
	{
		while(!(x>0 && y>0))
		{
			ll tx=y,ty=-x;
			x=tx,y=ty;
		}
		ll g=__gcd(x,y);
		x/=g;
		y/=g;
	}
}

int main()
{
//	freopen("input.txt","r",stdin);
	quickcin;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i]>>b[i];
	}
	int zero=0;
	for(int i=0;i<n;i++)
	{
		if(a[i]==0 && b[i]==0)
		{
			zero++;
			continue;
		}
		ll x=a[i],y=b[i];
		zjhua(x,y);
		m[mp(x,y)].a[quadrant(a[i],b[i])]++;
	}
	int res=1;
	init(0,mod);
	for(auto tmp:m)
	{
		s4 o=tmp.second;
		int a=o.a[1],b=o.a[2],c=o.a[3],d=o.a[4];
		int ways=sub(add(fastpow(2,(a+c)),fastpow(2,(b+d))),1);
		res=mult(res,ways);
	}
	res=sub(res,1);
	res=add(res,sub);
	cout<<res<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:166:21: error: invalid conversion from 'int (*)(int, int)' to 'int' [-fpermissive]
  166 |         res=add(res,sub);
      |                     ^~~
      |                     |
      |                     int (*)(int, int)
a.cc:20:34: note:   initializing argument 2 of 'int combinatorics::add(int, int)'
   20 |         inline int add(int a,int b)
      |                              ~~~~^
a.cc: In function 'int quadrant(long long int, long long int)':
a.cc:113:1: warning: control reaches end of non-void function [-Wreturn-type]
  113 | }
      | ^