Language: Java

#include <bits/stdc++.h>

using namespace std;

typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef unsigned long long ull;

#define faster ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define debug(x) cout<<#x<<" = "<<(x)<< endl
#define nl "\n"
#define sp " "

const ll MOD = 1000000007;
ll n, a, b, pw[int(2e5 + 10)];
map<pair<ll,ll>, pair<ll, ll> > mp;

ll fix(ll x){
	return (x % MOD + MOD) % MOD;
}

int main() {
	faster
	cin >> n;
	pw[0] = 1;
	for(int i = 1; i <= n; i++){
		pw[i] = fix(2 * pw[i - 1]);
	}

	ll ans = 1, zero = 0;
	for(int i = 0; i < n; i++){
		cin >> a >> b;
		if(a == 0 && b == 0){
			zero++;
			continue;
		}

		ll g = __gcd(a,b);
		a /= g, b /= g;

		if(a < 0){
			a *= -1, b *= -1;
		}

		if(b > 0){
			mp[{a, b}].first++;
		}else{
			mp[{-b, a}].second++;
		}
	}

	for(auto it : mp){
		ans *= pw[it.second.first] + pw[it.second.second] - 1;
		ans = fix(ans);
	}

	cout << fix(ans + zero - 1) << nl;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:5: error: class, interface, enum, or record expected
typedef vector<int> vi;
^
Main.java:6: error: class, interface, enum, or record expected
typedef pair<int, int> ii;
^
Main.java:7: error: class, interface, enum, or record expected
typedef vector<ii> vii;
^
Main.java:8: error: class, interface, enum, or record expected
typedef long long ll;
^
Main.java:9: error: class, interface, enum, or record expected
typedef unsigned long long ull;
^
Main.java:11: error: illegal character: '#'
#define faster ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
^
Main.java:11: error: class, interface, enum, or record expected
#define faster ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
        ^
Main.java:11: error: class, interface, enum, or record expected
#define faster ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
                                                ^
Main.java:11: error: class, interface, enum, or record expected
#define faster ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
                                                                 ^
Main.java:12: error: illegal character: '#'
#define debug(x) cout<<#x<<" = "<<(x)<< endl
^
Main.java:12: error: class, interface, enum, or record expected
#define debug(x) cout<<#x<<" = "<<(x)<< endl
        ^
Main.java:12: error: illegal character: '#'
#define debug(x) cout<<#x<<" = "<<(x)<< endl
                       ^
Main.java:13: error: illegal character: '#'
#define nl "\n"
^
Main.java:14: error: illegal character: '#'
#define sp " "
^
Main.java:17: error: class, interface, enum, or record expected
ll n, a, b, pw[int(2e5 + 10)];
^
Main.java:18: error: unnamed classes are a preview feature and are disabled by default.
map<pair<ll,ll>, pair<ll, ll> > mp;
^
  (use --enable-preview to enable unnamed classes)
Main.java:26: error: not a statement
	cin >> n;
	       ^
Main.java:34: error: not a statement
		cin >> a >> b;
		         ^
Main.java:48: error: not a statement
			mp[{a, b}].first++;
			  ^
Main.java:48: error: not a statement
			mp[{a, b}].first++;
			    ^
Main.java:48: error: not a statement
			mp[{a, b}].first++;
			       ^
Main.java:50: error: not a statement
			mp[{-b, a}].second++;
			  ^
Main.java:50: error: not a statement
			mp[{-b, a}].second++;
			    ^
Main.java:50: error: not a statement
			mp[{-b, a}].second++;
			        ^
Main.java:59: error: not a statement
	cout << fix(ans + zero - 1) << nl;
	                            ^
Main.java:26: error: ';' expected
	cin >> n;
	   ^
Main.java:41: error: ';' expected
		a /= g, b /= g;
		      ^
Main.java:44: error: ';' expected
			a *= -1, b *= -1;
			       ^
Main.java:48: error: illegal start of expression
			mp[{a, b}].first++;
			   ^
Main.java:48: error: ';' expected
			mp[{a, b}].first++;
			     ^
Main.java:48: error: ';' expected
			mp[{a, b}].first++;
			        ^
Main.java:48: error: illegal start of expression
			mp[{a, b}].first++;
			         ^
Main.java:50: error: illegal start of expression
			mp[{-b, a}].second++;
			   ^
Main.java:50: error: ';' expected
			mp[{-b, a}].second++;
			      ^
Main.java:50: error: ';' expected
			mp[{-b, a}].second++;
			         ^
Main.java:50: error: illegal start of expression
			mp[{-b, a}].second++;
			          ^
38 errors