Language: C++

#include <bits/stdc++.h>                                           
 
#define int long long
//#pragma GCC optimize("Ofast")
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
 
 
#define file(s) freopen(s".in","r",stdin); freopen(s".out","w",stdout);
#define forev(i, b, a) for(int i = (b); i >= (a); --i)
#define forn(i, a, b) for(int i = (a); i <= (b); ++i)
#define all(x) x.begin(), x.end()
#define sz(s) (int)s.size()
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define s second
#define f first
 
 
using namespace std;
 
 
typedef pair < long long, long long > pll;    
typedef pair < int, int > pii;  
typedef unsigned long long ull;         
typedef vector < pii > vpii;                                   	
typedef vector < int > vi;
typedef long double ldb;  
typedef long long ll;  
typedef double db;
 
 
const int inf = 1e9, maxn = 1e6 + 48, mod = 1e9 + 7, N = 2e5 + 24;
const int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1}, block = 555;
const pii base = mp(1171, 3307), Mod = mp(1e9 + 7, 1e9 + 9);
const db eps = 1e-12, pi = acos(-1);
const ll INF = 1e18;


int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
map < pair < pii, int >, int > cnt;
map < pair < pii, int >, bool > was;
vpii v;

main () {
	p[0] = 1;
	for (int i = 1; i < N; ++i)
		p[i] = p[i - 1] * 2 % mod;

	cin >> m;
	while (m--) {
		cin >> aa >> bb;
		if (!aa && !bb)
			continue;
		if (!aa) {
			++cnta;
			continue;
		}

		if (!bb) {
			++cntb;
			continue;
		} 

		++n;
		if (aa < 0) {
			aa = -aa;
			c[n] ^= 1;
		}

		if (bb < 0) {
			bb = -bb;
			c[n] ^= 1;
		}
		int G = __gcd(aa, bb);
		aa /= G;
		bb /= G;

		a[n] = aa;
		b[n] = bb;

		++cnt[{{a[n], b[n]}, c[n]}];
	}

	int ans = (p[cnta] + p[cntb] - 1) % mod;
	
	for (int i = 1; i <= n; ++i) {		
	    pair < pii, int > v1 = {{a[i], b[i]}, c[i]};
	    pair < pii, int > v2 = {{b[i], a[i]}, c[i] ^ 1};	    
		if (was.count(v1))
			continue;

		was[v1] = 1;
		was[v2] = 1;
		ans = ans * (p[cnt[v1]] + p[cnt[v2]] - 1) % mod;
	}
	
	cout << (ans + mod - 1) % mod << endl;
}	#include <bits/stdc++.h>                                           
 
#define int long long
//#pragma GCC optimize("Ofast")
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
 
 
#define file(s) freopen(s".in","r",stdin); freopen(s".out","w",stdout);
#define forev(i, b, a) for(int i = (b); i >= (a); --i)
#define forn(i, a, b) for(int i = (a); i <= (b); ++i)
#define all(x) x.begin(), x.end()
#define sz(s) (int)s.size()
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define s second
#define f first
 
 
using namespace std;
 
 
typedef pair < long long, long long > pll;    
typedef pair < int, int > pii;  
typedef unsigned long long ull;         
typedef vector < pii > vpii;                                   	
typedef vector < int > vi;
typedef long double ldb;  
typedef long long ll;  
typedef double db;
 
 
const int inf = 1e9, maxn = 1e6 + 48, mod = 1e9 + 7, N = 2e5 + 24;
const int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1}, block = 555;
const pii base = mp(1171, 3307), Mod = mp(1e9 + 7, 1e9 + 9);
const db eps = 1e-12, pi = acos(-1);
const ll INF = 1e18;


int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
map < pair < pii, int >, int > cnt;
map < pair < pii, int >, bool > was;
vpii v;

