criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
using namespace std;
typedef long long ll;

const ll mod=1e9+7;

int main(){
    ll n,a,b;
    cin>>n;
    map<__int128,ll> mp;
    rep(i,n){
        cin>>a>>b;
        mp[(__int128)a*b]++;
    }ll ans=1;
    for(auto x:mp){
        if(mp[-x.first]==0) ans*=pow(2,x.second),ans%=mod;
        else{
            ans*=(pow(2,x.second)+pow(2,mp[-x.first])-1)%mod;
            ans%=mod;
            mp[-x.first]=mp[x.first]=0;
        }
    } 
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:57: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'const ll' {aka 'const long long int'} to binary 'operator%'
   20 |             ans*=(pow(2,x.second)+pow(2,mp[-x.first])-1)%mod;
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
      |                                                      |   |
      |                                                      |   const ll {aka const long long int}
      |                                                      __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n); i >= 0; i--)
#define REP(i, m, n) for (int i = (int)(m); i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
typedef long long ll;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const long long INF = 1LL << 60;
const long long MOD = 1000000007;

typedef pair<int,int> pii;
#define fi first
#define se second
#define mp make_pair

int main(){
  int n;
  vector<double> r(n);
  rep(i, n){
    ll a, b;
    cin >> a >> b;
    r[i] = (double)a/b;
  }
  sort(all(r));

  vector<vector<int> > G(n, vector<int>());
  rep(i, n){
    double t = - 1.0 / r[i];
    auto p = lower_bound(all(r), t) - r.begin();
    while(r[p] != t){
      G.push_back(mp(i, p));
      p++;
    }
  }

  ll total = 0;
  vector<ll> sum(n, 0);
  rep(i, n){
    ll tmp = total;
    for(int nv : G[v]){
      tmp -= sum[nv];
    }
    sum[i] = tmp;
    total += tmp;
    total %= MOD;
  }

  cout << total << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:18: error: no matching function for call to 'std::vector<std::vector<int> >::push_back(std::pair<int, long int>)'
   35 |       G.push_back(mp(i, p));
      |       ~~~~~~~~~~~^~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; value_type = std::vector<int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'std::pair<int, long int>' to 'const std::vector<std::vector<int> >::value_type&' {aka 'const std::vector<int>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; value_type = std::vector<int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'std::pair<int, long int>' to 'std::vector<std::vector<int> >::value_type&&' {aka 'std::vector<int>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:44:20: error: 'v' was not declared in this scope; did you mean 'nv'?
   44 |     for(int nv : G[v]){
      |                    ^
      |                    nv
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll>
#define cvector vector<char>
#define svector vector<string>
#define lque queue<ll>
#define lpque priority_queue<ll>
#define dlpque priority_queue<ll,lvector,greater<ll>>
#define P pair<ll,ll>
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define rep(i,n) for(ll i=0; i<n; ++i)
#define print(a) cout << (a) << endl

ll modpow(ll a, ll p) {
  ll ret=1,mod=1e9+7;
  while(p>0) {
    if(p&1) ret=(ret*a)%mod;
    a=(a*a)%mod;
    p>>=1;
  }
  return ret;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll a,b,d,n,ans=0,mod=1e9+7;cin>>n;
  map<P,ll> pos,neg;
  ll zero_a,zero_b,zero_w;
  rep(i,n) {
    cin>>a>>b;
    d=__gcd(a,b);
    if(a*b>0) pos[P(a/d,b/d)]++;
    else if(a*b<0) pos[P(abs(a/d),abs(b/d))]++;
    else if(a==0&&b!=0) zero_a++;
    else if(a!=0&&b==0) zero_b++;
    else zero_w++;
  }
  ans=modpow(2,n-zero_w);
  ans-=(modpow(2,zero_a)-1)*(modpow(2,zero_b)-1)*modpow(2,n-zero_w-zero_a-zero_b);
  while(ans<0) ans+=mod;
  ll num=0;
  for(auto e:pos) {
    a=e.first.first,b=e.first.second,num=p.second;
    auto inv=neg[P(b,a)];
    if(inv.second==0) continue;
    num*=inv;
    ans=(ans-(modpow(2,num)-1)*modpow(2,n-2*num))%mod;
    while(ans<0) ans+=mod;
  }
  print(ans);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:42: error: 'p' was not declared in this scope
   46 |     a=e.first.first,b=e.first.second,num=p.second;
      |                                          ^
a.cc:48:12: error: request for member 'second' in 'inv', which is of non-class type 'long long int'
   48 |     if(inv.second==0) continue;
      |            ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
#define ALL(v) v.begin(), v.end()
#define vmax(v) *max_element(ALL(v))
#define vmin(v) *min_element(ALL(v))
#define chmax(x, a) x = max(x, a)
#define chmin(x, a) x = min(x, a)
#define MOD 1000000007
#define INF 1e19

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}


int main() {
    int N; cin >> N;
    vector<double> A(N), B(N);
    rep(i, N) cin >> A[i] >> B[i];
    map<double, ll> check1, check2;
    int zero = 0;
    vector<double> memo;
    rep(i, N) {
        if (B[i]) {
            if (check1[A[i]/B[i]] <= 0) memo.push_back(A[i]/B[i]);
            check1[A[i]/B[i]]++;
        }
        if (A[i]) {
            check2[-B[i]/A[i]]++;
        }
        if (A[i] == 0 || B[i] == 0) zero++;
        
    }
    ll cnt = 0;
    ll ans = 1;
    rep(i, memo.size()) {
        if (memo[i] == 0) {
            ans *= modpow(2, zero-1, MOD);
            ans %= MOD;
            cnt += zero;
            continue;
        }
        if (check2[memo[i]] > 0) {
            cnt += check1[memo[i]] + check2[memo[i]];
            ans *= (modpow(2, check1[memo[i]], MOD)-1)
            ans %= MOD;
        }
    }
    ans *= modpow(2, N-cnt, MOD);
    ans %= MOD;
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:55: error: expected ';' before 'ans'
   54 |             ans *= (modpow(2, check1[memo[i]], MOD)-1)
      |                                                       ^
      |                                                       ;
   55 |             ans %= MOD;
      |             ~~~
Language: C++

#include<bits/stdc++.h>
#define int long long
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair

using namespace std;

const int N=2e5+5;
const int mod=1000000007;
int n,a[N],b[N],pw[N],zero1,zero2;
map<pii,int>cnt;

main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin>>n;
    pw[0]=1;
    set<pii>val;
    bool both=0;
    for(int i=1;i<=n;i++)
    {
        pw[i]=pw[i-1]*2%mod;
        cin>>a[i]>>b[i];
        if(a[i]==0&&b[i]==0) both++;
        else if(a[i]==0) zero1++;
        else if(b[i]==0) zero2++;
        else
        {int g=__gcd(abs(a[i]),abs(b[i]));
        a[i]/=g;
        b[i]/=g;
        if(b[i]<0)
        {
            a[i]*=-1;
            b[i]*=-1;
        }
        pii now=mp(a[i],b[i]);
        pii need=mp(-b[i],a[i]);
        if(need.se<0)
        {
            need.se*=-1;
            need.fi*=-1;
        }
        if(!val.count(need)) val.insert(now);
        cnt[now]++;
        }
    }
    int res=(pw[zero1]+pw[zero2]-1)%mod;
    for(auto&x:val)
    {
        pii cur=x;
        pii ncur=mp(-x.se,x.fi);
        //cout<<cur.fi<<' '<<cur.se<<' '<<ncur.fi<<' '<<
        if(ncur.se<0)
        {
            ncur.se*=-1;
            ncur.fi*=-1;
        }
        res=res*(pw[cnt[cur]]+pw[cnt[ncur]]-1+mod)%mod;
    }
    cout<<(res-1+mod+both)%mod;
}



Compiler output:
a.cc:15:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   15 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:27:30: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   27 |         if(a[i]==0&&b[i]==0) both++;
      |                              ^~~~
Language: C++

#include <bits/stdc++.h>

using ll = long long;
using namespace std;
const int INFint = 2e9+1;
const ll INFll = 2e18+1;
ll MOD=1e9+7;
ll gcd(ll a, ll b) { return __gcd(a,b); } //最大公約数
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; } //最小公倍数

int main(){
  ll N;
  cin>>N;
  map<ll,map<ll,ll>> m;
  vector<pair<ll,ll>> p(N);
  for(int i(0);i<N;i++){
    ll a,b;
    cin>>a>>b;
    if(a < 0 && b < 0){
      a *= -1;
      b *= -1;
    }else if(a < 0 && b > 0){
      a *= -1;b*=-1;
    }
    a %= MOD;
    b %= MOD;
    ll kouyakusuu = gcd(abs(a),abs(b));
    if(kouyakusuu != 0){
      a /= kouyakusuu;
      b /= kouyakusuu;
    }
    //cout << a << " " << b << endl;
    m[a][b]++;
    p[i] = {a,b};
  }
  ll ans(1);
  for(int i(0);i<N;i++){
    ll a = p[i].first,b = p[i].second;
    if(m[a][b] && a>=0 && b>=0){
      ll tmp(0);
      if(!m[b].empty()){
        tmp += m[a][b] + m[b][-a] + 1; //一個
        tmp %= MOD:
        if(m[a][b] >= 2) tmp += (m[a][b]*(m[a][b]-1)/2)%MOD;
        if(m[b][-a] >= 2) tmp += (m[b][-a]*(m[b][-a]-1)/2)%MOD;
        ans *= tmp;
        ans %= MOD;
        m[a][b] = 0;
        m[b][-a] = 0;
      }else{
        tmp += m[a][b] + 1; //一個
        if(m[a][b] >= 2) tmp += (m[a][b]*(m[a][b]-1)/2)%MOD;
        ans *= tmp;
        ans %= MOD;
        m[a][b] = 0;
      }
      //cout << ans << endl;
    }
  }
  for(auto mi:m){
    if(!mi.second.empty()){
      for(auto mii:mi.second){
        //cout << mii.second << endl;
        ans *= (mii.second+1);
        ans %= MOD;
      }
    }
  }
  cout << ans - 1<< endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:43:19: error: expected ';' before ':' token
   43 |         tmp %= MOD:
      |                   ^
      |                   ;
Language: C

#include <stdio.h>

int main(void)
{
	int N,i,j;
	long long answer=0,S[200000][200000],A[200000],B[200000],total[200000],l;
	scanf("%d",&N);
	for(i=0;i<N;i++){
		total[i]=N-i-1;
		scanf("%lld",&A[i]);
		scanf("%lld",&B[i]);
	}
	for(i=0;i<N-1;i++){
		for(j=i+1;j<N;j++){
			if(A[i]*A[j]+B[i]*[j]==0)total[i]--;
		}
	}
	for(i=0;i<N;i++){
		l=1;
		for(j=0;j<total[i];j++){
			l=l*2;
			if(l>=1000000007)l=l%1000000007;
		}
		answer+=l;
		if(answer>=1000000007)answer=answer%1000000007;
	}
	printf("%lld",answer);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:43: error: expected expression before '[' token
   15 |                         if(A[i]*A[j]+B[i]*[j]==0)total[i]--;
      |                                           ^
Language: C++

#include <iostream>
#include <map>
#include <numeric>
#include <vector>
using namespace std;
#define repl(i, l, r) for (ll i = l; i < r; i++)
#define rep(i, n) repl(i, 0, n)
using ll = long long;
const ll MOD = 1000000007;
ll modpow(ll a, ll n) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % MOD;
		a = a * a % MOD;
		n >>= 1;
	}
	return res;
}
int main() {
	int n;
	cin >> n;
	ll a[n], b[n];
	map<pair<ll, ll>, ll> mp;
	rep(i, n) {
		cin >> a[i] >> b[i];
		if (a[i] == 0 or b[i] == 0)
			a[i] = 1, b[i] = 0;
		else {
			ll g = gcd(a[i], b[i]);
			a[i] /= g, b[i] /= g;
			if (a[i] < 0) a[i] *= -1, b[i] *= -1;
		}
		mp[{a[i], b[i]}]++;
	}
	map<pair<ll, ll>, ll> seen;
	rep(i, n) {
		ll na = a[i], nb = b[i];
		if (seen[{na, nb}]) continue;
		if (b[i] == 0) {
			seen[{a[i], b[i]}] = 1;
		} else {
			mp[{na, nb}] = modpow(2, mp[{na, nb}]) - 1;
			if (b[i] > 0) {
				mp[{na, nb}] += modpow(2, mp[{nb, -na}]) - 1;
				mp[{nb, -na}] = 0;
				seen[{nb, -na}] = 1;
			} else {
				mp[{na, nb}] += modpow(2, mp[{-nb, na}]) - 1;
				mp[{-nb, na}] = 0;
				seen[{-nb, na}] = 1;
				mp[{na, nb}] %= MOD;
			}
			seen[{na, nb}] = 1;
		}
		ll ans = 1;
		for (auto p : mp) {
			ans *= p.second + 1;
			ans %= MOD;
		}
		cout << ans - 1 << endl;
		return 0;
	}


Compiler output:
a.cc: In function 'int main()':
a.cc:62:10: error: expected '}' at end of input
   62 |         }
      |          ^
a.cc:19:12: note: to match this '{'
   19 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define REPS(i,n) FOR(i,1,n+1)
#define RFOR(i,l,r) for(long long i=(l);i>=(r);--i)
#define RREP(i,n) RFOR(i,N-1,0)
#define RREPS(i,n) RFOR(i,N,1)
#define int long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
const int INF=1e18;
const int MOD=1e9+7;
const int MAX=200001;
int fac[MAX],finv[MAX],inv[MAX];

void COMinit(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<MAX;i++){
        fac[i]=fac[i-1]*i%MOD;
        inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
        finv[i]=finv[i-1]*inv[i]%MOD;
    }
}

int COM(int n,int k){
    if(n<k)return 0;
    if(n<0||k<0)return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}

int powMOD(int n,int r){
    if(r<=0)return 1;
    if(r%2==0)return powMOD(n,r/2)*powMOD(n,r/2)%MOD;
    if(r%2==1)return powMOD(n,r-1)*n%MOD;
}

signed main(){
    int N;cin>>N;
    double X[N],Y[N];
  	REP(i,N)X[i]=INF;
    map<double,int>umemo;
    map<double,int>smemo;
    map<double,bool>used;
  	int Ac=0;Bc=0;
    REP(i,N){
        double a,b;cin>>a>>b;
      	if((a==0)||(b==0)){
          	if(a==0&&b==0){
              	continue;
            }
          	if(a==0)Ac++;
          	if(b==0)Bc++;
        }
        X[i]=a/b;
        umemo[a/b]++;
        smemo[(-b/a)]++;
        used[a/b]=false;
    }
    int ans=1;
    REP(i,N){
      	if(X[i]==INF)continue;
        if(used[X[i]])continue;
        used[X[i]]=true;
        used[-1.0/X[i]]=true;
        int d=0;
      	
        if(smemo[X[i]]==0){
            d=powMOD(2,umemo[X[i]]);
        }
        else{
          	d=-1;
            d=(d+powMOD(2,umemo[X[i]]))%MOD;
            d=(d+powMOD(2,smemo[X[i]]))%MOD;
        }
      	while(d<0)d+=MOD;
		ans=ans*d%MOD;
    }
  	int d=-1;
  	d=(d+powMOD(2,Ac)%MOD);
    d=(d+powMOD(2,Bc)%MOD);
  ans=ans*d%MOD;
  	ans--;
    while(ans<0)ans+=MOD;
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:18: error: 'Bc' was not declared in this scope; did you mean 'Ac'?
   64 |         int Ac=0;Bc=0;
      |                  ^~
      |                  Ac
a.cc: In function 'long long int powMOD(long long int, long long int)':
a.cc:55:1: warning: control reaches end of non-void function [-Wreturn-type]
   55 | }
      | ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
double mod = 1000000007;
long long power(double m,double n){
    double res = 1;
    if(n > 0){
        res = power(m,n / 2);
        if((long long)n % 2 == 0){
            res = (long long)(res * res) % mod;
        }
        else{
            res = (long long)(((long long)(res * res) % mod) * m) % mod;
        }
    }
    return res;
}
int main(){
  double n = 0;
  cin >> n;
  map<double,double> count;
  for(int i = 0;i < n;i++){
    double a,b;
    cin >> a >> b;
    if(b != 0)count[(double)a / b]++;
    else count[0]++;
    //cout << a / b << endl;
  }
  if(n == 1){
    cout << 1 << endl;
    return 0;
  }
  double res = 0;
  res = 1;
  double pair = 0;
  //res = power(2,n) - 1;
  if(res < 0)res += mod;
  for(auto& item:count){
    //cout << item.first << " "<< item.second<< endl;
    if(item.first >= 0)continue;
    double now = 0;
    //now = item.second * count[(double)-1 / item.first];
    //cout << now << endl;
    now += item.second + count[(double)-1 / item.first];
    if(item.second <= 0 || count[(double)-1 / item.first] <= 0)continue;
    pair += now;
    now = pow(2,item.second) - 1 + pow(2,count[(double)-1 / item.first]) - 1;
    now++;
    //ll mai = 0;
    //mai = now * power(2,n - 2);
    //mai %= mod;
    res *= now;
    res %= mod;
    //while(res < 0)res += mod;
    //cout << now << endl;
  }
  //cout << res << endl;
  res *= count[0] + 1;
  pair += count[0];
  //cout << res << endl;
  //cout << "p" << pair << endl;
  //cout << res << endl;
  res *= pow(2,n - pair);
  res %= mod;
  res--;
  if(res < 0)res += mod;
  cout << (ll)res << endl;
}

Compiler output:
a.cc: In function 'long long int power(double, double)':
a.cc:19:42: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   19 |             res = (long long)(res * res) % mod;
      |                   ~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~
      |                   |                        |
      |                   long long int            double
a.cc:22:55: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   22 |             res = (long long)(((long long)(res * res) % mod) * m) % mod;
      |                                ~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~
      |                                |                        |
      |                                long long int            double
a.cc: In function 'int main()':
a.cc:62:9: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   62 |     res %= mod;
      |     ~~~~^~~~~~
a.cc:62:9: note:   in evaluation of 'operator%=(double, double)'
a.cc:73:7: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   73 |   res %= mod;
      |   ~~~~^~~~~~
a.cc:73:7: note:   in evaluation of 'operator%=(double, double)'
Language: C++

#include <bits/stdc++.h>

constexpr static int MAX = 1000000007;
std::vector<int> pow2s(33, -1);

int pow2(int N) {
    if (pow2s[N] != -1) {
        return pow2s[N];
    }
    if (N % 2 == 0) {
        pow2s[N] = pow2(N / 2) * pow2(N / 2) % MAX;
    } else {
        pow2s[N] = (pow2(N / 2) * pow2(N / 2)  * 2  % MAX;
    }
    return pow2s[N];
}


int main() {
    int N;
    std::cin >> N;

    pow2s[0] = 1;
    pow2s[1] = 2;

    std::map<std::pair<long long int, long long int>, int> map;
    for (int i = 0; i < N; i++) {
        long long int a, b;
        std::cin >> a >> b;
        long long int g = std::gcd(a, b);
        a = a / g;
        b = b / g;
        if (a < 0) {
            a *= -1;
            b *= -1;
        }
        auto p = std::make_pair(a, b);
        if (map.find(p) == map.end()) {
            map[p] = 0;
        }
        map[p]++;
    }

    int no_counter = 0;
    int factor = 1;
    for (auto&& m : map) {
        if (m.second == 0) {
            continue;
        }
        auto counter = std::make_pair(m.first.second, m.first.first * -1);
        if (counter.first < 0) {
            counter.first *= -1;
            counter.second *= -1;
        }
        if (map.find(counter) == map.end()) {
            no_counter += m.second;
        } else {
            factor *= (pow2(m.second) + pow2(map[counter]) - 1);
            map[counter] = 0;
        }
    }

    std::cout << (pow2(no_counter) * factor - 1) % MAX << std::endl;
}


Compiler output:
a.cc: In function 'int pow2(int)':
a.cc:13:58: error: expected ')' before ';' token
   13 |         pow2s[N] = (pow2(N / 2) * pow2(N / 2)  * 2  % MAX;
      |                    ~                                     ^
      |                                                          )
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
using Graph = vector< vector<int> >;

int main() {
    int N; cin >> N;
    vector<tuple<long double,ll,ll> > XY;
    for (int i = 0; i < N; i++)
    {
        ll a,b; cin >> a >> b;
        if(b < 0){
            a *= -1;
            b *= -1;
        }
        XY.push_back(make_tuple((double)a/(double)sqrt(a*a+b*b),a,b));
    }
    sort(XY.begin(),XY.end());
    
    
    int cnt = 0;
    while(get<0>(XY[cnt])<0){
        cnt++;
    }
    int x,y;
    x = 0; y = cnt;
    int z = cnt;
    cnt = 1;
    vector<int> ANS;
    while(y < N and x < z){
        ll& nai = get<1>(XY[x]);
        ll& nai2 = get<1>(XY[y]);
        ll& nai3 = get<2>(XY[x]);
        ll& nai4 = get<2>(XY[y]);
        nai = nai*nai2+nai3*nai4;
        if(nai > 0){
            ANS.push_back(cnt);
            cnt = 1;
            x++;
        }
        else if(nai < 0){
            ANS.push_back(cnt);
            cnt = 1;
            y++;
        } 
        else{
            cnt++;
            if(z-x > N-y) x++;
            else y++;
        }
    }
    ANS.push_back(cnt);
    ll ans = 1;
    for (int i = 0; i < N; i++)
    {
        ans *= 2;
        ans %= 1000000007;
    }
    ll ans2 = 1;
    for (int i = 0; i < ANS.size(); i++)
    {
        for (int j = 0; j < ANS[i]; j++)
        {
            ll a += ANS[i];
            a%=1000000007;
        }
        
        ans2 *= a;
        ans2 %= 1000000007;
    }
    cout << ans-ans2 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:64:18: error: expected initializer before '+=' token
   64 |             ll a += ANS[i];
      |                  ^~
a.cc:65:13: error: 'a' was not declared in this scope
   65 |             a%=1000000007;
      |             ^
a.cc:68:17: error: 'a' was not declared in this scope
   68 |         ans2 *= a;
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef std::pair<long long, long long> pair;

struct comp
{
    template <typename T>
    bool operator()(const T &l, const T &r) const
    {
        if (l.first == r.first)
            return l.second > r.second;

        return l.first < r.first;
    }
};

long long modpow(long long a, long long n, long long mod)
{
    long long res = 1;
    while (n > 0)
    {
        if (n & 1)
            res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

int main()
{
    long long p = 1000000007;
    int N;
    cin >> N;
    long long A[N], B[N];
    map<pair, long long, comp> mp;
    for (int i = 0; i < N; i++)
    {
        cin >> A[i] >> B[i];
        long long kou = __gcd(A[i], B[i]);
        long long a = A[i] / kou;
        long long b = B[i] / kou;
        if (b < 0)
        {
            a = -a;
            b = -b;
        }
        pair pr = make_pair(a, b);
        mp[pr]++;
    }
    long long ans = 0;
    for (int i = 0; i < N; i++)
    {
        long long kou = __gcd(A[i], B[i]);
        long long a = A[i] / kou;
        long long b = B[i] / kou;
        if (b < 0)
        {
            a = -a;
            b = -b;
        }
        ans += modpow(2, N - mp[make_pair(-a, b)], p) - 1;
        ans %= p;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:30: error: template argument 1 is invalid
   37 |     map<pair, long long, comp> mp;
      |                              ^
a.cc:37:30: error: template argument 4 is invalid
a.cc:49:9: error: reference to 'pair' is ambiguous
   49 |         pair pr = make_pair(a, b);
      |         ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:89:12: note: candidates are: 'template<class _T1, class _T2> struct std::pair'
   89 |     struct pair;
      |            ^~~~
a.cc:4:41: note:                 'typedef struct std::pair<long long int, long long int> pair'
    4 | typedef std::pair<long long, long long> pair;
      |                                         ^~~~
a.cc:50:12: error: 'pr' was not declared in this scope; did you mean 'p'?
   50 |         mp[pr]++;
      |            ^~
      |            p
a.cc:63:32: error: no match for 'operator[]' (operand types are 'int' and 'std::pair<long long int, long long int>')
   63 |         ans += modpow(2, N - mp[make_pair(-a, b)], p) - 1;
      |                                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll>
#define cvector vector<char>
#define svector vector<string>
#define lque queue<ll>
#define lpque priority_queue<ll>
#define dlpque priority_queue<ll,lvector,greater<ll>>
#define P pair<ll,ll>
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define rep(i,n) for(ll i=0; i<n; ++i)
#define print(a) cout << (a) << endl

ll modpow(ll a, ll p) {
  ll ret=1,mod=1e9+7;
  while(p>0) {
    if(p&1) ret=(ret*a)%mod;
    a=(a*a)%mod;
    p>>=1;
  }
  return ret;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll a,b,d,n,ans=0,mod=1e9+7;cin>>n;
  map<P,ll> pos,neg;
  ll zero_a,zero_b,zero_w;
  rep(i,n) {
    cin>>a>>b;
    d=__gcd(a,b);
    if(a*b>0) pos[P(a/d,b/d)]++;
    else if(a*b<0) pos[P(abs(a/d),abs(b/d))]++;
    else if(a==0&&b!=0) zero_a++;
    else if(a!=0&&b==0) zero_b++;
    else zero_w++;
  }
  ans=modpow(2,n-zero_w);
  ans-=(modpow(2,zero_a)-1)*(modpow(2,zero_b)-1)*modpow(2,n-zero_w-zero_a-zero_b);
  while(ans<0) ans+=mod;
  ll num=0;
  for(auto e:pos) {
    a=e.first.first,b=e.first.second,num=p.second;
    auto inv=neg(P(b,a));
    if(inv.second==0) continue;
    num*=inv;
    ans=(ans-(modpow(2,num)-1)*modpow(2,n-2*num))%mod;
    while(ans<0) ans+=mod;
  }
  print(ans);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:42: error: 'p' was not declared in this scope
   46 |     a=e.first.first,b=e.first.second,num=p.second;
      |                                          ^
a.cc:47:17: error: no match for call to '(std::map<std::pair<long long int, long long int>, long long int>) (std::pair<long long int, long long int>)'
   47 |     auto inv=neg(P(b,a));
      |              ~~~^~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <cmath>
#include <numeric>
using namespace std;
using Graph = vector<vector<int>>;

template<class tContainer>
int sum(tContainer const& iContainer)
{
    return  std::accumulate(std::begin(iContainer), std::end(iContainer), 0);
}

int main() {
    // 頂点数と辺数
    int n;
    cin >> n;
    long long a[n], b[n];
    for (int i = 0; i < n; ++i) {
        cin >> a[i] >> b[i];
    }

    vector<vector<int>> able_map(n, vector<int>(n, 0));
    // int able_to_combine[n] = {0};
    long long ret = 0;

    for (int i = 0; i < n; ++i) {
        able_map[i][i] = 1;
        for (int j = i+1; j < n; ++j) {
            if (a[i]*a[j]+b[i]*b[j]==0){
                able_map[i][j] = 0;
                able_map[j][i] = 0;
            } else {
                able_map[i][j] = 1;
                able_map[j][i] = 1;
            }
        }
        // able_to_combine[i] = sum(able_map[i]);
        auto able_to_combine_num = sum(able_map[i]);
        ret = (ret + ((long long)pow(1.5, able_to_combine_num) - able_to_combine_num*1.5)) % 1000000007;
    }

    cout << ret << endl;
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:92: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   41 |         ret = (ret + ((long long)pow(1.5, able_to_combine_num) - able_to_combine_num*1.5)) % 1000000007;
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~
      |                    |                                                                         |
      |                    double                                                                    int
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
#define ALL(v) v.begin(), v.end()
#define vmax(v) *max_element(ALL(v))
#define vmin(v) *min_element(ALL(v))
#define chmax(x, a) x = max(x, a)
#define chmin(x, a) x = min(x, a)
#define MOD 1000000007
#define INF 1e19

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}


int main() {
    int N; cin >> N;
    vector<double> A(N), B(N);
    rep(i, N) cin >> A[i] >> B[i];
    map<double, ll> check1, check2;
    int zero = 0;
    vector<double> memo;
    rep(i, N) {
        if (B[i]) {
            if (check1[A[i]/B[i]] <= 0) memo.push_back(A[i]/B[i]);
            check1[A[i]/B[i]]++;
        }
        if (A[i]) {
            check2[-B[i]/A[i]]++;
        }
        if (A[i] == 0 || B[i] == 0) zero++;
        
    }
    ll cnt = 0;
    ll ans = 1;
    rep(i, memo.size()) {
        if (memo[i] == 0) {
            ans *= modpow(2, zero-1, MOD);
            ans %= MOD;
            cnt += zero;
            continue;
        }
        if (check2[memo[i]] > 0) {
            cnt += check1[memo[i]] + check2[memo[i]];
            ans *= (modpow(2, check1[memo[i]], MOD)-1
            ans %= MOD;
        }
    }
    ans *= modpow(2, N-cnt, MOD);
    ans %= MOD;
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:54: error: expected ')' before 'ans'
   54 |             ans *= (modpow(2, check1[memo[i]], MOD)-1
      |                    ~                                 ^
      |                                                      )
   55 |             ans %= MOD;
      |             ~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define P pair<int,int>
#define PI 3.141592653589793
const int INF = 1001001001;

const int mod = 1000000007;
//const int mod = 998244353;
struct mint {
	ll x; // typedef long long ll;
	mint(ll x = 0) :x((x% mod + mod) % mod) {}
	mint operator-() const { return mint(-x); }
	mint& operator+=(const mint a) {
		if ((x += a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator-=(const mint a) {
		if ((x += mod - a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this; }
	mint operator+(const mint a) const { return mint(*this) += a; }
	mint operator-(const mint a) const { return mint(*this) -= a; }
	mint operator*(const mint a) const { return mint(*this) *= a; }
	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	// for prime mod
	mint inv() const { return pow(mod - 2); }
	mint& operator/=(const mint a) { return *this *= a.inv(); }
	mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }

mint kaijou(mint x) {
	int xx = x;
	if (xx == 0 || xx == 1) return 1;
	return x * kaijou(x - 1);
}
int main() {
	int n;
	cin >> n;
	mint m = n;
	map<double, mint> mp;
	vector<int> cnt(n);
	mint ans = 1;
	rep(i, n) {
		ans *= 2;
	}
	rep(i, n) {
		ll a, b;
		cin >> a >> b;
		if (a == 0 || b == 0) mp[0]= mp[0] + 1;
		mp[a / b] = mp[a/b]+1;mp[-b/a]=mp[-b/a] + 1;
	}
	auto begin = mp.begin(), end = mp.end();
	mint sa = 0;
	for (auto iter = begin; iter != end; iter++) {
		mint r = iter->second;
		int rn = r;
		if (rn >= 2) {
			sa = sa + kaijou(m - r);
		}
	}
	cout << ans - sa;
}



Compiler output:
a.cc: In function 'mint kaijou(mint)':
a.cc:44:18: error: cannot convert 'mint' to 'int' in initialization
   44 |         int xx = x;
      |                  ^
      |                  |
      |                  mint
a.cc: In function 'int main()':
a.cc:68:26: error: cannot convert 'mint' to 'int' in initialization
   68 |                 int rn = r;
      |                          ^
      |                          |
      |                          mint
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(long long i=0; i<n; i++)
#define REPR(i, n) for(long long i=n-1; i>=0; i--)
#define FOR(i, m, n) for(long long i=m; i<=n; i++)
#define FORR(i, m, n) for(long long i=m; i>=n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
#define FIN ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
const ll mod = 1e9+7;
const ll inf = 1e15;

ll power(ll a,ll b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}

int main(){FIN

    ll n;cin>>n;
    map<double,ll> c, d;
    vector<double> a(n), b(n);
    vector<P> pairs;
    ll allzero = 0;
    REP(i,n) {
        cin>>a[i]>>b[i];
        if(a[i]==0 && b[i]!=0) c[0.0]++; 
        else if (b[i]==0 && a[i]!=0) d[0.0]++; //別扱い
        else if (a[i]==0 && b[i]==0) allzero++;

        else{
            c[b[i]/a[i]]++;
            d[a[i]/b[i] * (-1)]++;
        }
    }
    n -= allzero;
    ll sum = 1;
    for(auto p :c){
        if(d[p.first]){
            
            ll x = p.second;
            ll y = d[p.first];
            d[p.first]=0;
            if(p.first != 0) d[-1/p.first] = 0;
            else d[0.0] = 0;

            n -= x; n-= y;
            sum *= (x+1) * (y+1) -1;
            sum %= mod;
        } 

    ll ans = (sum * power(2,n) -1)%mod;
    if (allzero) ans+=allzero;
    cout<<ans%mod<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:2: error: expected '}' at end of input
   59 | }
      |  ^
a.cc:21:11: note: to match this '{'
   21 | int main(){FIN
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001
#define mod 1000000007
#define mod2 998244353
#define pi 3.141592653589793
#define all(v) v.begin(),v.end()


ll gcd(ll a,ll b){
    if(b>a) swap(a,b);
    if(b==0) return a;
    return gcd(b,a%b);
}
ll lcm(ll a,ll b){
    ll g=gcd(a,b);
    return a/g*b;
}
ll rep_jijo(ll n,ll x){
    if(x==0) return 1;
    if(x%2==0){
        ll t=rep_jijo(n,x/2);
        return t*t%mod;
    }
    return n*rep_jijo(n,x-1)%mod;
}

int main(){
    int n;
    cin >> n;
    int tmp=n;
    vector<double>a(n);
    vector<double>b(n);
    vector<ll>ng;
    map<double,int>mp;
    rep(i,n) cin >> a[i] >> b[i];
    int cnt_a=0;
    int cnt_b=0;
    rep(i,n){
        if(a[i]==0&&b[i]==0)tmp--;
        else if(a[i]==0) {
            cnt_a++;
            tmp--;
        }
        else if(b[i]==0) {
            cnt_b++;
            tmp--;
        }
        else{
            mp[a[i]/b[i]]++;
            mp[-1*(b[i]/a[i])]++;
        }
    }
    int len=0;
    for(auto p:mp){
        if(p.second>1) {
            ng.emplace_back(p.second);
        }
    }
    ll ans=1;
    rep(i,nd.size()){
        tmp-=ng[i];
        ans*=ng[i];
        ans%=mod;
    }
    ans*=cnt_a;
    ans%=mod;
    ans*=cnt_b;
    ans%=mod;
    ans=ans*rep_jijo(2,tmp);
    ans%=mod;
    cout << ans << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:63:11: error: 'nd' was not declared in this scope; did you mean 'ng'?
   63 |     rep(i,nd.size()){
      |           ^~
a.cc:4:38: note: in definition of macro 'rep'
    4 | #define rep(i,n) for(int i=0;i<(int)(n);i++)
      |                                      ^
Language: C++

#ifdef DEBUG
#include "redirect.h"
#endif

#include<bits/stdc++.h>
#define N 200050
#define M 1000000007
#define x first
#define y second
using namespace std;

long long gcd(long long a,long long b) {
    return b == 0 ? a : gcd(b, a % b);
}

map<pair<long long,long long>,pair<int,int>> mp;
map<pair<long long,long long>,pair<int,int>>::iterator iter;

long long er[N];

long long S(long long m,long long n) {
    if (m == 1)
        return 1;
    if (m == n)
        return 1;
    else
        return S(m - 1, n - 1) + S(m, n - 1) * m;
}

int main(int argc, char *argv[]) {
#ifdef DEBUG
    init(argc, argv);
#endif
    register int n,i,ct=0; long long A,B,g,fh,ans=1;
    scanf("%d",&n);
    for (er[0]=i=1;i<=n;i++) er[i]=(er[i-1]*2) %M;
    for (i=1;i<=n;i++) {
        scanf("%lld %lld",&A,&B);
        g=gcd(A,B);
        if (A==0 || B==0) {
            if (A==0 && B==0) {
                ct++;
            } else if (B==0) {
                mp[make_pair(1,0)].y++;
            } else {
                mp[make_pair(0,1)].y++;
            }
        } else {
            fh=(A/abs(A))*(B/abs(B));
            A=abs(A/g); B=abs(B/g);
            if (fh<0) {
                mp[make_pair(B,A)].y++;
            } else {
                mp[make_pair(A,B)].x++;
            }
        }
    }
    iter=mp.begin();
    if (er[iter->y.x-1]==0)
    ans=(er[iter->y.x-1]*er[iter->y.y-1]) %M;
    long long sum=0;
    n=er[iter->y.x];
    for(i=1; i<=n; i++)
        sum+=S(i,n);
    ans=sum;

    long long sum=0;
    n=er[iter->y.y];
    for(i=1; i<=n; i++)
        sum+=S(i,n);
    ans=(ans*sum) %M;
    
    iter++;
    for (;iter!=mp.end();iter++) {
//        printf("%lld %lld\n",iter->y.x,iter->y.y);
        ans=(ans*((er[iter->y.x]+er[iter->y.y]-1) %M)) %M;
    }
    ans=(ans) %M;

    printf("%lld",ans-1);
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:34:18: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   34 |     register int n,i,ct=0; long long A,B,g,fh,ans=1;
      |                  ^
a.cc:34:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   34 |     register int n,i,ct=0; long long A,B,g,fh,ans=1;
      |                    ^
a.cc:34:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   34 |     register int n,i,ct=0; long long A,B,g,fh,ans=1;
      |                      ^~
a.cc:67:15: error: redeclaration of 'long long int sum'
   67 |     long long sum=0;
      |               ^~~
a.cc:61:15: note: 'long long int sum' previously declared here
   61 |     long long sum=0;
      |               ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
#define ALL(v) v.begin(), v.end()
#define vmax(v) *max_element(ALL(v))
#define vmin(v) *min_element(ALL(v))
#define chmax(x, a) x = max(x, a)
#define chmin(x, a) x = min(x, a)
#define MOD 1000000007
#define INF 1e19

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}


int main() {
    int N; cin >> N;
    vector<double> A(N), B(N);
    rep(i, N) cin >> A[i] >> B[i];
    map<double, ll> check1, check2;
    int zero = 0;
    vector<double> memo;
    rep(i, N) {
        if (B[i]) {
            if (check1[A[i]/B[i]] <= 0) memo.push_back(A[i]/B[i]);
            check1[A[i]/B[i]]++;
        }
        if (A[i]) {
            check2[-B[i]/A[i]]++;
        }
        if (A[i] == 0 || B[i] == 0) zero++;
        
    }
    ll cnt = 0;
    ll ans = 1;
    set<double> memo2;
    rep(i, memo.size()) {
        if (memo[i] == 0) {
            ans *= modpow(2, zero-1, MOD);
            ans %= MOD;
            cnt += zero;
            continue;
        }
        if (check2[memo[i]] > 0) {
            cnt += check1[memo[i]] + check2[memo[i]];
            ans *= (modpow(2, check1[memo[i]], MOD)-1
            ans %= MOD;
            memo2.insert(1/memo[i]);
        }
    }
    ans *= modpow(2, N-cnt, MOD);
    ans %= MOD;
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:54: error: expected ')' before 'ans'
   55 |             ans *= (modpow(2, check1[memo[i]], MOD)-1
      |                    ~                                 ^
      |                                                      )
   56 |             ans %= MOD;
      |             ~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
int mod = 1000000007;
#define ll long long

int main() {
    int n;
    cin>>n;
    ll a,b,ans=n;
    vector<ll> s;
    rep(i,n) {
        cin>>a>>b;
        s.push_back(a/b);
        s.push_back(-b/a);
    }
    sort(s.begin(),s.end());
    int flag=0;
    vector<int> dob;
    rep(i,s.size()){
        if(flag ==0 and s[i]==s[i+1]){
            flag=1;
            int cnt=2;
        }else if(s[i]==s[i+1]){
            cnt++;
        }else if(flag) {
            n-=cnt-1;
            flag=0;
        }
    }
    if(flag)n-=cnt-1;
    ll ans1=1;
    rep(i,n){
        ans1*=2;
        ans1%=mod;
    }
    cout << (ans+ans1)%mod <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:13: error: 'cnt' was not declared in this scope; did you mean 'int'?
   25 |             cnt++;
      |             ^~~
      |             int
a.cc:27:16: error: 'cnt' was not declared in this scope; did you mean 'int'?
   27 |             n-=cnt-1;
      |                ^~~
      |                int
a.cc:31:16: error: 'cnt' was not declared in this scope; did you mean 'int'?
   31 |     if(flag)n-=cnt-1;
      |                ^~~
      |                int
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        ArrayList<Integer> iwashies = new ArrayList<Integer>();

        for(int i = 0; i < n; i++){
            int a = scan.nextInt();
            int b = scan.nextInt();
            int iwashi = a * b;
            iwashies.add(iwashi);
        }

        int challNum = 0;
        for(int p = 0; p < n; p++) {
            //p番目と仲よしの数を数える
            int target = iwashies.indexOf(p);
            int favCount = 0;
            for(int r = p + 1; r < n; r++){
                int partner = iwashies.indexOf(r);
                if(target + partner != 0) {
                    target += 1;
                }
            }
            for(int j = 0; j < favCount; j++) {
                challNum += calcNumOfCombination(favCount,j);
            }
        }
        String result = String.valueOf(challNum%1000000007);
            
        System.out.println(String.valueOf(result));

    }

    int calcNumOfCombination(int n, int r){
        int num = 1;
        for(int i = 1; i <= r; i++){
            num = num * (n - i + 1) / i;
        }
        return num;
    }
}

Compiler output:
Main.java:29: error: non-static method calcNumOfCombination(int,int) cannot be referenced from a static context
                challNum += calcNumOfCombination(favCount,j);
                            ^
1 error
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(long long i=0; i<n; i++)
#define REPR(i, n) for(long long i=n-1; i>=0; i--)
#define FOR(i, m, n) for(long long i=m; i<=n; i++)
#define FORR(i, m, n) for(long long i=m; i>=n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
#define FIN ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
const ll mod = 1e9+7;
const ll inf = 1e15;

ll power(ll a,ll b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}

int main(){FIN

    ll n;cin>>n;
    map<double,ll> c, d;
    vector<double> a(n), b(n);
    vector<P> pairs;
    ll allzero = 0;
    REP(i,n) {
        cin>>a[i]>>b[i];
        if(a[i]==0 && b[i]!=0) c[0.0]++; 
        else if (b[i]==0 && a[i]!=0) d[0.0]++; //別扱い
        else if (a[i]==0 && b[i]==0) allzero++;

        else{
            c[b[i]/a[i]]++;
            d[a[i]/b[i] * (-1)]++;
        }
    }
    n -= allzero;
    ll sum = 1;
    for(auto p :c){
        if(d[p.first]){
            
            ll x = p.second;
            ll y = d[p.first];
            d[p.first] = 0;
            if(p.first != 0) d[-1/p.first] = 0;
            else d[0.0] = 0;

            n -= x; n-= y;
            sum *= (x+1) * (y+1) -1;  
            sum %= mod;
        } 

    ll ans = (sum * power(2,n)  -1)%mod;
    if (allzero) ans+=allzero;
    cout<<ans%mod<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:2: error: expected '}' at end of input
   59 | }
      |  ^
a.cc:21:11: note: to match this '{'
   21 | int main(){FIN
      |           ^
Language: C++

#include <numeric>
#include <iostream>
#include <array>
#include <string>
#include <vector>
#include <cassert>
#include <algorithm>
#include <math.h> 
#include <set>
#include <map>
#include <utility>
#include <deque>
#include <queue>
#include <iomanip>
#include <limits>

using namespace std;

#define ll long long int
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repp(i, n) for(ll i = 1; i <= n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define riverse(v) reverse((v).begin(), (v).end())
#define pb push_back
#define mp make_pair
#define all(a)  (a).begin(),(a).end()
using vi = vector<int>;
using vs = vector<string>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vb = vector<bool>;
using vvb = vector<vb>;
const ll MOD = 1e9 + 7;
const double pi = 3.14159265358979323846264338327950288;
vi alphabet = { 'a','b','c','d','e','f','g','h','i','j','k','l','m',
               'n','o','p','q','r','s','t','u','v','w','x','y','z' };

ll gcd(ll a, ll b) {
    if (a == 0 && b != 0) return(b);
    else if (a != 0 && b == 0) return(a);
    else if (a % b == 0)  return(b);
    else return(gcd(b, a % b));
}


int main() {
    int N;
    cin >> N;
    vll A(N);
    vll B(N);
    rep(i, N) {
        cin >> A[i];
        cin >> B[i];
    }
    int ex1=0;
    int ex2=0;
    int ex3=0;
    map<vll, int> gr;
    rep(i, N) {
        if (A[i] == 0 && B[i] == 0)ex1++;
        else if (A[i] == 0 && B[i] != 0)ex2++;
        else if (A[i] != 0 && B[i] == 0)ex3++;
        else {
            ll g = gcd(A[i], B[i]);
            A[i] /= g;
            B[i] /= g;
            vll v = { A[i],B[i] };
            vll u = { -B[i],A[i] };
            vll w = { B[i],-A[i] };
            if (gr.count(u) || gr.count[w]) {
                gr[u]++;
                gr[w]++;
            }
            else gr[v] = 1;
        }
    }
    ll ans = 0;
    ll k = ex2;
    for (pair<vll, int> p : gr) {
        ll v = p.second;
        k *= v + 1;
        k %= MOD;
    }
    ans += k;
    k = ex3;
    for (pair<vll, int> p : gr) {
        ll v = p.second;
        k *= v + 1;
        k %= MOD;
    }
    ans += k;
    k = 1;
    for (pair<vll, int> p : gr) {
        ll v = p.second;
        k *= v + 1;
        k %= MOD;
    }
    k -= 1;
    ans += k;
    if (ans < 0) ans += MOD;
    cout << ans << endl;
}   

Compiler output:
a.cc: In function 'int main()':
a.cc:71:40: error: no match for 'operator[]' (operand types are '<unresolved overloaded function type>' and 'vll' {aka 'std::vector<long long int>'})
   71 |             if (gr.count(u) || gr.count[w]) {
      |                                        ^