Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <iomanip>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <tuple>
#include <numeric>
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define CST(x) cout<<fixed<<setprecision(x)//小数点以下の桁数指定
#define ct(a) cout<<a<<endl
static const double pi = 3.141592653589793;
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const ll INF = 1e9 + 7;
const ll mod = 1e9 + 7;


ll N, ans = 1;
long double A[200001], B[200001];
map<pair<ll,ll>, ll> mp1;
map<pair<ll,ll>, ll> mp2;


ll mod_pow(ll x, ll n) {
	if (n == 0) return 1;
	ll res = mod_pow(x*x % mod, n / 2);
	if (n & 1) res = res * x % mod;
	return (res + mod) % mod;
}

ll gcd(ll x, ll y) {
	if (y > x) swap(x, y);
	while (x%y != 0) {
		ll m = x % y;
		x = y;
		y = m;
	}
	return y;
}

ll cnt;
ll mz, az;

int main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);


	cin >> N;
	FOR(i, 0, N) {
		long double a, b;
		cin >> a >> b;

		ll m = gcd(a, b);
		a /= m; b /= m;

		A[i] = a; B[i] = b;
		if (a == 0 && b == 0)cnt++;
		else if (a == 0)mz++;
		else if (b == 0)az++;
		else {
			mp1[make_pair(a,b)]++;
			mp2[make_pair(b,a)]++;
		}
	}
	FOR(i, 0, N) {
		long double a, b;
		a = A[i]; b = B[i];

		if (a == 0.0 || b == 0.0)continue;


		if (mp1[make_pair(a,b)] > 0) {


			ans = (ans * ((mod_pow(2, mp1[make_pair(a,b)]+mp1[make_pair(-a,-b)]) + mod_pow(2, mp2[make_pair(-a,b)]+mp2[make_pair(a,-b)])) % mod - 1) + mod) % mod;
			mp1[make_pair(a,b)] = -1;
			mp1[make_pair(-a, -b)] = -1;
			mp1[make_pair(-b,a)] = -1;
			mp1[make_pair(b, -a)] = -1;
		}

	}
	ans = (ans*((mod_pow(2, mz) + mod_pow(2, az)) % mod - 1) + mod) % mod;

	cout << (ans - 1 + cnt + 100 * mod) % mod << endl;


	return 0;
}


Compiler output:
In file included from a.cc:15:
/usr/include/c++/14/numeric: In instantiation of 'constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn) [with _Mn = long double; _Nn = long double; common_type_t<_Mn, _Nn> = long double]':
a.cc:64:13:   required from here
   64 |                 ll m = gcd(a, b);
      |                        ~~~^~~~~~
/usr/include/c++/14/numeric:175:21: error: static assertion failed: std::gcd arguments must be integers
  175 |       static_assert(is_integral_v<_Mn> && is_integral_v<_Nn>,
      |                     ^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/numeric:175:21: note: 'std::is_integral_v<long double>' evaluates to false
In file included from /usr/include/c++/14/bits/move.h:37,
                 from /usr/include/c++/14/bits/exception_ptr.h:41,
                 from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/ios:41,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/type_traits: In instantiation of 'struct std::make_unsigned<long double>':
/usr/include/c++/14/type_traits:2076:11:   required by substitution of 'template<class _Tp> using std::make_unsigned_t = typename std::make_unsigned::type [with _Tp = long double]'
 2076 |     using make_unsigned_t = typename make_unsigned<_Tp>::type;
      |           ^~~~~~~~~~~~~~~
/usr/include/c++/14/numeric:182:24:   required from 'constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn) [with _Mn = long double; _Nn = long double; common_type_t<_Mn, _Nn> = long double]'
  182 |       return __detail::__gcd<make_unsigned_t<_Ct>>(__m2, __n2);
      |              ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:64:13:   required from here
   64 |                 ll m = gcd(a, b);
      |                        ~~~^~~~~~
/usr/include/c++/14/type_traits:1929:13: error: invalid use of incomplete type 'class std::__make_unsigned_selector<long double, false, false>'
 1929 |     { using type = typename __make_unsigned_selector<_Tp>::__type; };
      |             ^~~~
/usr/include/c++/14/type_traits:1837:11: note: declaration of 'class std::__make_unsigned_selector<long double, false, false>'
 1837 |     class __make_unsigned_selector;
      |           ^~~~~~~~~~~~~~~~~~~~~~~~