Language: C++

#include<iostream>
#include<algorithm>
#include<vector>

int modpow(int a, int b, int base) {
	vector<int> vb, va;
	while (b != 0) {
		vb.push_back(b % 2);
		b /= 2;
		va.push_back(a);
		a *= a;
		a %= base;
	}
	int ans = 1;
	for (int i = 0;i < vb.size();i++) {
		if (vb[i] == 1) {
			ans *= va[i];
			ans %= base;
		}
	}
	return ans;
}

constexpr double INFI = 1000000000000000001;
constexpr int BASE = 1000000007;


typedef long long ll;

using namespace std;

int main() {
	int n;
	vector<double> v;
	double a, b;
	cin >> n;
	for (int i = 0;i < n;i++) {
		cin >> a >> b;
		if (a == 0) {
			v.push_back(1ll / INFI);
		}else if (b == 0) {
			v.push_back(INFI);
		}
		else {
			v.push_back(a / b);
		}
	}
	sort(v.begin(), v.end());
	vector<pair<double, int>> v2;
	v2.push_back(make_pair(v[0], 1));
	double now = v[0];
	for (int i = 1;i < n;i++) {
		if (v[i] == now) {
			v2[v2.size() - 1].second++;
		}
		else {
			v2.push_back(make_pair(v[i], 1));
		}
	}
	vector<double> v3;
	vector<ll> v4;
	ll sum = 0;
	for (int i = 0;i < v2.size();i++) {
		v3.push_back(v2[i].first);
		if (v2[i].first <= 1 / INFI) {
			v4.push_back((1 + sum)%BASE);
			v4[i] *= modpow(2, v2[i].second, BASE);
			v4[i] %= BASE;
			sum += v4[i];
			sum %= BASE;
		}
		else {
			if (binary_search(v4.begin(), v4.end(), 1 / v2[i].first)) {
				v4.push_back((1LL + sum +(BASE - v4[lower_bound(v4.begin(),v4.end(),1/v2[i].first) - v4.begin()]) ) % BASE);
				v4[i] *= modpow(2, v2[i].second, BASE);
				v4[i] %= BASE;
				sum += v4[i];
				sum %= BASE;
			}
			else {
				v4.push_back((1 + sum) % BASE);
				v4[i] *= modpow(2, v2[i].second, BASE);
				v4[i] %= BASE;
				sum += v4[i];
				sum %= BASE;
			}
		}

	}
	sum = 0;
	for (int i = 0;i < v4.size();i++) {
		sum += v4[i];
		sum %= BASE;
	}
	cout << sum << endl;
}

Compiler output:
a.cc: In function 'int modpow(int, int, int)':
a.cc:6:9: error: 'vector' was not declared in this scope
    6 |         vector<int> vb, va;
      |         ^~~~~~
a.cc:6:9: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:6:16: error: expected primary-expression before 'int'
    6 |         vector<int> vb, va;
      |                ^~~
a.cc:8:17: error: 'vb' was not declared in this scope; did you mean 'b'?
    8 |                 vb.push_back(b % 2);
      |                 ^~
      |                 b
a.cc:10:17: error: 'va' was not declared in this scope; did you mean 'a'?
   10 |                 va.push_back(a);
      |                 ^~
      |                 a
a.cc:15:28: error: 'vb' was not declared in this scope; did you mean 'b'?
   15 |         for (int i = 0;i < vb.size();i++) {
      |                            ^~
      |                            b
a.cc:17:32: error: 'va' was not declared in this scope; did you mean 'a'?
   17 |                         ans *= va[i];
      |                                ^~
      |                                a