Language: C++

/* Bismillahirrahmanirrahim */
/* Author : Jehian Norman Saviero (@Reiva5) */
#include <bits/stdc++.h>
 
// MACROS SAMPAH
#define Jehian using
#define Norman namespace
#define Saviero std
 
Jehian Norman Saviero;
 
// MACROS TYPE
typedef long l;
typedef long long ll;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef double ld;
typedef pair<int,int> pi;
typedef pair<l,l> pl;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<l> vl;
typedef vector<ll> vll;
 
// MACROS FOR PRINT
#define nl printf("\n")
#define sp printf(" ")
 
// MACROS FOR ATTRIBUTE
#define fi first
#define se second
 
// MACROS FOR FUNCTION AND METHOD
#define eb emplace_back
#define mp make_pair
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define ALL(x) (x).begin(), (x).end()
#define ALLN(x,n) (x), (x)+(n)
#define CUBE(x) (SQR(x)*(x))
#define SET(x,y) for (int _qwe = sizeof(x)/sizeof(x[0]); _qwe; ) x[--_qwe] = (y)
#define SQR(x) ((x)*(x))
#define SSORT(x,sz) sort(ALLN(x,sz))
#define RESET(x) memset((x), 0, sizeof(x))
#define VSORT(x) sort(ALL(x))
 
// MACROS READ INPUT
#define sci(x) scanf("%d", &x)
#define scl(x) scanf("%ld", &x)
#define scll(x) scanf("%lld", &x)
#define scul(x) scl(x)
#define scull(x) scll(x)

pll adjust(pll A) {
	if (A.fi == 0) {
		return {0, 1};
	}
	if (A.se == 0) {
		return {1, 0};
	}
	ll gcd = __gcd(A.fi, A.se);
	A = {A.fi/gcd, A.se/gcd};
	return A;
}

map<pll,ll> cnt;

const ll MD = 1e9+7;
inline ll ADD(ll a, ll b) {
	return (a + b) % MD;
}

inline ll MUL(ll a, ll b) {
	return (a * b) % MD;
}

inline ll powMod(ll a, ll p) {
	ll res = 1;
	for (; p; p >>= 1, a = MUL(a,a)) {
		if (p & 1) res = MUL(res,a);
	}
	return res;
}

map<pll, bool> visit;

int main() {
	ll N;
	scll(N);
	for (int i = 0; i < N; ++i) {
		ll A, B;
		scll(A), scll(B);
		if (A == 0 && B == 0) continue;
		pll tmp = adjust({A, B});
		++cnt[tmp];
	}
	vector<pll> proc;
	for (auto &it : cnt) {
		pll curr = it.fi;
		if (visit[curr]) continue;
		visit[curr] = 1;
		ll num = it.se;
		pll anti = adjust({-curr.se, curr.fi});
		visit[anti] = 1;
		ll num_anti = cnt[anti];
		ll remain = N - num_anti;
		proc.pb({num, num_anti});
	}
	ll res = 1;
	for (auto &it : proc) {
		if (it.se != 0) {
			res = MUL(res, ADD(ADD(powMod(2, it.fi)-1, powMod(2, it.se)-1),1));
		} else {
			res = MUL(res, powMod(2, it.fi));
		}
	}
	printf("%lld\n", res-1);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:102:21: error: reference to 'visit' is ambiguous
  102 |                 if (visit[curr]) continue;
      |                     ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:3:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:87:16: note:                 'std::map<std::pair<long long int, long long int>, bool> visit'
   87 | map<pll, bool> visit;
      |                ^~~~~
a.cc:103:17: error: reference to 'visit' is ambiguous
  103 |                 visit[curr] = 1;
      |                 ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:87:16: note:                 'std::map<std::pair<long long int, long long int>, bool> visit'
   87 | map<pll, bool> visit;
      |                ^~~~~
a.cc:106:17: error: reference to 'visit' is ambiguous
  106 |                 visit[anti] = 1;
      |                 ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:87:16: note:                 'std::map<std::pair<long long int, long long int>, bool> visit'
   87 | map<pll, bool> visit;
      |                ^~~~~