criyle/codenet-compile-errors huggingface dataset:
Language: Java

import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.System.*;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

    static void solve() throws Exception {
        int N = scanInt(), M = scanInt();
        int[][] load = new int[N][N];
        int[] index = new int[N];
        int[] ans = new int[N];
        ans[0] = 1;
        int count = 0;
        for (int i = 0; i < M; i++) {
            int A = scanInt();
            int B = scanInt();
            load[A-1][index[A-1]] = B;
            load[B-1][index[B-1]] = A;
            index[A-1]++;
            index[B-1]++;
        }
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < index[i]; j++) {
                int tmp = load[i][j];
                if (ans[tmp-1] == 0) {
                    ans[tmp-1] = i+1;
                    count++;
                }
                if (count == N - 1) {
                    break;
                }
            }
            if (count == N - 1) {
                break;
            }
        }

        if (count == N - 1) {
            System.out.println("Yes");
            for (int i = 1; i < N; i++) {
                System.out.println(ans[i]);
            }
        } else {
            System.out.println("No");
        }

    }

    static int scanInt() throws IOException {
        return parseInt(scanString());
    }

    static long scanLong() throws IOException {
        return parseLong(scanString());
    }

    static String scanString() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;

    public static void main(String[] args) {
        try {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
            solve();
            in.close();
            out.close();
        }
        catch (Throwable e) {
            e.printStackTrace();
            exit(1);
        }
    }


Compiler output:
Main.java:86: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

#include "bits/stdc++.h"
#define int long long
#define rep(i, n)           for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b)        for (int i = (int)(a); i < (int)(b); i++)
#define inv(i, a, b)        for (int i = (int)(a); i >= (int)(b); i--)
#define ALL(obj)            begin(obj), end(obj)
#define MAX(x)              *max_element(ALL(x))
#define MIN(x)              *min_element(ALL(x))
#define LOWER_BOUND(A, key) distance(A.begin(), lower_bound(ALL(A), key))
#define UPPER_BOUND(A, key) distance(A.begin(), upper_bound(ALL(A), key))
#define Endl                endl

using namespace std;
const int MOD = (int)(1e9 + 7);
const int INF = (int)(1e13 + 7);

int CEIL(int a, int b) { return (a >= 0 ? (a + (b - 1)) / b : (a - (b - 1)) / b); } //ceil() for int
int mod(int a, int b) { return a >= 0 ? a % b : a - (b * CEIL(a, b)); }             //always return positive num
int bpm(int x, unsigned int y) {                                                    //return x^y in order(log(y))
  if (x == 0) return 0;
  if (y == 0) return 1;
  int ans   = 1;
  int digit = (int)((log((double)y) / log((double)2) / 1 + 1));
  x %= MOD;
  for (int i = 0; i < digit; i++) {
    if (((y >> i) & 1u) == 1) ans = ans * x % MOD;
    x = x * x % MOD;
  }
  return ans;
}
template <class T>
void cumulative_sum(T &container) {
  for (int i = 0; i < container.size() - 1; i++) container[i + 1] += container[i];
}

class DDoubleDots {
public:
  static void solve(std::istream &cin, std::ostream &cout) {
    int N, M;
    cin >> N >> M;
    vector<int> ans(N, 0);
    deque<int> pos = {0};
    vector<vector<int>> road(N);
    rep(i, M) {
      int A, B;
      cin >> A >> B;
      road[A - 1].emplace_back(B - 1);
      road[B - 1].emplace_back(A - 1);
    }
    while (pos.size()) {
      int k = pos[0];
      pos.pop_front();
      rep(i, road[k].size()) {
        if (ans[road[k][i]] == 0) {
          ans[road[k][i]] = k + 1;
          pos.emplace_back(road[k][i]);
        }
      }
    }
    cout << "Yes" << Endl;
    rep(i, ans.size() - 1) {
      cout << ans[i + 1] << endl;
    }
  }
};


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: Java

import java.util.*;

public class Solution {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        ArrayList<ArrayList<Integer>> g = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            g.add(new ArrayList<>());
        }
        for (int i = 0; i < m; i++) {
            int a = scanner.nextInt() - 1;
            int b = scanner.nextInt() - 1;
            g.get(a).add(b);
            g.get(b).add(a);
        }
        boolean[] used = new boolean[n];
        int[] ans = new int[n];
        used[0] = true;
        ArrayList<Integer> q = new ArrayList<>();
        q.add(0);
        int index = 0;
        while (index < q.size()) {
            int v = q.get(index);
            index++;
            for (int i = 0; i < g.get(v).size(); i++) {
                if (!used[g.get(v).get(i)]) {
                    ans[g.get(v).get(i)] = v + 1;
                    q.add(g.get(v).get(i));
                    used[g.get(v).get(i)] = true;
                }
            }
        }
        for (int i = 1; i < n; i++) {
            if (ans[i] == 0) {
                System.out.println("No");
                System.exit(0);
            }
        }
        System.out.println("Yes");
        for (int i = 1; i < n; i++) {
            System.out.println(ans[i]);
        }
    }
}


Compiler output:
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java
public class Solution {
       ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define MOD = 998244353;
#define int long long int
#define inf (int)(1e15)
#define all(x) (x).begin(), (x).end()
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define isYes(x) printf("%s\n", (x) ? "Yes" : "No")
#define isYES(x) printf("%s\n", (x) ? "YES" : "NO")
#define isIn(x, y, h, w) (x >= 0 && x < h && y >= 0 && y < w)
#define pair pair<int, int>
typedef vector<int> vi;   // Vector of long long
typedef vector<vi> vvi;   // Vector of vi
typedef vector<pair> vii; // Vector of pairs
typedef vector<vii> vvii; // Vector of Vector of pairs
typedef vector<bool> vb;  // Vector of bool
#define pq priority_queue // Max heap (To convert to min heap, use negative sign before every value)
#define ff first          // For pairs
#define ss second
const int dx4[] = {1, 0, -1, 0}, dy4[] = {0, -1, 0, 1};
const int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1}, dy8[] = {1, -1, 1, 0, -1, 1, -0, -1};
#define testcases(t) \
    int(t);          \
    cin >> (t);      \
    while ((t)--)