main () {
	p[0] = 1;
	for (int i = 1; i < N; ++i)
		p[i] = p[i - 1] * 2 % mod;

	cin >> m;
	while (m--) {
		cin >> aa >> bb;
		if (!aa && !bb)
			continue;
		if (!aa) {
			++cnta;
			continue;
		}

		if (!bb) {
			++cntb;
			continue;
		} 

		++n;
		if (aa < 0) {
			aa = -aa;
			c[n] ^= 1;
		}

		if (bb < 0) {
			bb = -bb;
			c[n] ^= 1;
		}
		int G = __gcd(aa, bb);
		aa /= G;
		bb /= G;

		a[n] = aa;
		b[n] = bb;

		++cnt[{{a[n], b[n]}, c[n]}];
	}

	int ans = (p[cnta] + p[cntb] - 1) % mod;
	
	for (int i = 1; i <= n; ++i) {		
	    pair < pii, int > v1 = {{a[i], b[i]}, c[i]};
	    pair < pii, int > v2 = {{b[i], a[i]}, c[i] ^ 1};	    
		if (was.count(v1))
			continue;

		was[v1] = 1;
		was[v2] = 1;
		ans = ans * (p[cnt[v1]] + p[cnt[v2]] - 1) % mod;
	}
	
	cout << (ans + mod - 1) % mod << endl;
}	

Compiler output:
a.cc:100:9: error: stray '#' in program
  100 | }       #include <bits/stdc++.h>
      |         ^
a.cc:46:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   46 | main () {
      | ^~~~
a.cc:100:10: error: 'include' does not name a type
  100 | }       #include <bits/stdc++.h>
      |          ^~~~~~~
a.cc:133:11: error: redefinition of 'const long long int inf'
  133 | const int inf = 1e9, maxn = 1e6 + 48, mod = 1e9 + 7, N = 2e5 + 24;
      |           ^~~
a.cc:34:11: note: 'const long long int inf' previously defined here
   34 | const int inf = 1e9, maxn = 1e6 + 48, mod = 1e9 + 7, N = 2e5 + 24;
      |           ^~~
a.cc:133:22: error: redefinition of 'const long long int maxn'
  133 | const int inf = 1e9, maxn = 1e6 + 48, mod = 1e9 + 7, N = 2e5 + 24;
      |                      ^~~~
a.cc:34:22: note: 'const long long int maxn' previously defined here
   34 | const int inf = 1e9, maxn = 1e6 + 48, mod = 1e9 + 7, N = 2e5 + 24;
      |                      ^~~~
a.cc:133:39: error: redefinition of 'const long long int mod'
  133 | const int inf = 1e9, maxn = 1e6 + 48, mod = 1e9 + 7, N = 2e5 + 24;
      |                                       ^~~
a.cc:34:39: note: 'const long long int mod' previously defined here
   34 | const int inf = 1e9, maxn = 1e6 + 48, mod = 1e9 + 7, N = 2e5 + 24;
      |                                       ^~~
a.cc:133:54: error: redefinition of 'const long long int N'
  133 | const int inf = 1e9, maxn = 1e6 + 48, mod = 1e9 + 7, N = 2e5 + 24;
      |                                                      ^
a.cc:34:54: note: 'const long long int N' previously defined here
   34 | const int inf = 1e9, maxn = 1e6 + 48, mod = 1e9 + 7, N = 2e5 + 24;
      |                                                      ^
a.cc:134:11: error: redefinition of 'const long long int dx []'
  134 | const int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1}, block = 555;
      |           ^~
a.cc:35:11: note: 'const long long int dx [4]' previously defined here
   35 | const int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1}, block = 555;
      |           ^~
a.cc:134:33: error: redefinition of 'const long long int dy []'
  134 | const int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1}, block = 555;
      |                                 ^~
a.cc:35:33: note: 'const long long int dy [4]' previously defined here
   35 | const int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1}, block = 555;
      |                                 ^~
a.cc:134:55: error: redefinition of 'const long long int block'
  134 | const int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1}, block = 555;
      |                                                       ^~~~~
a.cc:35:55: note: 'const long long int block' previously defined here
   35 | const int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1}, block = 555;
      |                                                       ^~~~~
a.cc:135:11: error: redefinition of 'const pii base'
  135 | const pii base = mp(1171, 3307), Mod = mp(1e9 + 7, 1e9 + 9);
      |           ^~~~
a.cc:36:11: note: 'const pii base' previously defined here
   36 | const pii base = mp(1171, 3307), Mod = mp(1e9 + 7, 1e9 + 9);
      |           ^~~~
a.cc:135:34: error: redefinition of 'const pii Mod'
  135 | const pii base = mp(1171, 3307), Mod = mp(1e9 + 7, 1e9 + 9);
      |                                  ^~~
