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

//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define bit(n,k) (((ll)n>>(ll)k)&1) /*nのk bit目*/
const long long INF= 1e+18+1;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
//const ll MOD=998244353LL;
//const ll MAX_V=114514LL;
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
vl dx={-1,-1,-1,0,0,1,1,1};
vl dy={1,-1,0,1,-1,1,0,-1};
ll modpow(ll a, ll n, ll mod) {
  
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
int main(){
  ll n;cin>>n;
  vl a(n),b(n);
  vl hugou(n);
  rep(i,n)cin>>a[i]>>b[i];
  map<pair<ll,P>,ll>M;
  ll b_zero=0;
  ll a_zero=0;
  ll double_zero=0;
  rep(i,n){
    if(a[i]!=0&&b[i]!=0){
      ll g=__gcd(a[i],b[i]);
      a[i]/=g;b[i]/=g;
    }
    if((a[i]>0&&b[i]>0)||(a[i]<0&&b[i]<0))hugou[i]=1;
    else if(a[i]==0||b[i]==0)hugou[i]=0;
    else hugou[i]=-1;
    a[i]=abs(a[i]);
    b[i]=abs(b[i]);
    pair<ll,P> p;
    p.first=hugou[i];
    p.second.first=a[i];
    p.second.second=b[i];
    M[p]++;
    else {
      if(a[i]==0&&b[i]==0)double_zero++;
      else if(a[i]==0)a_zero++;
      else b_zero++;
    }
  }
  ll ans=1;
  for(auto bigp:M){
    ll part=1;
    pair<ll,P> p=bigp.first;
    //cout<<p.first<<" "<<p.second.first<<" "<<p.second.second<<" "<<bigp.second<<endl;
    pair<ll,P>con;
    if(p.first==0)continue;
    con.first=-1;
    con.second.first=p.second.second;
    con.second.second=p.second.first;
    if(p.first==1&&M[con]>0)continue;
    part*=modpow(2,bigp.second,MOD);
    if(bigp.first.first==-1){
      ll part2=1;
      pair<ll,P>rev;
      rev.first=1;
      rev.second.first=p.second.second;
      rev.second.second=p.second.first;
      part2*=modpow(2,M[rev],MOD);
      part+=part2;
      part+=MOD;
      part--;
      part%=MOD;
    }
    ans*=part;
    ans%=MOD;
  
  }
  ll part=modpow(2,a_zero,MOD);
  ll part2=modpow(2,b_zero,MOD);
  part+=part2;
  part+=MOD;
  part--;
  part%=MOD;
  ans*=part;
  //ans%=MOD;
  ans%=MOD;
  ans+=MOD;
  ans--;
  ans%=MOD;
  
  cout<<ans+double_zero<<endl;
  //cout<<zero<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:5: error: 'else' without a previous 'if'
   54 |     else {
      |     ^~~~
Language: C

#include <stdio.h>

int main(void)
{
  long long int n;
  long long int a[1000000];
  long long int b[1000000];
  long long int result;
  scanf("%lld %lld", &n, &m);
  for(long long int i=1;i<=n-1;i++){
    scanf("%lld %lld", &a[i], &b[i]);
  }
  result = n*(n-1)/2;
  for(long long int i=1;i<=n;i++){
    for(long long int j=i+1;j<=n;j++){
      if(a[i]*a[j]+b[i]*b[j]==0){
	result = result-1;
	break;
      }
    }
  }
  printf("%lld\n", result%1000000007);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:27: error: 'm' undeclared (first use in this function)
    9 |   scanf("%lld %lld", &n, &m);
      |                           ^
main.c:9:27: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
 
#define f(i,a,b) for( ll i = a; i < b ; i++ ) 
#define af(i,a,b) for( ll i = a; i >= b ; i--)
#define rep(i,a,b,k) for(ll i = a; i < b ; i+= k )
#define arep(i,a,b,k) for( ll i = a; i >= b ; i-= k)
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz(a) (ll) a.size()
#define all(a) a.begin(), a.end()
#define sor(a) sort( a.begin(), a.end() )
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define inter ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nuintptr)
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> ii ;
typedef vector<ll>  vi ;
typedef vector<ii> vii ;
 
const int MAX= 1e6+10;
const ll inf =9;


map<ii,ll> m;
ll pot[MAX],mod=1e9+7;

ll sig(ll x){
	return (x>0?1:-1);
}
ii inv(ii x){
	return mp(-1*(sig(x.ff))*x.ss,abs(x.ff));
}

int main(){
	fastio;
	pot[0]=1;
	f(i,1,MAX) pot[i]=(2LL*pot[i-1])%mod;
	ll tc,n,a,b,p=0,q=0,r=0;
	cin>>n;
	f(i,0,n){
		cin>>a>>b;
		if(a==0 && b==0) r++;
		else if(a==0) p++;
		else if(b==0) q++;
		else{
			if(b<0) a*=-1,b*=-1;
			m[{a/__gcd(a,b),b/__gcd(a,b)}]++;
		}
	}
	ll ans=1;
	if(r==n) {
		cout<<n<<endl;
		continue;
	}
	
	(ans*=(r + pot[p] + pot[q] -1 )%mod )%=mod; ;
	
	for(auto it:m){
		ii x = it.ff; 
		ii y = inv(x);
		m[y];
		if(x.ff<0) continue;
/*		if(m[y]==0) (ans*=(pot[m[x]]))%=mod;
		else if(m[x]==0) (ans*=(pot[m[y]]))%=mod;
		else{
*/			(ans*=(  (pot[m[x]] + pot[m[y]] -1+mod)%mod ) )%=mod;
//		} 
	}
	cout<<(ans-1+mod)%mod<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:17: error: continue statement not within a loop
   57 |                 continue;
      |                 ^~~~~~~~
Language: C++

#include <iostream>
#include <map>
#include <utility>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
constexpr ll mod = 1000000007;
map<pll,ll> mp;
ll pw(ll a,ll x){
    ll ret = 1;
    while(x){
        if(x&1) (ret *= a) %= mod;
        (a *= a) %= mod; x /= 2;
    }
    return ret;
}

ll gcd(ll a, ll b){
    if(a<0) a *= -1;
    if(b<0) b *= -1;
    if(a<b) swap(a,b);
    if(b==0) return a;
    return gcd(a%b,b);
}

int main(){
    int i,n,cnt = 0;
    cin >> n;
    for(i=0;i<n;i++){
        ll a,b; cin >> a >> b;
        if(a==0 && b==0){
            cnt++;
            ecit(1);
        }else{
            ll x = gcd(a,b);
            a /= x; b /= x;
            if(a<0){
                a *= -1; b *= -1;
            }
            if(a==0){
                if(b<0) b*= -1;
            }
            mp[{a,b}]++;
        }
    }
    ll ans = 1;
    for(auto p:mp){
        auto pp = p.first;
        ll a = pp.first,b = pp.second;
        ll aa = -b,bb = a;
        if(aa<0){
            aa *= -1; bb *= -1;
        }
        if(aa==0){
            if(bb<0) bb *= -1;
        }
        if(mp.find({aa,bb})!=mp.end()){
            ll s = mp[{aa,bb}],t = p.second;
            (ans *= ((pw(2,s) + pw(2,t) - 1)%mod)) %= mod;
            mp.erase({aa,bb});
        }else{
            (ans *= pw(2,p.second)) %= mod;
        }
    }
    (ans += cnt) %= mod;
    cout << ans - 1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:13: error: 'ecit' was not declared in this scope; did you mean 'exit'?
   33 |             ecit(1);
      |             ^~~~
      |             exit
Language: C++

#include "bits/stdc++.h"
#define int long long
#define endl '\n'
using namespace std;
 
typedef long long ll;
#define db(x) cerr << #x << ": " << x << '\n';
#define read(a) int a; cin >> a;
#define readb(a, b) int a, b; cin >> a >> b;
#define readc(a, b, c) int a, b, c; cin >> a >> b >> c;
#define readarr(a, n) int a[(n) + 1] = {}; FOR(i, 1, (n)) {cin >> a[i];}
#define readmat(a, n, m) int a[n + 1][m + 1] = {}; FOR(i, 1, n) {FOR(j, 1, m) cin >> a[i][j];}

#define print(a) cout << a << endl;
#define printarr(a, n) FOR (i, 1, n) cout << a[i] << " "; cout << endl;
#define printv(v) for (int i: v) cout << i << " "; cout << endl;
#define printmat(a, n, m) FOR (i, 1, n) {FOR (j, 1, m) cout << a[i][j] << " "; cout << endl;}
#define all(v) v.begin(), v.end()
#define sz(v) (int)(v.size())
#define rz(v, n) v.resize((n) + 1);
#define ld long double
#define pb push_back
#define fi first
#define se second
#define vi vector <int>
#define pi pair <int, int>
#define vpi vector <pi>
#define vvi vector <vi>
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
const ll inf = 1e18;
const ll mod = 1e9 + 7;
const ll N = 2e5 + 1;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	int po[N + 1];
	po[0] = 1;
	FOR (i, 1, N) po[i] = po[i - 1]*2 % mod;
	
	read(n);
	int cnt = 1, x = 0, y = 0, z = 0;
	
	map <ld, int> mp;
	FOR (i, 1, n)
	{
	    ld a, b;
	    cin >> a >> b;
	    
	    if (a == 0 || b == 0)
	    {
	        if (a == 0 && b == 0) x++;
	        else if (a == 0 && b != 0) y++;
	        else z++;
	    }
	    
	    else mp[a/b]++;
	}
	
	for (auto i: mp)
	{
	    int x = mp[(-1.00)/(ld)(i.fi)];
	    if (i.fi < 0)
	    {
	        if (x) continue;
	        else cnt = cnt*po[i.se] % mod;
	    }
	    
	    else if (i.se) cnt = cnt*(po[i.se] + po[x] - 1) % mod;
	}
	
	cnt = cnt*(po[y] + po[z] - 1) % mod;
	cnt = (((cnt + x - 1) % mod) + mod) % mod;
	if (x != n) print(cnt);
	else cout << n;
}



















Compiler output:
a.cc: In function 'int main()':
a.cc:79:9: error: 'else' without a previous 'if'
   79 |         else cout << n;
      |         ^~~~
Language: C++

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

int main(){
  int n;
  vector<vector<int>> data(n,vector<int>(2));
  for(int i=0;i<n;i++){
    for(int j=0;j<2;j++)
      cin >> data.at(i).at(j);
  }
  
  for(int i=0;i<n-1;i++){
    for(int j=i+1;j<n;j++){
      if(data.at(i).at(0)*data.at(j).at(0)+data.at(i).at(1)*data.at(j).at(1)){
        

Compiler output:
a.cc: In function 'int main()':
a.cc:14:79: error: expected '}' at end of input
   14 |       if(data.at(i).at(0)*data.at(j).at(0)+data.at(i).at(1)*data.at(j).at(1)){
      |                                                                              ~^
a.cc:14:79: error: expected '}' at end of input
a.cc:13:27: note: to match this '{'
   13 |     for(int j=i+1;j<n;j++){
      |                           ^
a.cc:14:79: error: expected '}' at end of input
   14 |       if(data.at(i).at(0)*data.at(j).at(0)+data.at(i).at(1)*data.at(j).at(1)){
      |                                                                               ^
a.cc:12:25: note: to match this '{'
   12 |   for(int i=0;i<n-1;i++){
      |                         ^
a.cc:14:79: error: expected '}' at end of input
   14 |       if(data.at(i).at(0)*data.at(j).at(0)+data.at(i).at(1)*data.at(j).at(1)){
      |                                                                               ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

const long long mod = 1000000007;

constexpr long long power(long long b, long long e, long long mod){
  long long ret = 1;
  while(e){
    if(e & 1){
      ret *= b;
      ret %= mod;
    }

    b *= b;
    b %= mod;
    e >>= 1;
  }

  return ret;
}

constexpr long long power(long long b, long long e){
  return power(b, e, mod);
}

int main(){
  int N;
  cin >> N;
  
  vector<pair<long long, long long>> iwashi(N);
  map<pair<long long, long long>, long long> m;
  for(int i = 0; i < N; i++){
    cin >> iwashi[i].first >> iwashi[i].second;
    long long g = gcd(iwashi[i].first, iwashi[i].second);
    iwashi[i].first /= g;
    iwashi[i].second /= g;
    if(iwashi[i].first == 0 && iwashi[i].second == 0){
      //Oh...
    }else if(iwashi[i].first == 0) iwashi[i].second = -1;
    else if(iwashi[i].second == 0) iwashi[i].first = 1;
    
    if(iwashi[i].first < 0){
      iwashi[i].first = -iwashi[i].first;
      iwashi[i].second = -iwashi[i].second;
    }
    
    ++m[iwashi[i]];
  }
  
  long long box = 1;
  if(m.count(make_pair(0, 0)) box = 0;
  
  for(auto[p, c] : m){
    long long a = p.first, b = p.second;
    long long t;
    if(b < 0){
      t = m.count(make_pair(-b, a));
      if(t > 0) continue;
    }else{
      t = m.count(make_pair(b, -a));
    }
    
    box *= (power(2ll, c) + power(2ll, t) - 1) % mod;
    box %= mod;
  }
  
  box -= 1ll;
  box %= mod;
  if(box < 0) box += mod;
  cout << box << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:30: error: expected ';' before 'box'
   52 |   if(m.count(make_pair(0, 0)) box = 0;
      |                              ^~~~
      |                              ;
a.cc:54:3: error: expected primary-expression before 'for'
   54 |   for(auto[p, c] : m){
      |   ^~~
a.cc:52:39: error: expected ')' before 'for'
   52 |   if(m.count(make_pair(0, 0)) box = 0;
      |     ~                                 ^
      |                                       )
   53 | 
   54 |   for(auto[p, c] : m){
      |   ~~~
Language: C

#include <stdio.h>

typedef long long ll;

ll dfs(int i, int n, ll count, double c[]) {
  if(i == n) {
    return count + 1;
  }
  ll ret = 0;
  for(int j = i + 1;j <= n;j++) {
    if(c[i] + 1/c[j] != 0) {
      	
	    ret += dfs(j, n, count+1, c);
    }
  }
  return ret;
}

int main(void) {
  int n;
  ll a[200001] = {0};
  ll b[200001] = {0};
  double c[200001] = {0};
  scanf("%d", &n);
  for(int i = 0;i < n;i++) {
    scanf("%lld %lld", a + i, b + i);
    c[i] = (double)a / b;
  }
  ll ret = n;
  ret += dfs(2, n, ret, c);
  
  printf("%lld\n", ret % (1000000007));
  return 0;
}
  	  


Compiler output:
main.c: In function 'main':
main.c:27:5: error: pointer value used where a floating-point was expected
   27 |     c[i] = (double)a / b;
      |     ^
Language: C++

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

int main(){
long long n,c;
  c=0;
  vector<long long> a(n);
  vector<long long> b(n);
  for(int i=0;i<n;i++){
cin>>a.at(i)>>b.at(i);
  }
for(int i=0;i<n-1;i++){
for(int j=i+1;j<n;j++){
  if(a.at(i)*a.at(j)+b.at(i)*b.at(j)!=0){
    c++;
  }
}
  cout<<c%1000000007<<endl;
}

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

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

int main(){
  int n;
  cin>>n;
  vector<int> &a(n),&b(n);
  for(int i=0;i<n;i++){
    cin>>a.at(i)>>b.at(i);
  }
  
  int count=0;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      if(a.at(i)*a.at(j)+b.at(i)*b.at(j)!=0&&i<=j)
        count++;
    }
  }
    cout<<count%1000000007<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'int'
    7 |   vector<int> &a(n),&b(n);
      |                  ^
a.cc:7:24: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'int'
    7 |   vector<int> &a(n),&b(n);
      |                        ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
int main(){
  int n;
  cin >> n ;
  long long a[n], b[n];
  
  for(int i = 0; i < n ; i++){
    cin >> a[i] >> b[i];
  }
  int sum = 0;
  for(int i = 0; i < n; i ++){
    for(int j = i+1 ; j < n; j++){
      if(a[i]*a[j]+b[i][j] == 0) sum++;
    }
  }
  
  
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: invalid types 'long long int[int]' for array subscript
   15 |       if(a[i]*a[j]+b[i][j] == 0) sum++;
      |                        ^
Language: C++

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

int main() {
  int not_ans=0;
  int N;
  cin>>N;
  vector<int> A(N);
  vector<int> B(N);
  for(int k=0;k<N;k++){
    cin>>A.at(k);
    cin>>B.at(k);
  }
  for(int i=0;i<N-1;i++){
    for(int j=i+1;j<N;j++){
      if(A.at(i)*A.at(j)+B.at(i)*B.at(j)==0){
        not_ans++
      }
    }
  }
  int U=N*(N-1)/2;
  cout<<(U-not_ans)%1000000007<<endl;
}
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:18: error: expected ';' before '}' token
   17 |         not_ans++
      |                  ^
      |                  ;
   18 |       }
      |       ~           
a.cc: At global scope:
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define MOD 1000000007
#define ABS(a) ((a) < 0 ? -(a) : (a))
#define pii pair<long long, long long>
using namespace std;

int N;
map<pii, int> slope;
set<pii> vis;
int cntzer1, cntzer2;
int memo[5005][5005];

long long GCD(long long A, long long B) {
  return B == 0 ? A : GCD(B, A % B);
}

long long POW(long long X, long long Y) {
  long long res = 1;
  while(Y) {
    if(Y & 1) res = res * X % MOD;
    X = X * X % MOD;
    Y >>= 1;
  }
  return res;
}

void frac(long long A, long long B) {
  long long gcd = GCD(ABS(A), ABS(B));
  slope[make_pair(A / gcd, B / gcd)]++;
}

int main() {
  ios_base::sync_with_stdio(0);
  cin >> N;
  long long A, B;
  for(int i = 1; i <= N; i++) {
    cin >> A >> B;
    if((A == 0) && (B == 0)) continue;
    if(A == 0) {
      cntzer1++;
    }else if(B == 0) {
      cntzer2++;
    }else frac(A, B);
  }
  long long ans = 1; 
  while(!slope.empty()) {
    long long x = slope.begin()->first, y = slope.begin().second;
    long long val1 = 0, val2 = 0;
    val1 += slope.begin()->second;
    if(slope.count(make_pair(y, -x))) {
      val2 += slope[make_pair(y, -x)];
      slope.erase(make_pair(y, -x));
    }
    if(slope.count(make_pair(-y, x))) {
      val2 += slope[make_pair(-y, x)];
      slope.erase(make_pair(-y, x));
    }
    if(slope.count(make_pair(-x, -y))) {
      val1 += slope[make_pair(-x, -y)];
      slope.erase(make_pair(-x, -y));
    }
    ans = ans * (POW(2, val1) + POW(2, val2) - 1) % MOD;
  }
  ans = ans * (POW(2, cntzer1) + POW(2, cntzer2) - 1) % MOD;
  cout << ans - 1 << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:34: error: cannot convert 'const std::pair<long long int, long long int>' to 'long long int' in initialization
   47 |     long long x = slope.begin()->first, y = slope.begin().second;
      |                   ~~~~~~~~~~~~~~~^~~~~
      |                                  |
      |                                  const std::pair<long long int, long long int>
a.cc:47:59: error: 'std::map<std::pair<long long int, long long int>, int>::iterator' {aka 'std::_Rb_tree<std::pair<long long int, long long int>, std::pair<const std::pair<long long int, long long int>, int>, std::_Select1st<std::pair<const std::pair<long long int, long long int>, int> >, std::less<std::pair<long long int, long long int> >, std::allocator<std::pair<const std::pair<long long int, long long int>, int> > >::iterator'} has no member named 'second'
   47 |     long long x = slope.begin()->first, y = slope.begin().second;
      |                                                           ^~~~~~
Language: C++

#include <bits/stdc++.h>
#include "../lib/math/modpow.hpp"

using namespace std;

#define SZ(x) (int)(x.size())
#define REP(i, n) for(int i=0;i<(n);++i)
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RREP(i, n) for(int i=(int)(n);i>=0;--i)
#define RFOR(i, a, b) for(int i=(int)(a);i>=(int)(b);--i)
#define ALL(a) (a).begin(),(a).end()
#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<< endl;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<int, int>;

const double eps = 1e-8;
const ll MOD = 1000000007;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;

template <typename T1, typename T2>
bool chmax(T1 &a, const T2 &b) {
  if(a < b) {a = b; return true;}
  return false;
}

template <typename T1, typename T2>
bool chmin(T1 &a, const T2 &b) {
  if(a > b) {a = b; return true;}
  return false;
}

template<typename T1, typename T2>
ostream& operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}

template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  REP(i, SZ(v)) {
    if(i) os << " ";
    os << v[i];
  }
  return os;
}

using ld = long double;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  int n; cin >> n;
  map<pair<ll, ll>, ll> mp;
  ll zero = 0;
  REP(i, n) {
    ll a, b; cin >> a >> b;
    if(a == 0 || b == 0) {
      zero++;
      continue;
    }
    if(a < 0) {
      a = -a;
      b = -b;
    }


    ll g = gcd(abs(a), abs(b));
    a /= g;
    b /= g;
    mp[{a, b}]++;
  }

  ll ans = zero + 1;
  ans %= MOD;

  map<pair<ll, ll>, bool> sel;
  for(auto &e: mp) {
    if(abs(e.first.first) > abs(e.first.second)) continue;
    if(e.first.first == 1 && e.first.second == 1) continue;
    sel[e.first] = true;
    pair<ll, ll> b = {e.first.second, -e.first.first};
    if(b.first < 0) {
      b.first = -b.first;
      b.second = -b.second;
    }
    sel[b] = true;
    ll now = 0;


    now += mod_pow<ll>(2, e.second, MOD);
    now %= MOD;
    now += mod_pow<ll>(2, mp[b], MOD);
    now %= MOD;
    now += MOD - 1;
    now %= MOD;
    ans *= now;
    ans %= MOD;
  }

  for(auto &e: mp) {
    if(!sel[e.first]) {
      sel[e.first] = true;
      ans *= mod_pow<ll>(2, e.second, MOD);
      ans %= MOD;
    }
  }

  cout << (ans + MOD - 1) % MOD << endl;
}
























Compiler output:
a.cc:2:10: fatal error: ../lib/math/modpow.hpp: No such file or directory
    2 | #include "../lib/math/modpow.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main(){
  int n;
  cin>>n;
  vector<int> a(n),b(n)
  for(int i=0;i<n;i++){
    cin>>a.at(i)>>b.at(i)
  }
  
  int count=0;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;i++){
      if(a.at(i)*a.at(j)+b.at(i)*b.at(j)!=0)
        count++;
    }
  }
    cout<<count%1000000007<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'for'
    8 |   for(int i=0;i<n;i++){
      |   ^~~
a.cc:8:15: error: 'i' was not declared in this scope
    8 |   for(int i=0;i<n;i++){
      |               ^
Language: C++

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

int main(){
  int n;
  cin>>n;
  vector<int> a(n),b(n);
  for(int i=0;i<n;i++){
    cin>>a.at(i)>>b.at(i);
  }
  
  int count==0;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;i++){
      if(a.at(i)*a.at(j)+b.at(i)*b.at(j)!=0)
        count++;
    }
  }
    cout<<count%1000000007<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: expected initializer before '==' token
   12 |   int count==0;
      |            ^~
a.cc:16:14: error: no post-increment operator for type
   16 |         count++;
      |              ^~
a.cc:19:16: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator%'
   19 |     cout<<count%1000000007<<endl;
      |           ~~~~~^~~~~~~~~~~
Language: C++

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

int main(){
  int n;
  cin>>n;
  vector<int> a(n),b(n)
  for(int i=0;i<n;i++){
    cin>>a.at(i)>>b.at(i)
  }
  
  int count==0;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;i++){
      if(a.at(i)*a.at(j)+b.at(i)*b.at(j)!=0)
        count++;
    }
  }
    cout<<count%1000000007<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'for'
    8 |   for(int i=0;i<n;i++){
      |   ^~~
a.cc:8:15: error: 'i' was not declared in this scope
    8 |   for(int i=0;i<n;i++){
      |               ^
a.cc:12:12: error: expected initializer before '==' token
   12 |   int count==0;
      |            ^~
a.cc:16:14: error: no post-increment operator for type
   16 |         count++;
      |              ^~
a.cc:19:16: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator%'
   19 |     cout<<count%1000000007<<endl;
      |           ~~~~~^~~~~~~~~~~
Language: C++

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

int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    vector<int> a(i);
  }
  
  int count==0;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;i++){
      if(a(i).at(0)*a(j).at(0)+a(i).at(1)*a(j).at(1)!=0)
        count++;
    }

  }
    cout<<count%1000000007<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: expected initializer before '==' token
   11 |   int count==0;
      |            ^~
a.cc:14:10: error: 'a' was not declared in this scope
   14 |       if(a(i).at(0)*a(j).at(0)+a(i).at(1)*a(j).at(1)!=0)
      |          ^
a.cc:15:14: error: no post-increment operator for type
   15 |         count++;
      |              ^~
a.cc:19:16: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator%'
   19 |     cout<<count%1000000007<<endl;
      |           ~~~~~^~~~~~~~~~~
Language: C++

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

int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    int a(i),b(i);
    cin>>a(i)>>b(i);
  }
  
  int count==0;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;i++){
      if(a(i)*a(j)+b(i)*b(j)!=0)
        count++;
    }

  }
    cout<<count%1000000007<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: 'a' cannot be used as a function
    9 |     cin>>a(i)>>b(i);
      |          ~^~~
a.cc:9:17: error: 'b' cannot be used as a function
    9 |     cin>>a(i)>>b(i);
      |                ~^~~
a.cc:12:12: error: expected initializer before '==' token
   12 |   int count==0;
      |            ^~
a.cc:15:10: error: 'a' was not declared in this scope
   15 |       if(a(i)*a(j)+b(i)*b(j)!=0)
      |          ^
a.cc:15:20: error: 'b' was not declared in this scope
   15 |       if(a(i)*a(j)+b(i)*b(j)!=0)
      |                    ^
a.cc:16:14: error: no post-increment operator for type
   16 |         count++;
      |              ^~
a.cc:20:16: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator%'
   20 |     cout<<count%1000000007<<endl;
      |           ~~~~~^~~~~~~~~~~
Language: C++

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

int main(){
  int n;
  cin>>n;
  for(i=0;i<n;i++){
    int a(i),b(i);
    cin>>a(i)>>b(i);
  }
  
  int count==0;
  for(i=0;i<n;i++){
    for(j=0;j<n;i++){
      if(a(i)*a(j)+b(i)*b(j)!=0)
        count++;
    }

  }
    cout<<count%1000000007<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   for(i=0;i<n;i++){
      |       ^
a.cc:9:11: error: 'a' cannot be used as a function
    9 |     cin>>a(i)>>b(i);
      |          ~^~~
a.cc:9:17: error: 'b' cannot be used as a function
    9 |     cin>>a(i)>>b(i);
      |                ~^~~
a.cc:12:12: error: expected initializer before '==' token
   12 |   int count==0;
      |            ^~
a.cc:13:7: error: 'i' was not declared in this scope
   13 |   for(i=0;i<n;i++){
      |       ^
a.cc:14:9: error: 'j' was not declared in this scope
   14 |     for(j=0;j<n;i++){
      |         ^
a.cc:15:10: error: 'a' was not declared in this scope
   15 |       if(a(i)*a(j)+b(i)*b(j)!=0)
      |          ^
a.cc:15:20: error: 'b' was not declared in this scope
   15 |       if(a(i)*a(j)+b(i)*b(j)!=0)
      |                    ^
a.cc:16:14: error: no post-increment operator for type
   16 |         count++;
      |              ^~
a.cc:20:16: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator%'
   20 |     cout<<count%1000000007<<endl;
      |           ~~~~~^~~~~~~~~~~
Language: C++

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

int main(){
  int n;
  cin>>n;
  for(i=0;i<n;i++){
    int a(i),b(i);
    cin>>a(i)>>b(i);
  }
  
  int count==0;
  for(i=0;i<n;i++){
    for(j=0;j<n;i++){
      if(a(i)*a(j)+b(i)*b(j)!=0)
        count++;
    }

  }
    cout<<count%1000000007<<endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>n;
      |   ^~~
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   for(i=0;i<n;i++){
      |       ^
a.cc:9:11: error: 'a' cannot be used as a function
    9 |     cin>>a(i)>>b(i);
      |          ~^~~
a.cc:9:17: error: 'b' cannot be used as a function
    9 |     cin>>a(i)>>b(i);
      |                ~^~~
a.cc:12:12: error: expected initializer before '==' token
   12 |   int count==0;
      |            ^~
a.cc:13:7: error: 'i' was not declared in this scope
   13 |   for(i=0;i<n;i++){
      |       ^
a.cc:14:9: error: 'j' was not declared in this scope
   14 |     for(j=0;j<n;i++){
      |         ^
a.cc:15:10: error: 'a' was not declared in this scope
   15 |       if(a(i)*a(j)+b(i)*b(j)!=0)
      |          ^
a.cc:15:20: error: 'b' was not declared in this scope
   15 |       if(a(i)*a(j)+b(i)*b(j)!=0)
      |                    ^
a.cc:16:9: error: 'count' was not declared in this scope
   16 |         count++;
      |         ^~~~~
a.cc:20:5: error: 'cout' was not declared in this scope
   20 |     cout<<count%1000000007<<endl;
      |     ^~~~
a.cc:20:11: error: 'count' was not declared in this scope
   20 |     cout<<count%1000000007<<endl;
      |           ^~~~~
a.cc:20:29: error: 'endl' was not declared in this scope
   20 |     cout<<count%1000000007<<endl;
      |                             ^~~~
Language: C++

#include <bits/stdc++.h>
#include <climits>
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define srep(i, begin, end) for (__typeof(end) i = begin; i != end; i++)
#define si(x) int x = scanInt();
#define sll(x) LL x = scanLong();
#define sci(x) int x; scanf("%d", &x);
#define scll(x) LL x; scanf("%lld", &x);
#define pi(x) printf("%d ", x)
#define pll(x) printf("%lld ", x)
#define nl printf("\n")
#define clr(a) memset(a, 0, sizeof(a))
#define PB push_back
#define MP make_pair
using namespace std;
typedef unsigned int UI; // 32 bit integer
typedef long int LI; // 32 bit integer
typedef unsigned long int ULI; // 32 bit unsigned integer
typedef long long int LL; // 64 bit integer
typedef unsigned long long int ULL; // 64 bit unsigned integer
typedef long double LD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef deque<int> DI;
typedef deque<LL> DLL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
const LL MOD = 1e9+7;

/* Fast I/O */
inline int scanInt() {
	int n = 0;
	char ch = getchar();
	int sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(int)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

inline LL scanLong() {
	LL n = 0;
	char ch = getchar();
	LL sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(LL)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

LL gcd(LL a, LL b) {
	if(a == 0) 	return b;
	return gcd(b%a, a);
}

PLL conjugate(PLL p) {
	PLL res = make_pair(-p.second, p.first);
	if(res.second < 0) {
		res.first = -res.first;
		res.second = -res.second;
	}
	return res;
}

LL modpow(LL a, LL n, LL m) {
	LL res = 1;
	while(n != 0) {
		if(n%2 == 1)	res = (res*a)%m;
		a = (a*a) % m;
		n >>= 1;
	}
	return res;
}

int main() {
	sll(n);
	map<PLL, LL> counts;
	LL total = 0;
	LL azero = 0, bzero = 0, abzero = 0;
	rep(i, 0, n) {
		sll(a); sll(b);
		if(a == 0 && b == 0)	abzero++;
		else if(a == 0)	azero++;
		else if(b == 0)	bzero++;
		else {
			if(b < 0) {
				a = -a;
				b = -b;
			}
			LL g = gcd(abs(a), abs(b));
			PLL p = make_pair(a/g, b/g);
			counts[p]++;
			total++;
		}
	}

	LL ans = 1;
	for(auto it : counts) {
		PLL p = it.first;
		PLL cp = conjugate(p);
		ans *= ((modpow(2ll, counts[p], MOD) + modpow(2ll, counts[cp], MOD) - 1 + MOD)%MOD);
		ans %= MOD;
		counts[p] = counts[cp] = 0;
	}
	ans *= ((modpow(2ll, azero, MOD) + modpow(2ll, bzero, MOD) - 1 + MOD) % MOD);
	ans %= MOD;
	ans = (ans - 1 + MOD) % MOD // remove empty set
	pll(ans); nl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:117:36: error: expected ';' before 'printf'
  117 |         ans = (ans - 1 + MOD) % MOD // remove empty set
      |                                    ^
      |                                    ;
Language: C++

#include <bits/stdc++.h>
#include "../lib/math/modpow.hpp"

using namespace std;

#define SZ(x) (int)(x.size())
#define REP(i, n) for(int i=0;i<(n);++i)
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RREP(i, n) for(int i=(int)(n);i>=0;--i)
#define RFOR(i, a, b) for(int i=(int)(a);i>=(int)(b);--i)
#define ALL(a) (a).begin(),(a).end()
#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<< endl;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<int, int>;

const double eps = 1e-8;
const ll MOD = 1000000007;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;

template <typename T1, typename T2>
bool chmax(T1 &a, const T2 &b) {
  if(a < b) {a = b; return true;}
  return false;
}

template <typename T1, typename T2>
bool chmin(T1 &a, const T2 &b) {
  if(a > b) {a = b; return true;}
  return false;
}

template<typename T1, typename T2>
ostream& operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}

template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  REP(i, SZ(v)) {
    if(i) os << " ";
    os << v[i];
  }
  return os;
}

using ld = long double;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  int n; cin >> n;
  map<pair<ll, ll>, ll> mp;
  REP(i, n) {
    ll a, b; cin >> a >> b;
    if(a < 0) {
      a = -a;
      b = -b;
    }

    if(a == 0 || b == 0) {
      mp[{0, 0}]++;
      continue;
    }

    ll g = __gcd(abs(a), abs(b));
    a /= g;
    b /= g;
    mp[{a, b}]++;
  }

  ll ans = mp[{0, 0}]+1;
  ans %= MOD;

  map<pair<ll, ll>, bool> sel;
  for(auto &e: mp) {
    if(abs(e.first.first) > abs(e.first.second)) continue;
    if(e.first.first == 1 && e.first.second == -1) continue;
    if(e.first.first == 0 && e.first.second == 0) continue;
    sel[e.first] = true;
    P b = {e.first.second, -e.first.first};
    if(b.first < 0) {
      b.first = -b.first;
      b.second = -b.second;
    }
    sel[b] = true;
    ll now = 0;

    now += mod_pow<ll>(2, e.second, MOD);
    now %= MOD;
    now += mod_pow<ll>(2, mp[b], MOD);
    now %= MOD;
    now += MOD - 1;
    now %= MOD;
    ans *= now;
    ans %= MOD;
  }

  for(auto &e: mp) {
    if(!sel[e.first]) {
      if(e.first.first == 0 && e.first.second == 0) continue;
      ans *= mod_pow<ll>(2, e.second, MOD);
      ans %= MOD;
    }
  }


  cout << (ans + MOD - 1) % MOD << endl;
}
























Compiler output:
a.cc:2:10: fatal error: ../lib/math/modpow.hpp: No such file or directory
    2 | #include "../lib/math/modpow.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
using UL=unsigned int;
using LL=long long;
using ULL=unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)

struct Line{
 LL l,r,x;
 bool operator<(const Line& r)const{ return x < r.x; }
};

int H,W;
LL X[999], Y[999];
LL Xp[1000], Yp[1000];

Line HL[1000];
Line VL[1000];

int G[2001][2001];

int main(){
 scanf("%d%d",&W,&H);
 rep(i,W) scanf("%lld%lld%lld",&VL[i].l,&VL[i].r,&VL[i].x);
 rep(i,H) scanf("%lld%lld%lld",&HL[i].x,&HL[i].l,&HL[i].r);
 sort(HL,HL+H);
 sort(VL,VL+W);

 rep(i,H-1) Y[i] = HL[i+1].x - HL[i].x;
 rep(i,H) Yp[i] = HL[i].x;
 rep(i,W-1) X[i] = VL[i+1].x - VL[i].x;
 rep(i,W) Xp[i] = VL[i].x;

 rep(y,H*2+1)rep(x,W*2+1){
  G[x][y] = 0;
  if(y&x&1) G[x][y] = -1;
 }
 rep(y,H)rep(x,W-1){
  if(HL[y].l <= Xp[x] && Xp[x+1] <= HL[y].r)
   G[x*2+2][y*2+1] = -1;
  if(Xp[x] == Xp[x+1]) G[x*2+2][y*2+1] = -1;
 }
 rep(x,W)rep(y,H-1){
  if(VL[x].l <= Yp[y] && Yp[y+1] <= VL[x].r)
   G[x*2+1][y*2+2] = -1;
  if(Yp[y] == Yp[y+1]) G[x*2+1][y*2+2] = -1;
 }

 int sx=0,sy=0;
 rep(x,W-1) if(Xp[x]<=0 && 0<=Xp[x+1]) sx = x*2+2;
 if(Xp[W-1]<0) sx = W*2;
 rep(y,H-1) if(Yp[y]<=0 && 0<=Yp[y+1]) sy = y*2+2;
 if(Yp[H-1]<0) sy = H*2;

 queue<pair<int,int>> Q;
 Q.push({sx,sy});
 while(Q.size()){
  int px = Q.front().first;
  int py = Q.front().second; Q.pop();
  if(G[px][py]) continue;
  G[px][py] = 1;
  Q.push({px-1,py});
  Q.push({px+1,py});
  Q.push({px,py-1});
  Q.push({px,py+1});

  if(px==0 || py==0 || px==W*2 || py==H*2){
   cout<<"INF"<<endl; return;
  }
 }

 LL ans = 0;
 rep(x,W-1) rep(y,H-1){
  if(G[x*2+2][y*2+2] == 1) ans += X[x]*Y[y];
 }

 cout<<ans<<endl;

 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:68:23: error: return-statement with no value, in function returning 'int' [-fpermissive]
   68 |    cout<<"INF"<<endl; return;
      |                       ^~~~~~
Language: C++

#include<bits/stdc++.h>
typedef long long ll;
#define rep(i, n) for (int i=0; i < n; i++)
#define repran(i, a,b) for (int i = a; i<b;i++)
#define repd(i, n) for (int i = n-1; i > -1; i--)
#define all(x) (x).begin(), (x).end()
using namespace std;
using LP = pair<ll,ll>;
using P = pair<int,int>;
const ll mod = 1e9+7;

struct L
{
    int a, b, c;
    L(int a = 0, int b = 0, int c = 0): a(a), b(b), c(c) {};
};

const dx[4] = {-1, 0, 1, 0};
const dy[4] = {0, 1, 0, -1};

int main()
{
    int n, m;
    cin >> n >> m;
    map<int, int> mpX, mpY;
    mpX[0] = 0;
    mpY[0] = 0;
    vector<L> lh, lv;
    rep(i, n){
        int a, b, c;
        cin >> a >> b >> c;
        mpX[a] = 0;
        mpX[b] = 0;
        mpY[c] = 0;
        lh.emplace_back(a,b,c);
    }
    rep(i, m){
        int a, b, c;
        cin >> c >> a >> b;
        mpY[a] = 0;
        mpY[b] = 0;
        mpX[c] = 0;
        lv.emplace_back(a,b,c);
    }
    vector<int> xs, ys;
    for (auto& p : mpX){
        p.second = xs.size();
        xs.push_back(p.first);
    }
    for (auto& p : mpY){
        p.second =ys.size();
        ys.push_back(p.first);
    }

    int h = 2*xs.size();
    int w = 2*ys.size();
    vector<vector<int>> d(h, vector<int>(w, 0));
    rep(i, n){
        int a = mpX[lh[i].a]*2;
        int b = mpX[lh[i].b]*2;
        int c = mpY[lh[i].c]*2;
        repran(x, a, b+1) d[x][c] = -1;
    }
    rep(i, m){
        int a = mpY[lv[i].a]*2;
        int b = mpY[lv[i].b]*2;
        int c = mpX[lv[i].c]*2;
        repran(y, a, b+1) d[c][y] = -1;
    }
    queue<P> q;
    int sx = mpX[0]*2;
    int sy = mpY[0]*2;
    q.emplace(sx, sy);
    d[sx][sy] = 1;
    while (!q.empty())
    {
        int x = q.front().first; 
        int y = q.front().second;
        q.pop();
        rep(v, 4){
            int nx = x+dx[v]; 
            int ny = y+dy[v]; 
            if (nx<0 or nx>=h or ny<0 or ny>=w) continue;
            if (d[nx][ny] != 0 ) continue;
            d[nx][ny] = 1;
            q.emplace(nx, ny);
        }
    }
    ll ans = 0;
    rep(i, h) rep(j, w){
        if (d[i][j] != 1) continue;
        if (i==0 or i == h-1 or j == 0 or j == w-1){
            cout << "INF" << endl;
            return 0;
        }
        if (i%2 == 0 or j%2 == 0) continue;
        ll tmp = (xs[i/2+1]-xs[i/2])*(ys[j/2+1]-ys[j/2]);
        ans += tmp;
    }   
    cout << ans << endl;
    return 0;    
}

Compiler output:
a.cc:18:7: error: 'dx' does not name a type
   18 | const dx[4] = {-1, 0, 1, 0};
      |       ^~
a.cc:19:7: error: 'dy' does not name a type
   19 | const dy[4] = {0, 1, 0, -1};
      |       ^~
a.cc: In function 'int main()':
a.cc:81:24: error: 'dx' was not declared in this scope; did you mean 'nx'?
   81 |             int nx = x+dx[v];
      |                        ^~
      |                        nx
a.cc:82:24: error: 'dy' was not declared in this scope; did you mean 'ny'?
   82 |             int ny = y+dy[v];
      |                        ^~
      |                        ny
Language: C++

#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <map>
#include <list>
#include <set>
#include <numeric>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <climits>
#include <cfloat>
#include <ctime>
#include <complex>
#include <cassert>
#include <array>
#include <bitset> 
#include <unordered_map>
#include <random>
using namespace std;
typedef long long LL;
typedef pair<LL,LL> P;



vector<int> A;
vector<int> B;
vector<int> C;
vector<int> D;
vector<int> E;
vector<int> F;
vector<LL> xs;
vector<LL> ys;
int st[6001][6001];
bool isInf=false;
LL ret=0;
void f(int p, int q)
{
	if(st[p][q]&16)
	{
		return;
	}
	st[p][q]|=16;
	//cerr << p << ", " << q << endl;
	if(p==0||q==0||p==xs.size()||q==ys.size())
	{
		isInf=true;
		return 0;
	}
  	ret+=(xs[p]-xs[p-1])*(ys[q]-ys[q-1]);
	
	if(!(st[p][q]&1))
	{
		f(p,q+1);
	}
	if(!(st[p][q]&2))
	{
		f(p+1,q);
	}
	if(!(st[p][q]&4))
	{
		f(p,q-1);
	}
	if(!(st[p][q]&8))
	{
		f(p-1,q);
	}
}
int main(){
	int N,M;
	cin >> N >> M;
	for(int i=0;i<N;i++){
		int a,b,c;
		cin >> a >> b >> c;
		A.push_back(a);
		B.push_back(b);
		C.push_back(c);
		xs.push_back(a);
		xs.push_back(b);
		ys.push_back(c);
	}
	for(int i=0;i<M;i++){
		int a,b,c;
		cin >> a >> b >> c;
		D.push_back(a);
		E.push_back(b);
		F.push_back(c);
		xs.push_back(a);
		ys.push_back(b);
		ys.push_back(c);
	}
	sort(xs.begin(),xs.end());
	xs.resize(unique(xs.begin(),xs.end())-xs.begin());
	sort(ys.begin(),ys.end());
	ys.resize(unique(ys.begin(),ys.end())-ys.begin());
	for(int i=0;i<N;i++){
		int q=lower_bound(ys.begin(),ys.end(),C[i])-ys.begin();
		int p=lower_bound(xs.begin(),xs.end(),min(A[i],B[i]))-xs.begin();
		while(xs[p]<max(A[i],B[i])){
			st[p+1][q]|=1;
			st[p+1][q+1]|=4;
			p++;
		}
	}
	for(int i=0;i<M;i++){
		int q=lower_bound(ys.begin(),ys.end(),min(E[i],F[i]))-ys.begin();
		int p=lower_bound(xs.begin(),xs.end(),D[i])-xs.begin();
		while(ys[q]<max(E[i],F[i])){
			st[p][q+1]|=2;
			st[p+1][q+1]|=8;
			q++;
		}
	}

	int u=lower_bound(xs.begin(),xs.end(),0)-xs.begin();
	int v=lower_bound(ys.begin(),ys.end(),0)-ys.begin();
	f(u,v);
	if(isInf)
	{
		cout << "INF" << endl;
		return 0;
	}
	cout << ret << endl;




    return 0;
}


Compiler output:
a.cc: In function 'void f(int, int)':
a.cc:54:24: error: return-statement with a value, in function returning 'void' [-fpermissive]
   54 |                 return 0;
      |                        ^
Language: C++

#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <map>
#include <list>
#include <set>
#include <numeric>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <climits>
#include <cfloat>
#include <ctime>
#include <complex>
#include <cassert>
#include <array>
#include <bitset> 
#include <unordered_map>
#include <random>
using namespace std;
typedef long long LL;
typedef pair<LL,LL> P;



vector<int> A;
vector<int> B;
vector<int> C;
vector<int> D;
vector<int> E;
vector<int> F;
vector<LL> xs;
vector<LL> ys;
int st[6001][6001];
bool isInf=false;
LL ret=0;
void f(int p, int q)
{
	if(st[p][q]&16)
	{
		return;
	}
	st[p][q]|=16;
	//cerr << p << ", " << q << endl;
	if(p==0||q==0||p==xs.size()||q==ys.size())
	{
		isInf=true;
		return 0;
	}
  	ret+=(xs[p]-xs[p-1])*(ys[q]-ys[q-1]);
	
	if(!(st[p][q]&1))
	{
		ret+=f(p,q+1);
	}
	if(!(st[p][q]&2))
	{
		ret+=f(p+1,q);
	}
	if(!(st[p][q]&4))
	{
		ret+=f(p,q-1);
	}
	if(!(st[p][q]&8))
	{
		ret+=f(p-1,q);
	}
}
int main(){
	int N,M;
	cin >> N >> M;
	for(int i=0;i<N;i++){
		int a,b,c;
		cin >> a >> b >> c;
		A.push_back(a);
		B.push_back(b);
		C.push_back(c);
		xs.push_back(a);
		xs.push_back(b);
		ys.push_back(c);
	}
	for(int i=0;i<M;i++){
		int a,b,c;
		cin >> a >> b >> c;
		D.push_back(a);
		E.push_back(b);
		F.push_back(c);
		xs.push_back(a);
		ys.push_back(b);
		ys.push_back(c);
	}
	sort(xs.begin(),xs.end());
	xs.resize(unique(xs.begin(),xs.end())-xs.begin());
	sort(ys.begin(),ys.end());
	ys.resize(unique(ys.begin(),ys.end())-ys.begin());
	for(int i=0;i<N;i++){
		int q=lower_bound(ys.begin(),ys.end(),C[i])-ys.begin();
		int p=lower_bound(xs.begin(),xs.end(),min(A[i],B[i]))-xs.begin();
		while(xs[p]<max(A[i],B[i])){
			st[p+1][q]|=1;
			st[p+1][q+1]|=4;
			p++;
		}
	}
	for(int i=0;i<M;i++){
		int q=lower_bound(ys.begin(),ys.end(),min(E[i],F[i]))-ys.begin();
		int p=lower_bound(xs.begin(),xs.end(),D[i])-xs.begin();
		while(ys[q]<max(E[i],F[i])){
			st[p][q+1]|=2;
			st[p+1][q+1]|=8;
			q++;
		}
	}

	int u=lower_bound(xs.begin(),xs.end(),0)-xs.begin();
	int v=lower_bound(ys.begin(),ys.end(),0)-ys.begin();
	f(u,v);
	if(isInf)
	{
		cout << "INF" << endl;
		return 0;
	}
	cout << ret << endl;




    return 0;
}


Compiler output:
a.cc: In function 'void f(int, int)':
a.cc:54:24: error: return-statement with a value, in function returning 'void' [-fpermissive]
   54 |                 return 0;
      |                        ^
a.cc:60:23: error: void value not ignored as it ought to be
   60 |                 ret+=f(p,q+1);
      |                      ~^~~~~~~
a.cc:64:23: error: void value not ignored as it ought to be
   64 |                 ret+=f(p+1,q);
      |                      ~^~~~~~~
a.cc:68:23: error: void value not ignored as it ought to be
   68 |                 ret+=f(p,q-1);
      |                      ~^~~~~~~
a.cc:72:23: error: void value not ignored as it ought to be
   72 |                 ret+=f(p-1,q);
      |                      ~^~~~~~~
Language: Java

from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, acos, asin, atan, sqrt, tan, cos, pi
from operator import mul
from functools import reduce
from pprint import pprint


sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7


n, m = LI()
hor = []
ver = []
x_co = {-INF, INF}
y_co = {-INF, INF}
for _ in range(n):
    a, b, c = LI()
    x_co.add(a)
    x_co.add(b)
    y_co.add(c)
    ver += [(a, b, c)]

for _ in range(m):
    d, e, f = LI()
    x_co.add(d)
    y_co.add(e)
    y_co.add(f)
    hor += [(d, e, f)]


x_co = sorted(x_co)
y_co = sorted(y_co)
XD = {val:i for i,val in enumerate(x_co)}
YD = {val:i for i,val in enumerate(y_co)}
x_len = len(x_co) * 2 - 1
y_len = len(y_co) * 2 - 1
grid = [[0] * y_len for _ in range(x_len)]
x_range = [0] * x_len
y_range = [0] * y_len
x_range[0] = x_range[-1] = y_range[0] = y_range[-1] = INF
for i in range(len(x_co) - 1):
    x_range[i * 2 + 1] = x_co[i + 1] - x_co[i]
    if x_co[i] <= 0 <= x_co[i + 1]:
        sx = i * 2 + 1

for j in range(len(y_co) - 1):
    y_range[j * 2 + 1] = x_co[j + 1] - y_co[j]
    if y_co[j] <= 0 <= y_co[j + 1]:
        sy = j * 2 + 1

for a, b, c in ver:
    yi = YD[c] * 2
    for xi in range(XD[a] * 2,  XD[b] * 2 + 1):
        grid[xi][yi] = 1


for d, e, f in hor:
    xi = XD[d] * 2
    for yi in range(YD[e] * 2,  YD[f] * 2 + 1):
        grid[xi][yi] = 1

ans = 0
ans += x_range[sx] * y_range[sy]
q = deque([(sx, sy)])
while q:
    cx, cy = q.popleft()
    for dx, dy in ((1, 0), (0, 1), (-1, 0), (0, -1)):
        nx, ny = cx + dx, cy + dy
        if grid[nx][ny]:
            continue
        nx += dx
        ny += dy
        if grid[nx][ny]:
            continue
        grid[nx][ny] = 1
        q += [(nx, ny)]
        ans += x_range[nx] * y_range[ny]
        if ans >= INF:
            print("INF")
            exit()



print(ans)






Compiler output:
Main.java:1: error: class, interface, enum, or record expected
from collections import defaultdict, deque, Counter
^
1 error