#define range(c, r) (c).begin(), (c).begin() + (r)    // Mainly used in sorting
#define present(c, x) ((c).find(x) != (c).end())      // for sets, maps, multi-maps
#define cpresent(c, x) (find(all(c), x) != (c).end()) // for vectors
#define run(x, c) for ((x) = (c).begin(); (x) != (c).end(); (x)++)
vvi adj;
vi parent;
vb visited;
void bfs()
{
    queue<int> q;
    q.push(1);
    visited[1] = true;
    while (q.size())
    {
        int current = q.front();
        q.pop();
        for (auto it : adj[current])
        {
            if (parent[it] == -1)
            {
                q.push(it);
                parent[it] = current;
                visited[it] = true;
            }
        }
    }
}
signed main()
{
    int n, m;
    cin >> n >> m;
    adj.resize(n + 1);
    parent.assign(n + 1, -1);
    visited.assing(n + 1, false);
    while (m--)
    {
        int u, v;
        cin >> u >> v;
        adj[u].pb(v);
        adj[v].pb(u);
    }
    bfs();
    for (int i = 1; i <= n; i++)
    {
        if (visited[i])
            continue;
        cout << "No" << endl;
        return 0;
    }
    Yes;
    for (int i = 2; i <= n; i++)
    {
        cout << parent[i] << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:13: error: 'vb' {aka 'class std::vector<bool>'} has no member named 'assing'; did you mean 'assign'?
   65 |     visited.assing(n + 1, false);
      |             ^~~~~~
      |             assign
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int MAX_N = 100005;
vector<int> G[MAX_N];
bool visit[MAX_N];
int ans[MAX_N];
queue<P> Q;

int main()
{
	int N,M;
	cin >> N >> M;
	rep(i,M)
	{
		int a,b;
		cin >> a >> b;
		a--; b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	Q.push(P(0,0));
	while(!Q.empty())
	{
		P p = Q.front();
		Q.pop();
		int v = p.first, u = p.second;
		if (visit[v]) continue;
		//cout << "visiting:" << v << endl;
		visit[v] = true;
		ans[v] = u;
		rep(i,G[v].size())
		{
			Q.push(P(G[v][i],v));
		}
	}
	cout << "Yes" << endl;
	rep(i,N-1)
	{
		cout << ans[i+1]+1 << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:21: error: reference to 'visit' is ambiguous
   30 |                 if (visit[v]) continue;
      |                     ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:8:6: note:                 'bool visit [100005]'
    8 | bool visit[MAX_N];
      |      ^~~~~
a.cc:32:17: error: reference to 'visit' is ambiguous
   32 |                 visit[v] = true;
      |                 ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:8:6: note:                 'bool visit [100005]'
    8 | bool visit[MAX_N];
      |      ^~~~~
Language: C++

//============================================================================
// Name        : d.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <queue>
#include <vector>
using namespace std;

#define INF 1e+9
#define MAX_V 100000

struct edge {
    int to;
    int cost;
};

// <最短距離, 頂点の番号>
using P = vector<int>;

int V;
vector<edge> G[MAX_V];
int d[MAX_V];
int ans[MAX_V];

void dijkstra(int s) {
    priority_queue<P, vector<P>, greater<P> > que;
    fill(d, d+V, INF);
    d[s] = 0;
    vector<int> tempv={0,s,0};
    que.push(tempv);

    while (!que.empty()) {
        P p = que.top();
        que.pop();
        int v = p[1];
        if (d[v] < p[0]) continue;
//        cout<<p[0]<<p[1]<<p[2]<<endl;
        ans[v]=p[2];
        for (int i=0; i<G[v].size(); ++i) {
            edge e = G[v][i];
//            cout<<e.to<<e.cost<<endl;
            if (d[e.to] > d[v] + e.cost) {
                d[e.to] = d[v] + e.cost;
                tempv={d[e.to],e.to,v};
                que.push(tempv);
            }
        }
    }
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define llinf (1ll<<62)
#define BG(x) ((x).begin())
#define ED(x) ((x).end())
#define rBG(x) ((x).rbegin())
#define rED(x) ((x).rend())
#define mp(a, b) make_pair((a), (b))

ll t;

ll n, m;
vector<ll> edge[100005];
ll p[100005];
bitset<100005> visit;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
//    cin >> t;
    t = 1;
    
	
	
    for(int _ = 1; _ <= t; _++) {
    //    cout << "Case #" << _ << ": ";
        
		cin >> n >> m;
		for(int i = 0; i < m; i++) {
			ll a, b;
			cin >> a >> b;
			edge[a].push_back(b);
			edge[b].push_back(a);
		//	cout << a << ' ' << b  << ' ' << '\n';
		}
		
		deque<pair<ll, ll>> bfs;
		bfs.push_back(mp(1, -1));
		while(bfs.size()) {
			auto now = bfs.front();
		//	cout << now.first << ' ' << now.second << ' ' << edge[now.first].size() << '\n';
			bfs.pop_front();
			if(visit[now.first])
				continue;
			visit[now.first] = 1;
			p[now.first] = now.second;
			for(auto x : edge[now.first]) {
				bfs.push_back(mp(x, now.first));
			}
		}
		cout << "YES\n";
		for(int i = 2; i <= n; i++)
			cout << p[i] << '\n';
		
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:28: error: reference to 'visit' is ambiguous
   45 |                         if(visit[now.first])
      |                            ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:16:16: note:                 'std::bitset<100005> visit'
   16 | bitset<100005> visit;
      |                ^~~~~
a.cc:47:25: error: reference to 'visit' is ambiguous
   47 |                         visit[now.first] = 1;
      |                         ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:16:16: note:                 'std::bitset<100005> visit'
   16 | bitset<100005> visit;
      |                ^~~~~
Language: C

#pragma target("avx")
#pragma optimize("O3")
#include<bits/stdc++.h>
using ll = int_fast64_t;
using P = std::pair<ll,ll>;
using PP = std::pair<ll,P>;
using V = std::vector<ll>;
template<typename T> using pq = std::priority_queue<T>;
template<typename T> using rpq = std::priority_queue<T, std::vector<T>, std::greater<T>>;

#define REP(i,b,e) for(ll i=b; i<e; i++)
#define ALL(vec) vec.begin(),vec.end()
#define PRINT(vec) printf("[ ");for(auto &i:vec)printf("%ld ",i);puts("]");
#define SCAN(vec) for(auto &i:vec)scanf("%ld",&i)
#define fi first
#define se second

const int MOD = 1e9+7;
const ll INF = 1e18;
int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

int main(){
        ll n, m;
        scanf("%ld %ld", &n, &m);
        V links[n];
        REP(i, 0, m){
                ll a, b;
                scanf("%ld %ld", &a, &b);
                links[a-1].push_back(b-1);
                links[b-1].push_back(a-1);
        }

        V ans(n, -1);
        bool used[n];
        memset(used, 0, n);
        std::queue<P> que;
        que.emplace(0, 0);
        while(!que.empty()){
                auto [from, dist] = que.front();
                que.pop();
                if(used[from]) continue;
                used[from] = true;
                for(ll to: links[from]){
                        if(used[to]) continue;
                        if(ans[to]<0) ans[to] = from+1;
                        que.emplace(to, dist+1);

                }
        }
        puts("Yes");
        REP(i, 1, n) printf("%ld\n", ans[i]);
        return 0;
}

Compiler output:
main.c:3:9: fatal error: bits/stdc++.h: No such file or directory
    3 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <iterator>
#include <numeric>
#include <cstdint>
#include <cmath>
#include <bitset>
#include <string>
#include <list>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>

#define N_TIMES(i, n)     for ( uint64_t i = 0;     i <  n; ++i )
#define N_TIMES_REV(i, n) for (  int64_t i = n - 1; i >= 0; --i )

using namespace std;

struct QueueItem
{
  uint64_t node, prev, len;

  QueueItem(uint64_t node, uint64_t prev, uint64_t len)
    : node(node), prev(prev), len(len) {}
};

int main()
{
  uint64_t N, M;
  cin >> N >> M;

  vector<set<uint64_t>> edges(N);
  N_TIMES(m, M) {
    uint64_t A, B;
    cin >> A >> B;

    edges[A - 1].emplace(B - 1);
    edges[B - 1].emplace(A - 1);
  }

  vector<uint64_t> post(N, -1);
  vector<uint64_t> prev(N, -1);
  vector<uint64_t> len(N, -1);

  queue<QueueItem> q;
  q.emplace(0, -1, 0);
  while (!q.empty()) {
    QueueItem item = q.front(); q.pop();
    debug(item.node);

    if (item.len >= len[item.node]) {
      continue;
    }

    len[item.node] = item.len;
    prev[item.node] = item.prev;
    post[item.node] = item.prev;

    for (uint64_t dst : edges[item.node]) {
      q.emplace(dst, item.node, item.len + 1);
    }
  }

  cout << "Yes" << endl;
  N_TIMES(n, N - 1) {
    cout << (post[n + 1] + 1) << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:5: error: 'debug' was not declared in this scope
   54 |     debug(item.node);
      |     ^~~~~
Language: C++

#pragma warning( disable : 6031)

#include <stdio.h>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <math.h>
int minimum(int a, int b) { return a < b ? a : b; }
int maximum(int a, int b) { return a > b ? a : b; }
//const long long mod = 1000000007;
const long long mod = 998244353;
const double PI = 3.14159265358979323846;
using std::vector;
using std::pair;
using std::string;
using std::map;
using std::abs;
using std::priority_queue;

int main() {
	int N, M;
	scanf("%d %d", &N, &M);
	auto v = new vector<int>[N];
	for (int i = 0; i < M; i++) {
		int a, b;
		scanf("%d %d", &a, &b);
		a--;
		b--;
		v[a].push_back(b);
		v[b].push_back(a);
	}
	vector<int> q;
	q.push_back(0);
	auto c = new int[N];
	for (int i = 0; i < N; i++)c[i] = -1;
	for (int i = 0; i < q.size(); i++) {
		int p = q[i];
		for (int j = 0; j < v[p].size(); j++) {
			int r = v[p][j];
			if (c[r] == -1) {
				c[r] = p;
				q.push_back(r);
			}
		}
	}
	printf("Yes\n");
	for (int i = 1; i < N; i++) {
		printf("%d\n", c[i] + 1);
	
	while (1)getchar();
	return 0;
}

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

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


int n, m, a, b, res[N];
queue < int > q;
bool was[N];
vi g[N];                      +



main () {
	cin >> n >> m;
	while (m--) {
		cin >> a >> b;
		g[a].pb(b);
		g[b].pb(a);
	}

	memset(res, -1, sizeof(res));
	q.push(1);
	res[1] = 0;
	while (sz(q)) {
		int v = q.front();
		q.pop();
		for (auto to : g[v])
			if (res[to] == -1) {
				res[to] = v;
				q.push(to);
			}
	}
	

	cout << "Yes\n";
	for (int i = 2; i <= n; ++i)
		cout << res[i] << endl;
}	

Compiler output:
a.cc:44:31: error: expected unqualified-id before '+' token
   44 | vi g[N];                      +
      |                               ^
Language: C++

#include <bits/stdc++.h>

using ll = long long;

using namespace std;

int main(){
  int N, M;
  cin >> N >> M;
  vector <vector <int> > adj(N + 1);
  vector <int> dp(N + 1, -1);
  for(int i = 0, a, b; i < M; i++){
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  dp[1] = 1;
  int cont = 0;
  queue <int> q;
  q.push(1);
  while(!q.empty()){
    int node = q.front();
    cont++;
    q.pop();
    for(int i : adj[node]){
      if(dp[i] == -1){
        q.push(i);
        dp[i] = node;
      }
    }
  }
  if(cont == N){
    cout << "Yes\n";
    for(int i = 2; i <= N; i++){
      cout << dp[i] << '\n';
    }
  }else{
    cout << "No" << '\n';
  }
  return 0;
}
#include <bits/stdc++.h>

using ll = long long;

using namespace std;

int main(){
  int N, M;
  cin >> N >> M;
  vector <vector <int> > adj(N + 1);
  vector <int> dp(N + 1, -1);
  for(int i = 0, a, b; i < M; i++){
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  dp[1] = 1;
  int cont = 0;
  queue <int> q;
  q.push(1);
  while(!q.empty()){
    int node = q.front();
    cont++;
    q.pop();
    for(int i : adj[node]){
      if(dp[i] == -1){
        q.push(i);
        dp[i] = node;
      }
    }
  }
  if(cont == N){
    cout << "Yes\n";
    for(int i = 2; i <= N; i++){
      cout << dp[i] << '\n';
    }
  }else{
    cout << "No" << '\n';
  }
  return 0;
}


Compiler output:
a.cc:48:5: error: redefinition of 'int main()'
   48 | int main(){
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main(){
      |     ^~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;

using ll = long long;

#define pb push_back
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
#define sz(a) (int)(a.size())
#define clr(a, b) memset(a, b, sizeof(a))
#define REP(i, a, b) for(int i=(int)(a); i<(int)(b); ++i)
#define REPD(i, a, b) for(int i=(int)(a)-1; i>=(int)(b); --i)
#define FOR(it,c) for ( __typeof((c).begin()) it=(c).begin(); it!=(c).end(); it++ )

template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int N = 1e5 + 5;
vector<int> adj[N];
int n, m, visit[N], pa[N];

void dfs(int node, int p) {
	if(visit[node])
		return;
	visit[node] = 1;
	pa[node] = p;
	for(int x: adj[node]) {
		dfs(x, node);
	}
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n >> m;
    REP(i, 0, m) {
    	int x, y;
    	cin >> x >> y;
    	--x, --y;
    	adj[x].pb(y);
    	adj[y].pb(x);
    }
    dfs(0, -1);
    REP(i, 0, n) {
    	if(!visit[i]) {
    		cout << "No\n";
    		return 0;
    	}
    }
    cout << "Yes\n";
    REP(i, 1, n) {
    	cout << pa[i]+1 << "\n";
    }
    return 0;
}


Compiler output:
a.cc:20:1: error: 'mt19937' does not name a type
   20 | mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
      | ^~~~~~~
Language: C++

#include <iostream>
using namespace std;

using ll = long long;

#define pb push_back
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
#define sz(a) (int)(a.size())
#define clr(a, b) memset(a, b, sizeof(a))
#define REP(i, a, b) for(int i=(int)(a); i<(int)(b); ++i)
#define REPD(i, a, b) for(int i=(int)(a)-1; i>=(int)(b); --i)
#define FOR(it,c) for ( __typeof((c).begin()) it=(c).begin(); it!=(c).end(); it++ )

template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int N = 1e5 + 5;
vector<int> adj[N];
int n, m, visit[N], pa[N];

void dfs(int node, int p) {
	if(visit[node])
		return;
	visit[node] = 1;
	pa[node] = p;
	for(int x: adj[node]) {
		dfs(x, node);
	}
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n >> m;
    REP(i, 0, m) {
    	int x, y;
    	cin >> x >> y;
    	--x, --y;
    	adj[x].pb(y);
    	adj[y].pb(x);
    }
    dfs(0, -1);
    REP(i, 0, n) {
    	if(!visit[i]) {
    		cout << "No\n";
    		return 0;
    	}
    }
    cout << "Yes\n";
    REP(i, 1, n) {
    	cout << pa[i]+1 << "\n";
    }
    return 0;
}


Compiler output:
a.cc:19:1: error: 'mt19937' does not name a type
   19 | mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
      | ^~~~~~~
a.cc:22:1: error: 'vector' does not name a type
   22 | vector<int> adj[N];
      | ^~~~~~
a.cc: In function 'void dfs(int, int)':
a.cc:30:20: error: 'adj' was not declared in this scope
   30 |         for(int x: adj[node]) {
      |                    ^~~
a.cc: In function 'int main()':
a.cc:43:9: error: 'adj' was not declared in this scope
   43 |         adj[x].pb(y);
      |         ^~~
Language: C++

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

using ll = long long;

#define pb push_back
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
#define sz(a) (int)(a.size())
#define clr(a, b) memset(a, b, sizeof(a))
#define REP(i, a, b) for(int i=(int)(a); i<(int)(b); ++i)
#define REPD(i, a, b) for(int i=(int)(a)-1; i>=(int)(b); --i)
#define FOR(it,c) for ( __typeof((c).begin()) it=(c).begin(); it!=(c).end(); it++ )

template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int N = 1e5 + 5;
vector<int> adj[N];
int n, m, visit[N], pa[N];

void dfs(int node, int p) {
	if(visit[node])
		return;
	visit[node] = 1;
	pa[node] = p;
	for(int x: adj[node]) {
		dfs(x, node);
	}
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n >> m;
    REP(i, 0, m) {
    	int x, y;
    	cin >> x >> y;
    	--x, --y;
    	adj[x].pb(y);
    	adj[y].pb(x);
    }
    dfs(0, -1);
    REP(i, 0, n) {
    	if(!visit[i]) {
    		cout << "No\n";
    		return 0;
    	}
    }
    cout << "Yes\n";
    REP(i, 1, n) {
    	cout << pa[i]+1 << "\n";
    }
    return 0;
}


Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:26:12: error: reference to 'visit' is ambiguous
   26 |         if(visit[node])
      |            ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:23:11: note:                 'int visit [100005]'
   23 | int n, m, visit[N], pa[N];
      |           ^~~~~
a.cc:28:9: error: reference to 'visit' is ambiguous
   28 |         visit[node] = 1;
      |         ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:23:11: note:                 'int visit [100005]'
   23 | int n, m, visit[N], pa[N];
      |           ^~~~~
a.cc: In function 'int main()':
a.cc:48:13: error: reference to 'visit' is ambiguous
   48 |         if(!visit[i]) {
      |             ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:23:11: note:                 'int visit [100005]'
   23 | int n, m, visit[N], pa[N];
      |           ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
#define rep(i,n) for(lint (i)=0;(i)<(n);(i)++)
#define repp(i,m,n) for(lint (i)=(m);(i)<(n);(i)++)
#define repm(i,n) for(lint (i)=(n-1);(i)>=0;(i)--)
#define INF (1ll<<60)
#define all(x) (x).begin(),(x).end()
const lint MOD =1000000007;
const lint MAX = 1000000;
using Graph =vector<vector<lint>>;
typedef pair<lint,lint> P;
typedef map<lint,lint> M;
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
 
lint fac[MAX], finv[MAX], inv[MAX];
 
void COMinit() 
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (lint 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;
    }
}
 
long long COM(lint n, lint k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 
lint primary(lint num)
{
    if (num < 2) return 0;
    else if (num == 2) return 1;
    else if (num % 2 == 0) return 0;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return 0;
        }
    }
 
    return 1;
}
   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;
}
    lint lcm(lint a,lint b){
        return a/__gcd(a,b)*b;
    }
     lint gcd(lint a,lint b){
        return __gcd(a,b);
    } 

  int main(){
      lint n;
      cin>>n;
      map<P,lint> mp;
      lint add=0;
      rep(i,n){
          lint a,b;
          cin>>a>>b;
          lint x;
          if(a>0&&b>0){
           x=gcd(a,b);
           mp[{a/x,b/x}]++; 
          }else if(a<0&&b>0){
           x=gcd(abs(a),abs(b));
           mp[{a/x,b/x}]++;
          }else if(a>0&&b<0){
            x=gcd(abs(a),abs(b));
            mp[{-a/x,-b/x}]++;
          } else if(a<0&&b<0){
           x=gcd(abs(a),abs(b));
           mp[{-a/x,-b/x}]++;
          } else if(a==0&&b==0){
            add++;
          }else if(a==0){
            mp[{0,-1}]++;
          }else mp[{1,0}]++;     
      }
      lint ans=1;
      for(auto t:mp){
          P p=t.first;
          lint h;
          (p.first=>0){
          h=mp[{-p.second,p.first}];
          mp.erase({-p.second,p.first});
          }else{
          h=mp[{p.second,-p.first}];
          mp.erase({p.second,-p.first});           
          }
          lint mul=modpow(2,h,MOD)+modpow(2,t.second,MOD)-1;
          mul+=MOD;
          mul%=MOD;
          ans*=mul;
          ans%=MOD;
      }
      ans+=add;
      ans--;
      ans+=MOD;
      ans%=MOD;
      cout<<ans<<endl;
      }
      

Compiler output:
a.cc: In function 'int main()':
a.cc:105:20: error: expected primary-expression before '>' token
  105 |           (p.first=>0){
      |                    ^
a.cc:108:12: error: 'else' without a previous 'if'
  108 |           }else{
      |            ^~~~
Language: C++

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

int mod_pow(int n, int e, int mod){
    int ans = 1;
    n = n % mod;
    while(e != 0){
        if(e % 2 == 1){
            ans = (ans * n) % mod;
        }
        e /= 2;
        n = (n * n) % mod;
    }
    return ans;
}

int my_gcd(int n, int m){
    if(n < 0) n*=-1;
    if(m < 0) m*=-1;
    if(n < m) swap(n, m);
    if(m == 0) return n;
    else return my_gcd(m, n%m);
}

signed main(){
    // cout << fixed << setprecision(10) << flush;

    int n;
    cin >> n;
    vector<int> a(n);
    vector<int> b(n);
    for(int i=0; i<n; i++){
        cin >> a[i] >> b[i];
    }

    map<pair<int, int>, int> mp;
    int aho = 0;
    for(int i=0; i<n; i++){
        if(a[i] != 0 && b[i] == 0){
            if(mp.find(make_pair(1,0)) != mp.end()){
                mp[make_pair(1,0)]++;
            }
            else mp[make_pair(1,0)] = 1;
        }
        else if(a[i] == 0 && b[i] != 0){
            if(mp.find(make_pair(0,1)) != mp.end()){
                mp[make_pair(0,1)]++;
            }
            else mp[make_pair(0,1)] = 1;
        }
        else if(a[i] == 0 && b[i] == 0){
            aho++;
        }
        else{
            int g = my_gcd(a[i], b[i]);
            if(a[i] < 0){
                a[i] *= -1;
                b[i] *= -1;
            }
            pair<int, int> p = make_pair(a[i]/g, b[i]/g);
            if(mp.find(p) != mp.end()) mp[p]++;
            else mp[p] = 1;
        }
    }

    int ans = 1;
    int mod = 1000000007;
    for(auto itr=mp.begin(); itr != mp.end(); itr++){
        pair<int, int> right;
        if(itr->first.second == 0){
            right = make_pair(0, 1);
        }
        if(itr->first.first == 0){
            right = make_pair(1, 0);
        }
        else if(itr->first.second > 0){
            right = make_pair(itr->first.second, itr->first.first * -1);
        }
        else{
            right = make_pair(itr->first.second * (-1), itr->first.first);
        }
        int m = 0;
        if(mp.find(right) != mp.end()){
            m = mp[right];
        }
        ans = (ans * ((mod_pow(2, itr->second, mod) + mod_pow(2, m, mod) + mod - 1) % mod))%mod;
        if(m != 0) mp[right] = 0;
        itr->second = 0;
    }
    cout << ans - 1 + aho@ << endl;

    return 0;
}

Compiler output:
a.cc:91:26: error: stray '@' in program
   91 |     cout << ans - 1 + aho@ << endl;
      |                          ^
Language: C++

#include<bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; i++)
#define repo(i, n) for(int i=1; i<=n; i++)
#define INF 1001001001
#define INFll 100100100100100
// debug用
#define PrintVec(x) for (auto elementPrintVec: x) { cout << elementPrintVec << " "; } cout << endl;

using namespace std;
using ull = unsigned long long;
using ll = long long;
using P = pair<ll, ll>;
const int mod = 1000000007;



ll gcd(ll i,ll j){
  if(i<0)i=-i;
  if(j<0)j=-j;
  if(i<j){
    swap(i, j);
  }
  ll r=i%j, a=i, b=j;
  while(r!=0){
    i=j;
    j=r;
    r=i%j;
  }
  return j;
}

long long modpow(long long a, long long n, int 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;
  map<P, int> mp;
  int zero=0;
  rep(i, n){
    ll a, b;
    cin >> a >> b;

    if(a==0 && b==0){
      zero++;
      continue;
    }
    if(a==0){
      mp[P(0, 1)]++;
    } else if(b==0){
      mp[P(1, 0)]++;
    } else {
      if(a<0){
        a=-a;
        b=-b;
      }
      ll gcdab=gcd(a, b);
      mp[P(a/gcdab, b/gcdab)]++;
    }
  }
  ll ans=1;
  for(auto p: mp){
    if(p.first.first==0){
      ans*=(modpow(2, mp[p.first], mod)+modpow(2, mp[P(1, 0)], mod)-1)%mod;
      mp[p.first]=0;
      mp[P(1, 0)]=0;
      ans%=mod;
    } else if(p.first.second==0){
      ans*=(modpow(2, mp[p.first], mod)+modpow(2, mp[P(0, 1)], mod)-1)%mod;
      mp[p.first]=0;
      mp[P(0, 1)]=0;
      ans%=mod;
    } else {
      ll x=p.first.first;
      ll y=p.first.second;
      ll nx, ny;
      if(y>0){
        nx=y;
        ny=-x;
      } else {
        nx=-y;
        ny=x;
      }
      ans*=(modpow(2, mp[p.first], mod)+modpow(2, mp[P(nx, ny)], mod)-1)%mod;
      mp[p.first]=0;
      mp[P(nx, ny)]=0;
      ans%=mod;
    }
  }
  ans-=1;
  ans+=zero;
  ans%=mod
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:100:11: error: expected ';' before 'cout'
  100 |   ans%=mod
      |           ^
      |           ;
  101 |   cout << ans << endl;
      |   ~~~~
Language: C++

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

#define DIV 1000000007

long long N;
long long A[200005];
long long B[200005];

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

long long modpow(long long ori, long long po){
	long long res = 1;
	while(po > 0){
		if(po&1){
			res *= ori;
			res %= DIV;
		}
		ori *= ori;
		ori %= DIV;
		po >>= 1;
	}
	return res;
}

int main(){
	cin >> N;
	for(long long i = 0; i < N; i++) {
		cin >> A[i] >> B[i];
	}

	//a, b -> count
	map<pair<long long, long long>, long long> memo;
	long long azero = 0;
	long long bzero = 0;
	long long abzero = 0;
	for(long long i = 0; i < N; i++) {
		long long a = A[i];
		long long b = B[i];
		if(a < 0 && b < 0) {
			a = -a;
			b = -b;
		}
		long long g = gcd(a, b);
		if(a == 0 && b == 0) {
			abzero++;
			continue;
		} else if(a == 0) {
			azero++;
			continue;
		} else if(b == 0) {
			bzero++;
			continue;
		}
		a/=g;
		b/=g;

		memo[make_pair(a, b)]++;
	}
	long long ans = 1;
	if(abzero == N) {
		ans = 0;
	}

	//azeroからerabu もしくは bzeroから選ぶ
	ans *= (modpow(2, azero) - 1) + (modpow(2, bzero) - 1) + 1;
	ans = (ans + DIV)%DIV;

	set<pair<long long, long long> > done;
	for(auto item: memo) {
		long long a = item.first.first;
		long long b = item.first.second;
		long long num = item.second;

		if(done.count(make_pair(a, b)) > 0) {
			continue;
		}
		done.insert(make_pair(a, b));

		long long tmpans = 0;

		long long okpair = num;
		if(memo.count(make_pair(-a, -b)) > 0) {
			okpair += memo[make_pair(-a, -b)];
			done.insert(make_pair(-a, -b));
		}
		tmpans += modpow(2, okpair) - 1;

		long long ngpair = 0;
		if(memo.count(make_pair(-b, a)) > 0) {
			ngpair += memo[make_pair(-b, a)];
			done.insert(make_pair(-b, a));
		}
		if(memo.count(make_pair(b, -a)) > 0) {
			ngpair += memo[make_pair(b, -a)];
			done.insert(make_pair(b, -a));
		}
		tmpans += modpow(2, ngpair) - 1;

		ans *= (tmpans + 1);
		ans = (ans + DIV)%DIV;
	}

	ans--;
	ans = (ans + DIV)%DIV;
	ans += bothzero;
	ans = (ans + DIV)%DIV;
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:113:16: error: 'bothzero' was not declared in this scope; did you mean 'bzero'?
  113 |         ans += bothzero;
      |                ^~~~~~~~
      |                bzero
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    long long mod = 1e9 + 7;
    vector<long long>power(n + 3);
    power[0] = 1;
    for(int i = 1; i <= n; i++){
        power[i] = (power[i - 1] * 2) % mod;
    }
    map<pair<long long, long long>, int>mp;
    set<pair<long long, long long> >st;
    long long cnt = 0, cnt2 = 0, cnt3 = 0;
    for(int i = 1; i <= n; i++){
        long long a, b;
        cin >> a >> b;
        if(a == 0 && b == 0){
            cnt++;
        }
        else if(a == 0){
            cnt2++;
        }
        else if(b == 0){
            cnt3++;
        }
        else{
            long long x = abs(a);
            long long y = abs(b);
            long long z = __gcd(x, y);
            a = a/z;
            b = b/z;
            //cout << a << ' ' << b << '\n';
            mp[make_pair(a, b)]++;
            mp[make_pair(-a, -b)]++;
            st.insert(make_pair(a, b));
            st.insert(make_pair(-a, -b));
        }
    }
    long long ans = 1;
    map<pair<long long, long long>, int>::iterator it;
    for(it = mp.begin(); it != mp.end(); it++){
        pair<long long, long long>p = it->first;
        if(st.find(p) == st.end()){
            continue;
        }
        long long a = p.first, b = p.second;
        int val = it->second;
        long long cur = power[val];
        if(st.find(make_pair(-b, a)) == st.end()){
            ans = (ans * cur) % mod;
            st.erase(p);
            st.erase(make_pair(-a, -b));
        }
        else{
            int x = mp[make_pair(-b, a)];
            cur = (cur + power[x] + 2 * mod - 1) % mod;
            ans = (ans * cur) % mod;
            st.erase(p);
            st.erase(make_pair(-a, -b));
            st.erase(make_pair(-b, a));
            st.erase(make_pair(b, -a));
        }
    }
    long long x = (power[cnt2] + power[cnt3] + cnt - 1 + 3 * mod) % mod;
    ans = (ans * (power[cnt2] + x) % mod;
    cout << (ans + mod - 1) % mod;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:41: error: expected ')' before ';' token
   66 |     ans = (ans * (power[cnt2] + x) % mod;
      |           ~                             ^
      |                                         )
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <array>
#include <tuple>
#include <string>
#include <algorithm>
#include <functional> // greater など
#include <cmath>      // abs など
#include <numeric>    // accumulate など
#include <stdexcept>
#include <cassert> // assert
using namespace std;

#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
// typedef long long ll;
typedef cpp_int ll;

// #define NDEBUG 1
// debug用出力 https://trap.jp/post/998/
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T)
{
    cerr << H << " ";
    debug_out(T...);
}
#ifdef NDEBUG
#define debug(...)
#else
#define debug(...) debug_out(__VA_ARGS__)
#endif

//////////////// //////////////// //////////////// //////////////// ////////////////
//////////////// //////////////// //////////////// //////////////// ////////////////

typedef pair<ll, ll> coord;
inline ll MOD = 1000000007;

// constexpr int MAX_N = 200'000 + 9;
int n;
map<coord, int> dir;
ll ans = 1;

ll gcd(ll a, ll b)
{
    a = abs(a); b = abs(b);
    while (b > 0)
    {
        ll tmp = a;
        a = b;
        b = tmp % b;
    }
    return a;
}

ll pw(ll b, int a)
{
    ll res = 1;
    while (a > 0)
    {
        if (a & 1)
        {
            res = res * b % MOD;
            a--;
        }
        else
        {
            b = b * b % MOD;
            a /= 2;
        }
    }
    return res;
}

int main()
{
    // 入出力
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;
    REP(i, n)
    {
        ll a,b;
        cin >> a >> b;
        ll g = gcd(a,b);
        a = (g == 0) ? 0 : (a / g);
        b = (g == 0) ? 0 : (b / g);
        if (! ((a >= 0 && b >= 0) || (a < 0 && b > 0)))
        {
            a = -a;
            b = -b;
        }
        dir[coord(a, b)]++;
    }

    for (auto tup : dir)
    {
        ll a = tup.first.first;
        ll b = tup.first.second;
        int cnt = tup.second;
        ll c = (a > 0) ? (-b) : b;
        ll d = abs(a);
        if ((a == 0 && b == 0) || (a <= 0 && (dir.count(coord(c, d)) > 0)))
        {
            continue;
        }
        auto it = dir.find(coord(c, d));
        int cnt2 = (it == dir.end()) ? 0 : it->second;
        ans = ans * (pw(2, cnt) + pw(2, cnt2) - 1) % MOD;
    }
    ans = (ans + dir[coord(0, 0)] - 1) % MOD;

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc:17:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
   17 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

const int N=2e5+20,MOD=1e9+7;

int n,zero,p[N];
long long a,b,p[N],ans=1;
map <pair <long long,long long>,int> m1,m2;

int get(long long a,long long b)
{
	a*=-1;
	if(m2.find({b,a})==m2.end()) return 0;

	long long ans=m2[{b,a}];
	m2.erase({b,a});
	return ans;
}

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

	scanf("%d",&n);
	while(n--)
	{
		scanf("%lld%lld",&a,&b);

		if(a==0 and b==0)
		{
			zero++;
			continue;
		}

		long long g=__gcd(a,b);
		a/=g,b/=g;
		if(b<0) a*=-1,b*=-1;
		if(a<0) m1[{a,b}]++;
		else m2[{a,b}]++;
	}

	for(auto i:m1)
	{
		a=i.first.first,b=i.first.second;
		ans*=(p[m1[{a,b}]]+p[get(a,b)]-1ll)%MOD;
		ans%=MOD;
	}

	for(auto i:m2)
	{
		a=i.first.first,b=i.first.second;
		ans*=p[m2[{a,b}]];
		ans%=MOD;
	}

	ans=(ans+zero-1)%MOD;
	if(ans<0) ans+=MOD;
	printf("%lld",ans);
}

Compiler output:
a.cc:7:15: error: conflicting declaration 'long long int p [200020]'
    7 | long long a,b,p[N],ans=1;
      |               ^
a.cc:6:12: note: previous declaration as 'int p [200020]'
    6 | int n,zero,p[N];
      |            ^
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <set>


using namespace std;

int MOD = 1000000007;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

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

void yakubun(int64_t& a, int64_t& b)
{
	if (a == 0 ||b == 0)return;

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

	int64_t m = gcd(a, b);
	a /= m;
	b /= m;
}

int main() {

	int N;

	cin >> N;
	int ans00 = 0;

	vector<int64_t> A;
	vector<int64_t> B;

	map<pair<int,int>, pair<int,int>> AB;
	set<pair<int, int>> key;


	rep(i, N)
	{
		int64_t a, b;
		cin >> a >> b;
		A.push_back(a);
		B.push_back(b);

		if (a == 0 && b == 0)
		{
			ans00++;
			continue;
		}

		if (b == 0) {
			a = 1;
			b = 0;
		}
		yakubun(a, b);

		int aj = b;
		int bj = abs(a);
		if (a > 0)aj *= -1;
		if (AB[{aj, bj}].first != 0)
		{
			AB[{aj, bj}].second++;
		}
		else {
			AB[{a, b}].first++;
			key.insert({ a, b });
		}
		

		
	}

	
	int64_t ans = 1;

	for (auto k : key) {
		cout << k.first << "," << k.second << ":" << AB[k].first << "," << AB[k].second << endl;

		/*
		ans += pow(2, AB[k].first);
		ans %= MOD;
		
		ans += pow(2, AB[k].second);
		ans %= MOD;
		ans--;
		*/

		int64_t tmp = ( (int)pow(2, AB[k].first) + (int)pow(2, AB[k].second) - 1) % MOD;

		cout << tmp << endl;
		ans *= tmp;
		ans %= MOD;

	}

	cout << ans+ans00-1;

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:96:38: error: 'pow' was not declared in this scope
   96 |                 int64_t tmp = ( (int)pow(2, AB[k].first) + (int)pow(2, AB[k].second) - 1) % MOD;
      |                                      ^~~
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <set>

#include <numeric>
#include <string>

using namespace std;

int MOD = 1000000007;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

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

void yakubun(int64_t& a, int64_t& b)
{
	if (a == 0 ||b == 0)return;

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

	int64_t m = gcd(a, b);
	a /= m;
	b /= m;
}

int main() {

	int N;

	cin >> N;
	int ans00 = 0;

	vector<int64_t> A;
	vector<int64_t> B;

	map<pair<int,int>, pair<int,int>> AB;
	set<pair<int, int>> key;


	rep(i, N)
	{
		int64_t a, b;
		cin >> a >> b;
		A.push_back(a);
		B.push_back(b);

		if (a == 0 && b == 0)
		{
			ans00++;
			continue;
		}

		if (b == 0) {
			a = 1;
			b = 0;
		}
		yakubun(a, b);

		int aj = b;
		int bj = abs(a);
		if (a > 0)aj *= -1;
		if (AB[{aj, bj}].first != 0)
		{
			AB[{aj, bj}].second++;
		}
		else {
			AB[{a, b}].first++;
			key.insert({ a, b });
		}
		

		
	}

	
	int64_t ans = 1;

	for (auto k : key) {
		cout << k.first << "," << k.second << ":" << AB[k].first << "," << AB[k].second << endl;

		/*
		ans += pow(2, AB[k].first);
		ans %= MOD;
		
		ans += pow(2, AB[k].second);
		ans %= MOD;
		ans--;
		*/

		int64_t tmp = ( (int)pow(2, AB[k].first) + (int)pow(2, AB[k].second) - 1) % MOD;

		cout << tmp << endl;
		ans *= tmp;
		ans %= MOD;

	}

	cout << ans+ans00-1;

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:98:38: error: 'pow' was not declared in this scope
   98 |                 int64_t tmp = ( (int)pow(2, AB[k].first) + (int)pow(2, AB[k].second) - 1) % MOD;
      |                                      ^~~