a.cc:36:34: note: 'const pii Mod' previously defined here
   36 | const pii base = mp(1171, 3307), Mod = mp(1e9 + 7, 1e9 + 9);
      |                                  ^~~
a.cc:136:10: error: redefinition of 'const db eps'
  136 | const db eps = 1e-12, pi = acos(-1);
      |          ^~~
a.cc:37:10: note: 'const db eps' previously defined here
   37 | const db eps = 1e-12, pi = acos(-1);
      |          ^~~
a.cc:136:23: error: redefinition of 'const db pi'
  136 | const db eps = 1e-12, pi = acos(-1);
      |                       ^~
a.cc:37:23: note: 'const db pi' previously defined here
   37 | const db eps = 1e-12, pi = acos(-1);
      |                       ^~
a.cc:137:10: error: redefinition of 'const ll INF'
  137 | const ll INF = 1e18;
      |          ^~~
a.cc:38:10: note: 'const ll INF' previously defined here
   38 | const ll INF = 1e18;
      |          ^~~
a.cc:140:5: error: redefinition of 'long long int n'
  140 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |     ^
a.cc:41:5: note: 'long long int n' previously declared here
   41 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |     ^
a.cc:140:8: error: redefinition of 'long long int m'
  140 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |        ^
a.cc:41:8: note: 'long long int m' previously declared here
   41 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |        ^
a.cc:140:11: error: redefinition of 'long long int aa'
  140 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |           ^~
a.cc:41:11: note: 'long long int aa' previously declared here
   41 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |           ^~
a.cc:140:15: error: redefinition of 'long long int bb'
  140 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |               ^~
a.cc:41:15: note: 'long long int bb' previously declared here
   41 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |               ^~
a.cc:140:19: error: redefinition of 'long long int a [200024]'
  140 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |                   ^
a.cc:41:19: note: 'long long int a [200024]' previously declared here
   41 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |                   ^
a.cc:140:25: error: redefinition of 'long long int b [200024]'
  140 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |                         ^
a.cc:41:25: note: 'long long int b [200024]' previously declared here
   41 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |                         ^
a.cc:140:31: error: redefinition of 'long long int c [200024]'
  140 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |                               ^
a.cc:41:31: note: 'long long int c [200024]' previously declared here
   41 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |                               ^
a.cc:140:37: error: redefinition of 'long long int cnta'
  140 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |                                     ^~~~
a.cc:41:37: note: 'long long int cnta' previously declared here
   41 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |                                     ^~~~
a.cc:140:43: error: redefinition of 'long long int cntb'
  140 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |                                           ^~~~
a.cc:41:43: note: 'long long int cntb' previously declared here
   41 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |                                           ^~~~
a.cc:140:49: error: redefinition of 'long long int p [200024]'
  140 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |                                                 ^
a.cc:41:49: note: 'long long int p [200024]' previously declared here
   41 | int n, m, aa, bb, a[N], b[N], c[N], cnta, cntb, p[N];
      |                                                 ^
a.cc:141:32: error: redefinition of 'std::map<std::pair<std::pair<long long int, long long int>, long long int>, long long int> cnt'
  141 | map < pair < pii, int >, int > cnt;
      |                                ^~~
a.cc:42:32: note: 'std::map<std::pair<std::pair<long long int, long long int>, long long int>, long long int> cnt' previously declared here
   42 | map < pair < pii, int >, int > cnt;
      |                                ^~~
a.cc:142:33: error: redefinition of 'std::map<std::pair<std::pair<long long int, long long int>, long long int>, bool> was'
  142 | map < pair < pii, int >, bool > was;
      |                                 ^~~
a.cc:43:33: note: 'std::map<std::pair<std::pair<long long int, long long int>, long long int>, bool> was' previously declared here
   43 | map < pair < pii, int >, bool > was;
      |                                 ^~~
a.cc:143:6: error: redefinition of 'vpii v'
  143 | vpii v;
      |      ^
a.cc:44:6: note: 'vpii v' previously declared here
   44 | vpii v;
      |      ^
a.cc:145:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
  145 | main () {
      | ^~~~
a.cc:145:1: error: redefinition of 'int main()'
a.cc:46:1: note: 'int main()' previously defined here
   46 | main () {
      | ^~~~