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

#include <vector>
#include <iostream>

using namespace std;

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

	if (a > b) { return gcd(b, a % b); }

	return gcd(a, b % a);
}

int lcm(int a, int b)
{
	return 1LL * a * b / gcd(a, b) % mod;
}

vector<int> G; // i --> G[i] Graph

vector<bool> visited;

vector<vector<int> > cycles;

void rec(int p)
{
	visited[p] = true;

	cycles.back().push_back(p);

	if (!visited[G[p]])
	{
		rec(G[p]);
	}
}

int main()
{
	int V, Q;

	scanf("%d", &V);
	scanf("%d", &Q);

	G = vector<int>(V);

	for (int i = 0; i < V; i++)
	{
		scanf("%d", &G[i]); G[i]--; // 1 -> 0 indexed
	}

	visited = vector<bool>(V, false);

	for (int i = 0; i < V; i++)
	{
		if (!visited[i])
		{
			cycles.push_back(vector<int>());

			rec(i);
		}
	}

	vector<long long> val(V, 0);
	
	vector<int> num(V, 0);

	for (int i = 0; i < cycles.size(); i++)
	{
		long long sum = 0;

		for (int j = 0; j < cycles[i].size(); j++)
		{
			sum += cycles[i][j] + 1;
		}

		for (int j = 0; j < cycles[i].size(); j++)
		{
			val[cycles[i][j]] = sum;

			num[cycles[i][j]] = cycles[i].size();
		}
	}

	int l, r;

	for (int i = 0; i < Q; i++)
	{
		scanf("%d", &l); l--; // 1 -> 0 indexed
		scanf("%d", &r); r--;

		long long rep = 1;

		for (int j = l; j <= r; j++)
		{
			rep = lcm(rep, num[j]);
		}

		long long ret = 0;

		for (int j = l; j <= r; j++)
		{
			ret = (ret + val[j] * rep / num[j]) % mod;
		}

		printf("%lld\n", ret);
	}

	return 0;
}

Compiler output:
a.cc: In function 'int lcm(int, int)':
a.cc:18:42: error: 'mod' was not declared in this scope
   18 |         return 1LL * a * b / gcd(a, b) % mod;
      |                                          ^~~
a.cc: In function 'int main()':
a.cc:104:63: error: 'mod' was not declared in this scope
  104 |                         ret = (ret + val[j] * rep / num[j]) % mod;
      |                                                               ^~~
Language: C++

#include <vector>
#include <iostream>
 
#define mod 1000000007
 
using namespace std;

int lcm(int a, int b)
{
    return 1LL * a * b / __gcd(a, b) % mod;
}
 
vector<int> G; // i --> G[i] Graph
 
vector<bool> visited;
 
vector<vector<int> > cycles;
 
void rec(int p)
{
    visited[p] = true;
 
    cycles.back().push_back(p);
 
    if (!visited[G[p]])
    {
        rec(G[p]);
    }
}
 
int main()
{
    int V, Q;
 
    scanf("%d", &V);
    scanf("%d", &Q);
 
    G = vector<int>(V);
 
    for (int i = 0; i < V; i++)
    {
        scanf("%d", &G[i]); G[i]--; // 1 -> 0 indexed
    }
 
    visited = vector<bool>(V, false);
 
    for (int i = 0; i < V; i++)
    {
        if (!visited[i])
        {
            cycles.push_back(vector<int>());
 
            rec(i);
        }
    }
 
    vector<long long> val(V, 0);
     
    vector<int> num(V, 0);
 
    for (int i = 0; i < cycles.size(); i++)
    {
        long long sum = 0;
 
        for (int j = 0; j < cycles[i].size(); j++)
        {
            sum += cycles[i][j] + 1;
        }
 
        for (int j = 0; j < cycles[i].size(); j++)
        {
            val[cycles[i][j]] = sum;
 
            num[cycles[i][j]] = cycles[i].size();
        }
    }
 
    int l, r;
 
    for (int i = 0; i < Q; i++)
    {
        scanf("%d", &l); l--; // 1 -> 0 indexed
        scanf("%d", &r); r--;
 
        long long rep = 1;
 
        for (int j = l; j <= r; j++)
        {
            rep = lcm(rep, num[j]);
        }
 
        long long ret = 0;
 
        for (int j = l; j <= r; j++)
        {
            ret = (ret + val[j] * rep / num[j]) % mod;
        }
 
        printf("%lld\n", ret);
    }
 
    return 0;
}

Compiler output:
a.cc: In function 'int lcm(int, int)':
a.cc:10:26: error: '__gcd' was not declared in this scope
   10 |     return 1LL * a * b / __gcd(a, b) % mod;
      |                          ^~~~~
Language: C++

#include <vector>
#include <iostream>

using namespace std;

class SegTree
{
private:

	int size;

	vector<long long> lcmvalue;

	long long _query(int a, int b, int k, int l, int r)
	{
		if (r <= a || b <= l) { return 1; }
		if (a <= l && r <= b) { return lcmvalue[k]; }

		long long vl = _query(a, b, 2 * k, l, (l + r) / 2);
		long long vr = _query(a, b, 2 * k + 1, (l + r) / 2, r);

		return lcm(vl, vr);
	}

public:

	SegTree(int size_)
	{
		for (size = 1; size < size_;) { size <<= 1; }

		lcmvalue = vector<long long>(size * 2, 1);
	}

	void update(int i, long long x)
	{
		i += size;

		lcmvalue[i] = x;

		while (i > 1)
		{
			i = i / 2;

			lcmvalue[i] = lcm(lcmvalue[2 * i], lcmvalue[2 * i + 1]);
		}
	}

	long long query(int s, int t)
	{
		return _query(s, t, 1, 0, size);
	}
};

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

	if (a > b) { return gcd(b, a % b); }

	return gcd(a, b % a);
}

long long lcm(long long a, long long b)
{
	return a / gcd(a, b) * b;
}

vector<int> G; // i --> G[i] Graph

vector<bool> visited;

vector<vector<int> > cycles;

void rec(int p)
{
	visited[p] = true;

	cycles.back().push_back(p);

	if (!visited[G[p]])
	{
		rec(G[p]);
	}
}

int main()
{
	int V, Q;

	scanf("%d", &V);
	scanf("%d", &Q);

	G = vector<int>(V);

	for (int i = 0; i < V; i++)
	{
		scanf("%d", &G[i]); G[i]--; // 1 -> 0 indexed
	}

	visited = vector<bool>(V, false);

	for (int i = 0; i < V; i++)
	{
		if (!visited[i])
		{
			cycles.push_back(vector<int>());

			rec(i);
		}
	}

	vector<int> val(V, 0), num(V, 0);

	for (int i = 0; i < cycles.size(); i++)
	{
		int sum = 0;

		for (int j = 0; j < cycles[i].size(); j++)
		{
			sum += cycles[i][j] + 1;
		}

		for (int j = 0; j < cycles[i].size(); j++)
		{
			val[cycles[i][j]] = sum;

			num[cycles[i][j]] = cycles[i].size();
		}
	}

	SegTree S(V);

	for (int i = 0; i < V; i++)
	{
		S.update(i, num[i]);
	}

	int l, r;

	for (int i = 0; i < Q; i++)
	{
		scanf("%d", &l); l--; // 1 -> 0 indexed
		scanf("%d", &r); r--;

		long long rep = S.query(l, r + 1);

		int ret = 0;

		for (int j = l; j <= r; j++)
		{
			ret = (ret + rep / num[j] % 1000000007 * val[j]) % 1000000007;
		}

		printf("%d\n", ret);
	}

	return 0;
}

Compiler output:
a.cc: In member function 'long long int SegTree::_query(int, int, int, int, int)':
a.cc:22:24: error: 'lcm' was not declared in this scope
   22 |                 return lcm(vl, vr);
      |                        ^~~
a.cc: In member function 'void SegTree::update(int, long long int)':
a.cc:44:39: error: 'lcm' was not declared in this scope
   44 |                         lcmvalue[i] = lcm(lcmvalue[2 * i], lcmvalue[2 * i + 1]);
      |                                       ^~~
Language: C++

#define _USE_MATH_DEFINES
#include <iostream>
#include <queue>
#include <vector>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <cctype>
#include <cstdlib>
#include <string.h>
#include <utility>
#include <cstdio>
#include <set>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
namespace mp = boost::multiprecision;

#define INF (1 << 20)
#define EPS (1e-10)
#define EQ(a,b) (fabs((a)-(b)) < EPS)

#define ll mp::cpp_int
#define LL mp::cpp_int

#define MAX_N 100000
#define MOD 1000000007ll

int flg[MAX_N+1];
int p[MAX_N+1];

//最大公約数を求める
ll gcd(ll a, ll b) {
	if (a == 0 && b == 0) return INF;
	if (a == 0 || b == 0) return a + b;
	while (a % b != 0) {
		ll r = a % b;
		a = b;
		b = r;
	}
	return b;
}

//最小公倍数を求める
ll lcm(ll a, ll b) {
	return a * b / gcd(a, b);
}


int n;
ll period[2 * MAX_N - 1], sum[2 * MAX_N - 1];

//O(n)
//セグメント木の初期化
void init(int n_) {
	// 簡単のため、要素数は２のべき乗にする
	n = 1;
	while (n < n_) n *= 2;
	for (int i = 0; i < 2 * n - 1; ++i) period[i] = 1, sum[i] = 0;
}

//O(logn)
//k番目の値(0-origin)を変更
void update(int k, ll per, ll s) {
	//葉の節点
	k += n - 1;
	period[k] = per;
	sum[k] = s;
	while (k > 0) {
		k = (k-1) / 2;
		period[k] = lcm(period[k * 2 + 1], period[k * 2 + 2]);
		sum[k] = period[k] / period[k * 2 + 1] * sum[k * 2 + 1] + period[k] / period[k * 2 + 2] * sum[k * 2 + 2];
	}
}

//O(logn)
//[l, r)のうちの[a, b)の答えを求める。
//kは節点の番号。呼ぶときは根である0を呼ぶこと。
//例：[0, n)のうち[a, b)の部分の答えを求める：query(a, b, 0, 0, n)
ll query(ll a, ll b, int k, ll l, ll r, ll& per) {
	//cout << "k" << k << endl;
	//cout << "sum[k]" << sum[k] << endl;
	//cout << "period[k]" << period[k] << endl;

	//[l, r) && [a, b) == null    {l r a b} or {a b l r}
	if (r <= a || b <= l) return 0;

	//[l, r) && [a, b) == [l, r)    {a l r b}
	if (a <= l && r <= b) {
		per = max(per, period[k]);
		return sum[k];
	}

	//{a l b r} or {l a r b} or {l a b r}
	ll vl = query(a, b, k * 2 + 1, l, (l + r) / 2, per);
	ll vr = query(a, b, k * 2 + 2, (l + r) / 2, r, per);
	return period[k] / period[k * 2 + 1] * vl + period[k] / period[k * 2 + 2] * vr;
}

int main() {
	int N, Q;
	cin >> N >> Q;
	init(N);
	for (int i = 0; i < N; ++i) {
		int data;
		cin >> data;
		p[i+1] = data;
	}
	for (int i = 1; i <= N; ++i) {
		if (flg[i]) continue;
		flg[i]++;
		int cur = p[i];
		ll s = i;
		ll per = 1;
		while (cur != i) {
			flg[cur]++;
			s += cur;
			++per;
			cur = p[cur];
		}
		cur = p[i];
		update(i-1, per, s);
		while (cur != i) {
			update(cur-1, per, s);
			cur = p[cur];
		}
	}
	for (int i = 0; i < Q; ++i) {
		int l, r;
		cin >> l >> r;
		ll per = 0;
		ll ret = query(l-1, r, 0, 0, n, per);
		ret = ret * per / period[0];
		cout << ret % MOD << endl;
	}
	return 0;
}

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

#include <iostream>
#include <algorithm>

#pragma warning(disable : 4996)

using namespace std;

int n, d, x, p[10][10], r[9][10], dp[11][100001];

int main()
{
	scanf("%d", &n);
	scanf("%d", &d);
	scanf("%d", &x);

	for (int i = 0; i < d; i++)
	{
		for (int j = 0; j < n; j++)
		{
			scanf("%d", &p[i][j]);
		}
	}

	for (int i = 0; i < d - 1; i++)
	{
		for (int j = 0; j < n; j++)
		{
			for (int k = i + 1; k < d; k++)
			{
				r[i][j] = max(r[i][j], p[k][j]);
			}
		}
	}

	for (int i = 0; i < d - 1; i++)
	{
		memset(dp, 0, sizeof(dp));

		for (int j = 1; j <= n; j++)
		{
			for (int k = 0; k <= x; k++)
			{
				dp[j][k] = dp[j - 1][k];

				if (k - r[i][j - 1] >= 0)
				{
					dp[j][k] = max(dp[j][k], dp[j][k - r[i][j - 1]] + p[i][j - 1]);
				}
			}
		}

		x = dp[n][x];
	}

	printf("%d\n", x);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:17: error: 'memset' was not declared in this scope
   37 |                 memset(dp, 0, sizeof(dp));
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 |
Language: C++

//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2607 ''Invest Master'' ????§£??????
//????????????????????? 20 ?????§?????????????????? Wrong Answer, 2 ?????????????????§ AC (Debug 10 ????????????)
//???????????£???????????¨????????¶????????±?????????????????????, i ??\?????§?????£???????????? j ??\?????§?£??????¨??????,
//i ??\?????????????????????, j ??\?????¨ i ??\????????????????????????????????¨??????????????????????????? DP ????????£??????
//i ??\????????°?????????????????§?????????????????¬???????????§????????????????????§, ?????????????????????????????????????????£??????

#include <bits/stdc++.h>

using namespace std;
int dp[10][100001];

int main()
{
	int n, d, x;
	int p[11][11];

	scanf("%d %d %d", &n, &d, &x);

	memset(diff, 0, sizeof(diff));

	for (int i = 0; i < d; i++){
		for (int j = 0; j < n; j++){
			scanf("%d", &p[i][j]);
		}
	}

	
	memset(dp, 0, sizeof(dp));
	for (int i = 0; i < d - 1; i++){
		
		for (int j = i + 1; j < d; j++){
			for (int k = 0; k < n; k++){
				for (int l = 0; l + p[i][k] <= x; l++){
					dp[j][l + p[i][k]] = max(dp[j][l + p[i][k]], dp[j][l] + p[j][k] - p[i][k]);
				}
			}
		}

		x = x + dp[i + 1][x];
	}

	printf("%d\n", x);

	return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:16: error: 'diff' was not declared in this scope
   19 |         memset(diff, 0, sizeof(diff));
      |                ^~~~
Language: C++

#include <iostream>
using namespace std;

template<class T>
T chmax(T& a, T b) { return a = max(a, b); }

const int M = 100000;
int dp[10][M + 1];

int main() {
	int n, d, x;
	cin >> n >> d >> x;
	
	int p[10][10];
	
	for(int i = 0; i < d; i++) {
		for(int j = 0; j < n; j++) {
			cin >> p[i][j];
		}
	}
	
	for(int i = 0; i < d; i++)
		for(int j = 0; j <= M; j++)
			dp[i][j] = -1;
			
	dp[0][x] = 0;
	
	for(int day = 0; day < d - 1; day++) {
		for(int budjet = M; budjet >= 0; budjet--) {
			if(dp[day][budjet] < 0) continue;
			
			for(int stock = 0; stock < n; stock++) {
					if(p[day][stock] > budjet) continue;
					
					// buy the stock
					dp[day][budjet - p[day][stock]] = max(dp[day][budjet - p[day][stock]],
																					dp[day][budjet] - p[day][stock] + p[day + 1][stock]);
					chmax(dp[day + 1][budjet - p[day][stock] + p[day + 1][stock]], dp[day][budjet] - p[day][stock] + p[day + 1][stock]);
			}
			
			// do not buy the stock
			dp[day + 1][budjet] = dp[day][budjet];
		}
	}

	// cout << endl;
	// for(int i = 0; i < d; i++)
	// 	for(int j = 0; j < 12; j++)
	// 		cout << dp[i][j] << (j == 11 ? '\n' : '\t');
	
	cout << *max_element(dp[n - 1], dp[n - 1] + M + 1) + x << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:18: error: 'max_element' was not declared in this scope
   51 |         cout << *max_element(dp[n - 1], dp[n - 1] + M + 1) + x << endl;
      |                  ^~~~~~~~~~~
Language: C++

//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2607
#include<iostream>
#include<fstream>
#dfine fin cin
using namespace std;

int n = 0;
int d = 0;
int x = 0;

int dp[100001] = {0, };
int fx[10][10];//?????????????????\????????? fx[d][n]


int main()
{
   // ifstream fin("in.txt");

    //input
    fin >> n >> d >> x;
    for(int i = 0; i < d; i++)
    {

        for(int j = 0; j < n; j++)
        {
            fin >> fx[i][j];
        }
    }

    //?????????
    for(int i = 1; i < 100001; i++)
    {
        dp[i] = -10;
    }

    //dp
    for(int day = 0; day < d - 1; day++)
    {
        for(int i = 0; i <= x; i++)dp[i] = i;
        for(int i = 0; i < n; i++) 
        {
            for(int j = 0; j <= x; j++)
            {

                int sub = j - fx[day][i];
                if(0 <= sub) 
                {

                    dp[j] = max( dp[sub] + fx[day + 1][i], dp[j] );

                }


            }
        }
        int ans_sub = 0;
        for(int k = 0; k <= 100000; k++)
            if(dp[k] > dp[ans_sub]) ans_sub = k;
        x = dp[ans_sub];
    }

    int ans_sub = 0;
    for(int i = 0; i <= 100000; i++)
        if(dp[i] > dp[ans_sub]) ans_sub = i;

    cout << dp[ans_sub] << endl; 

    return 0;
}

Compiler output:
a.cc:4:2: error: invalid preprocessing directive #dfine; did you mean #define?
    4 | #dfine fin cin
      |  ^~~~~
      |  define
a.cc: In function 'int main()':
a.cc:20:5: error: 'fin' was not declared in this scope
   20 |     fin >> n >> d >> x;
      |     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using vi=vector<int>;
using vvi=vector<vi>;
#define range(i,a,n) for(int i=a;i<n;i++)
#define rep(i,n) range(i,0,n)
#define all(a) a.begin(),a.end()

int main(){
	int n,d,x; cin>>n>>d>>x;
	vvi v(d,vi(n));
	for(auto&l:v)for(auto&i:l)cin>>i;
	rep(k,d-1){	//毎日
		vi dp(x+1);	//dp[a]=現在a円持っているとき、翌日得られる金額の最大値
		iota(all(dp),0);	//a円持っているとき、少なくともa円以上は翌日に持ち越せる
		rep(i,n)range(j,v[k][i],x+1){	//i番目の銘柄について、jが[今日の価値,今日開始時の所持金]の範囲で
			dp[j]=max(dp[j], dp[j-v[k][i]]+v[k+1][i]);
			//j円持っているときの翌日の最大金額　=
			//	max(今の所の推定最大金額,
			//		i番目の銘柄を1つ買った後の残金(j-v[k][i])から生み出せる翌日の最大金額 + 今買った商品の価値)
		}
		x=max(0,*max_element(all(dp)));	//最大値が答え。全銘柄が値下がりすると最大値が負になるので、0とmaxする
	}
	cout<<x<<endl;
	return 0;
}

	return 0;
}



Compiler output:
a.cc:28:9: error: expected unqualified-id before 'return'
   28 |         return 0;
      |         ^~~~~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<vector>
#include<utility>
#include<queue>
#define MAX 100009
using namespace std;
typedef pair<int,int> P;

typedef struct Node
{
	int n;
	vector<int>e;
}Node;

Node G[MAX];
int SC[MAX], GC[MAX],N,M,s,t;

int dijcstra(int s,int g)
{
	int C[MAX];
	memset(C,0x7f,sizeof(C));
	P tmp(0,s);
	priority_queue<P>Q;
	Q.push(tmp);
	while(!Q.empty())
	{
		tmp=Q.top();Q.pop();
		if(tmp.second==g)
			return tmp.first;
		if(tmp.first>=C[tmp.second])
			continue;
		C[tmp.second]=tmp.first;
		for(int i=0;i<G[tmp.second].e.size();i++)
		{
			int nn=G[tmp.second].e[i];
			if(C[nn]>tmp.first+1)
			{
				Q.push(make_pair(tmp.first+1,nn));
			}
		}
	}
	return -1;
}

int main()
{
	scanf("%d%d%d%d",&N,&M,&s,&t);
	s--;t--;
	for(int i=0;i<M;i++)
	{
		int x,y;
		scanf("%d%d",&x,&y);
		x--;y--;
		G[x].e.push_back(y);
		G[y].e.push_back(x);
	}
	for(int i=0;i<N;i++)
	{
		for(int i=0;i<N;i++)
		{
			SC[i]=dijcstra(s,i);
			GC[i]=dijcstra(t,i);
		}
	}
	int mc=SC[t],res=0;
	for(int i=0;i<N;i++)
		for(int j=0;j<N;j++)
		{
			if(SC[i]==-1||GC[j]==-1)continue;
			if(i!=t&&j!=s&&i!=j&&SC[i]+GC[j]+1==mc-1)
				res++;
		}
	printf("%d\n",res);
	return 0;
}

Compiler output:
a.cc: In function 'int dijcstra(int, int)':
a.cc:23:9: error: 'memset' was not declared in this scope
   23 |         memset(C,0x7f,sizeof(C));
      |         ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include<queue>
  +++ |+#include <cstring>
    7 | #define MAX 100009
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<sstream>
#include<utility>
#include<map>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>

#define MAX 100009
using namespace std;

typedef struct Node
{
	int n;
	vector<int>e;
}Node;

Node G[MAX];
int N,M,s,t,d,a,b;
long long res=0;
map<int,long long>SC,GC;
void dijcstra(int s,int g,map<int,long long>&X)
{
	int C[MAX];
	memset(C,0x7f,sizeof(C));
	P tmp(0,s);
	priority_queue<P,vector<P>,greater<P> >Q;
	Q.push(tmp);
	while(!Q.empty())
	{
		tmp=Q.top();Q.pop();
		if(tmp.first>=C[tmp.second])
			continue;
		C[tmp.second]=tmp.first;
		for(int i=0;i<G[tmp.second].e.size();i++)
		{
			int nn=G[tmp.second].e[i];
			if(C[nn]>tmp.first+1)
			{
				Q.push(make_pair(tmp.first+1,nn));
			}
		}
	}
	if(g==t)d=C[t];
	for(int i=0;i<N;i++)
		X[C[i]]++;
}

int main()
{
	scanf("%d%d%d%d",&N,&M,&s,&t);
	s--;t--;
	for(int i=0;i<M;i++)
	{
		int x,y;
		scanf("%d%d",&x,&y);
		x--;y--;
		G[x].e.push_back(y);
		G[y].e.push_back(x);
	}
	dijcstra(s,t,SC);
	dijcstra(t,s,GC);
	for(int i=0;i<=d;i++)
	{
		if(d-i-2>=0)
			res+=SC[i]*GC[d-i-2];
	}
	printf("%lld\n",res);
	return 0;
}

Compiler output:
a.cc: In function 'void dijcstra(int, int, std::map<int, long long int>&)':
a.cc:33:9: error: 'P' was not declared in this scope
   33 |         P tmp(0,s);
      |         ^
a.cc:34:34: error: template argument 2 is invalid
   34 |         priority_queue<P,vector<P>,greater<P> >Q;
      |                                  ^
a.cc:34:47: error: template argument 2 is invalid
   34 |         priority_queue<P,vector<P>,greater<P> >Q;
      |                                               ^
a.cc:34:47: error: template argument 3 is invalid
a.cc:35:11: error: request for member 'push' in 'Q', which is of non-class type 'int'
   35 |         Q.push(tmp);
      |           ^~~~
a.cc:35:16: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   35 |         Q.push(tmp);
      |                ^~~
      |                tm
a.cc:36:18: error: request for member 'empty' in 'Q', which is of non-class type 'int'
   36 |         while(!Q.empty())
      |                  ^~~~~
a.cc:38:23: error: request for member 'top' in 'Q', which is of non-class type 'int'
   38 |                 tmp=Q.top();Q.pop();
      |                       ^~~
a.cc:38:31: error: request for member 'pop' in 'Q', which is of non-class type 'int'
   38 |                 tmp=Q.top();Q.pop();
      |                               ^~~
a.cc:47:35: error: request for member 'push' in 'Q', which is of non-class type 'int'
   47 |                                 Q.push(make_pair(tmp.first+1,nn));
      |                                   ^~~~
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<queue>
#include<vector>
#include<unordered_map>
using namespace std;

int n[100000], m[100000];
vector<int>rinsetu[100000];
signed main() {
	unordered_map<int, int>X, Y;
	int a, b, c, d; scanf("%d%d%d%d", &a, &b, &c, &d); c--; d--;
	for (int e = 0; e < b; e++) {
		int f, g; scanf("%d%d", &f, &g);
		f--; g--;
		rinsetu[f].push_back(g);
		rinsetu[g].push_back(f);
	}
	memset(n, -1, sizeof(n));
	memset(m, -1, sizeof(m));
	n[c] = 0; m[d] = 0;
	queue<int>Q;
	Q.push(c);
	while (Q.size()) {
		int e = Q.front(); Q.pop();
		X[n[e]]++;
		for (int f : rinsetu[e]) {
			if (n[f] == -1) {
				n[f] = n[e] + 1;
				Q.push(f);
			}
		}
	}
	Q.push(d);
	while (Q.size()) {
		int e = Q.front(); Q.pop();
		Y[m[e]]++;
		for (int f : rinsetu[e]) {
			if (m[f] == -1) {
				m[f] = m[e] + 1;
				Q.push(f);
			}
		}
	}
	long long ans = 0;
	for (int i = 0; i < a; i++) {
		ans += X[n[d] - m[i] - 2];
		ans += Y[m[c] - n[i] - 2];
	}
	printf("%lld\n", ans / 2);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'memset' was not declared in this scope
   20 |         memset(n, -1, sizeof(n));
      |         ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include<unordered_map>
  +++ |+#include <cstring>
    7 | using namespace std;
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<queue>
#include<vector>
#include<unordered_map>
using namespace std;

int n[100000], m[100000];
vector<int>rinsetu[100000];
signed main() {
	unordered_map<int, int>X, Y;
	int a, b, c, d; scanf("%d%d%d%d", &a, &b, &c, &d); c--; d--;
	for (int e = 0; e < b; e++) {
		int f, g; scanf("%d%d", &f, &g);
		f--; g--;
		rinsetu[f].push_back(g);
		rinsetu[g].push_back(f);
	}
	memset(n, -1, sizeof(n));
	memset(m, -1, sizeof(m));
	n[c] = 0; m[d] = 0;
	queue<int>Q;
	Q.push(c);
	while (Q.size()) {
		int e = Q.front(); Q.pop();
		X[n[e]]++;
		for (int f : rinsetu[e]) {
			if (n[f] == -1) {
				n[f] = n[e] + 1;
				Q.push(f);
			}
		}
	}
	Q.push(d);
	while (Q.size()) {
		int e = Q.front(); Q.pop();
		Y[m[e]]++;
		for (int f : rinsetu[e]) {
			if (m[f] == -1) {
				m[f] = m[e] + 1;
				Q.push(f);
			}
		}
	}
	long long ans = 0;
	for (int i = 0; i < a; i++) {
		if(m[i]!=-1)ans += X[n[d] - m[i] - 2];
		if(n[i]!=-1)ans += Y[m[c] - n[i] - 2];
	}
	printf("%lld\n", ans / 2);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'memset' was not declared in this scope
   20 |         memset(n, -1, sizeof(n));
      |         ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include<unordered_map>
  +++ |+#include <cstring>
    7 | using namespace std;
Language: C++

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#define mk make_pair
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
bool vis[100000];
int main(){
  int n,m,s,t,x,y;
  cin>>n>>m>>s>>t;
  s--;t--;
  vector<int> v[100000];
  set<pair<int,int> >ss;
  r(i,m){
    cin>>x>>y;
    x--;y--;
    ss.insert(mk(x,y));
    ss.insert(mk(y,x));
    v[x].push_back(y);
    v[y].push_back(x);
  }
  int s1[n],t1[n];
  queue<pair<int,int> >q;
  q.push(mk(s,0));
  vis[s]=1;
  while(!q.empty()){
    pair<int,int>p=q.front();q.pop();
    s1[p.first]=p.second;
    int pp=p.first;
    r(i,v[pp].size()){
      if(!vis[v[pp][i]]){
    vis[v[pp][i]]=1;
    q.push(mk(v[pp][i],p.second+1));
      }
    }
  }
  memset(vis,0,sizeof(vis));
  q.push(mk(t,0));
  vis[t]=1;
  while(!q.empty()){
    pair<int,int>p=q.front();q.pop();
    t1[p.first]=p.second;
    int pp=p.first;
    r(i,v[pp].size()){
      if(!vis[v[pp][i]]){
    vis[v[pp][i]]=1;
    q.push(mk(v[pp][i],p.second+1));
      }
    }
  }
  int po=s1[t],cc=0;
  vector<int> d[100000];
  r(i,n)d[s1[i]].push_back(i);
  r(i,n){
    int tt=po-t1[i]-2;
    if(tt>-1)r(j,d[tt].size())
      if(!ss.count(mk(d[tt][j],i))){
       cc++;
      }
  }
  

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

#include<bits/stdc++.h>
#define mk make_pair
#define int long long
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
bool vis[100000];
int main(){
  int n,m,s,t,x,y;
  cin>>n>>m>>s>>t;
  s--;t--;
  vector<int> v[100000];
  set<pair<int,int> >ss;
  r(i,m){
    cin>>x>>y;
    x--;y--;
    ss.insert(mk(x,y));
    ss.insert(mk(y,x));
    v[x].push_back(y);
    v[y].push_back(x);
  }
  int s1[n],t1[n];
  memset(s1,1e6,sizeof(s1));
  memset(t1,1e6,sizeof(t1));
  queue<pair<int,int> >q;
  q.push(mk(s,0));
  vis[s]=1;
  while(!q.empty()){
    pair<int,int>p=q.front();q.pop();
    s1[p.first]=p.second;
    int pp=p.first;
    r(i,v[pp].size()){
      if(!vis[v[pp][i]]){
    vis[v[pp][i]]=1;
    q.push(mk(v[pp][i],p.second+1));
      }
    }
  }
  memset(vis,0,sizeof(vis));
  q.push(mk(t,0));
  vis[t]=1;
  while(!q.empty()){
    pair<int,int>p=q.front();q.pop();
    t1[p.first]=p.second;
    int pp=p.first;
    r(i,v[pp].size()){
      if(!vis[v[pp][i]]){
    vis[v[pp][i]]=1;
    q.push(mk(v[pp][i],p.second+1));
      }
    }
  }
  int po=s1[t],cc=0;
  vector<int> d[100000];
  r(i,n)if(s1[i]<n)d[s1[i]].push_back(i);
  r(i,n)if(t1[i]<n){
    int tt=po-t1[i]-2;
    if(tt>-1)cc+=d[tt].size();
  }
  cout<<cc<<endl;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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

// 🔴

// O(ElogE)

// pq<pair> はfirstが大きい順に出てくるのですか？
// s:= 開始ノード  v:= 頂点数  adjlist:= 隣接リスト (first:= コスト   second:= 行先)
vector<long long> dijk(int s, int v, vector<vector<pair<int, int> > > adjlist){
    
    priority_queue <pair<int, int> > wait;
    vector<int> result(v, INF);

    //スタート地点を追加
    result[s] = 0;
    wait.push(make_pair(0, s));

    //ダイクストラ本体
    while(!wait.empty()){    //waitが空になるまで

        int nowpoint = wait.top().second;
        int nowcost = -wait.top().first;
        wait.pop();

        if(result[nowpoint] < nowcost) continue;


        //今いる頂点と隣接しているすべての頂点をなめる
        for(int i = 0; i < adjlist[nowpoint].size(); i++){

            int nextpoint = adjlist[nowpoint][i].second;
            int nextcost = nowcost + adjlist[nowpoint][i].first;
            //現時点より安く到達できそうであれば、結果を更新して優先度付きキューに格納
            if(result[nextpoint] > nextcost){
                result[nextpoint] = nextcost;
                wait.push(make_pair(-nextcost, nextpoint));
            }
        }
    }
    
    return result;         //結果列を返す
}

int main(){

    int V, E, S, G; cin >> V >> E >> S >> G;     // V:= 頂点の数    E:= 辺の数    S:= スタートノード　　G:= ゴールノード
    S--;
    G--;
    vector<vector<pair<int, int> > > adjlist(V);      //first := コスト　second := 行先

    //入力
    for(int i = 0; i < E; i++){
        int a, b; cin >> a >> b;                    // a ,b 間に辺がある
        a--;
        b--;
        adjlist[a].push_back(make_pair(1, b));
        adjlist[b].push_back(make_pair(1, a));      
    }

    //int a, b; cin >> a >> b;
    //adjlist[a].push_back(make_pair(1, b));
    //adjlist[b].push_back(make_pair(1, a)); 
    

    vector<long long> result_S(V);                 //Sからの距離
    vector<long long> result_G(V);                 //Gからの距離
    result_S = dijk(S, V, adjlist);
    result_G = dijk(G, V, adjlist);    
    //cout << result[G] << endl;

    vector<long long> s(1000000, 0);
    vector<long long> g(1000000, 0);
    for(int i = 0; i < V; i++){

        if(result_S[i] < 10000000) s[result_S[i]]++;
        
        if(result_G[i] < 10000000) g[result_G[i]]++;        
    }

    long long ans = 0;
    long long dis = result_S[G] - 2;
    //cout << dis << endl;
    //result[S];
    for(int i = 0; dis - i >= 0; i++){
        
        //cout << i << " " << dis - i << " " << s[i] << " " << g[i] << endl;
        
        ans += s[i] * g[dis - i];
        //else ans += result_S[i] * result_G[dis - i] + result_S[dis - i] * result_G[i];
        //cout << i << ": " << result_S[i] << " " << result_G[i] << endl;
    }
    
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'std::vector<long long int> dijk(int, int, std::vector<std::vector<std::pair<int, int> > >)':
a.cc:43:12: error: could not convert 'result' from 'vector<int>' to 'vector<long long int>'
   43 |     return result;         //結果列を返す
      |            ^~~~~~
      |            |
      |            vector<int>
Language: C++

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

typedef long long ll;

ll w,h,v,t,x,y,p,q,R,answer;

inline ll getDist(ll dx,ll dy) { return dx*dx+dy*dy; }

ll countValue(bool phase,ll coef_x){
  ll enemy_x = p;
  if( coef_x >= 0 ) {
    if( ( coef_x & 1LL ) ) enemy_x = w - enemy_x;
    enemy_x += (coef_x*w);
  }
  else {
    if( coef_x & 1LL ) enemy_x = ( coef_x * w) + w - p;
    else               enemy_x = ( coef_x * w) + p;
  }

  ll coef_y_L = 0, coef_y_R = R / h + ( R % h != 0LL ) + 1;
  ll binary_search_solution = 0;
  ll prev = LLONG_MAX;
  rep(_,33){
    ll coef_y = ( coef_y_L + coef_y_R ) / 2LL;
    if( coef_y == prev ) break;
    prev = coef_y;
    if( !phase ) coef_y *= -1LL;
    ll enemy_y = q;
    if( phase ) {
      if( ( coef_y & 1LL ) ) enemy_y = h - enemy_y;
      enemy_y += (coef_y*h);
    } else {
      if( coef_y & 1LL ) enemy_y = ( coef_y * h) - ( h - q );
      else               enemy_y = ( coef_y * h) - q;
    }

    if(  phase ) assert( enemy_y >= 0LL );
    if( !phase ) assert( enemy_y <= 0LL );
    ll dist = getDist(x-enemy_x,y-enemy_y);

    if( dist <= R*R ) {
      binary_search_solution = max(binary_search_solution,llabs(coef_y) + 1LL);
      E = enemy_y;
      coef_y_L = llabs(coef_y);
    } else {
      coef_y_R = llabs(coef_y);
    }
  }

  return binary_search_solution;
}

int main(){
  cin >> w >> h >> v >> t >> x >> y >> p >> q;
  R = v * t;
  ll coef = R / w + ( R % w != 0LL );
  for(ll coef_x=-coef;coef_x<=coef;coef_x++){
    answer += countValue(true,coef_x);
    answer += countValue(false,coef_x);
  }
  cout << answer << endl;
  return 0;
}

Compiler output:
a.cc: In function 'll countValue(bool, ll)':
a.cc:48:7: error: 'E' was not declared in this scope
   48 |       E = enemy_y;
      |       ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define REP(i, n) FOR(i, 0, n)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define RREP(i, n) RFOR(i, n, 0)
#define MFOR(i, m) for(auto i=(m).begin();i!=(m).end();i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((int)(x).size())

typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(vector<T> const& s) {
  REP(i, SZ(s)) {
    cout << s[i];
    if(i == SZ(s)-1) {
      cout << endl;
    } else {
      cout << " ";
    }
  }
}

ll extGCD(ll a, ll b, ll &x, ll &y) {
  if(b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  ll d = extGCD(b, a%b, y, x);
  y -= a / b * x;
  return d;
}

inline ll mod(ll a, ll m) {
  return (a % m + m) % m;
}

ll modinv(ll a, ll m) {
  ll x, y;
  extGCD(a, m, x, y);
  return mod(x, m);
}

ll po(ll a, ll b, ll p) {
  int n; cin >> n;
  if(n == 0 || n == 2) {
    cout << 1 << endl;
  } else if(n == 3) {
    cout << 2 << endl;
  } else {
    cout << 0 << endl;
  }
}



Compiler output:
a.cc: In function 'll po(ll, ll, ll)':
a.cc:72:1: warning: no return statement in function returning non-void [-Wreturn-type]
   72 | }
      | ^
/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++

import math
def sieve (n):
	prime = [0,0]
	prime += [1 for i in range(n-1)]
	ub = math.sqrt(n) + 1
	d = 2
	while d <= ub:
		if prime[d] == 0:
			d += 1
			continue
		prod = 2
		while d * prod <= n:
			prime[d*prod] = 0
			prod += 1
		d += 1
	return prime
n = int(raw_input())
pn = 1
for i in range(n):
	pn *= 2
prime = sieve(pn*100)
pn += 1
while 1:
	if prime[pn] == 1:
		break
	pn += 1
print int(format(2**(pn-1)-1, "b")) % pn

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

//?°???\????????????????????????
int main(){
	int n;
	cin >> n;
	int ans = 0;
	if(n==0)
		ans = 1;
	else if(n==1)
		ans = 2;
	else if(n==2)
		ans = 1;
	else
		ans = 0;
	cout << ans << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:41:29: error: expected '}' at end of input
   41 |         cout << ans << endl;
      |                             ^
a.cc:29:11: note: to match this '{'
   29 | int main(){
      |           ^
Language: C++

#include<cstdio>
#define a(b)printf("%d\n",b);
main(){scanf("%d",&n);if(n==1){a(2);}else if(n<3){a(1);}else{a(0);}}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){scanf("%d",&n);if(n==1){a(2);}else if(n<3){a(1);}else{a(0);}}
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:20: error: 'n' was not declared in this scope
    3 | main(){scanf("%d",&n);if(n==1){a(2);}else if(n<3){a(1);}else{a(0);}}
      |                    ^
Language: C++

#include<cstdio>
#define a(b)printf("%d\n",b);int n;
main(){scanf("%d",&n);if(n==1){a(2);}else if(n<3){a(1);}else{a(0);}}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){scanf("%d",&n);if(n==1){a(2);}else if(n<3){a(1);}else{a(0);}}
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:20: error: 'n' was not declared in this scope
    3 | main(){scanf("%d",&n);if(n==1){a(2);}else if(n<3){a(1);}else{a(0);}}
      |                    ^
Language: C++

#include <iostream>
using namespace std;

int main()
{
    cout<<(n>2 ? 0 : 1+(n==1))<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: 'n' was not declared in this scope
    6 |     cout<<(n>2 ? 0 : 1+(n==1))<<endl;
      |            ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for (int i=0;i<(n);i++)
#define ALL(a) (a).begin(),(a).end()
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define ll long long
#define ull unsigned long long
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

using namespace std;

int main(){
  int n;
  cin >> n;
  if(n==0||n==2)n=1;
  else if(n==1)n=2;
  else if n=0;
  cout << n << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: expected '(' before 'n'
   19 |   else if n=0;
      |           ^
      |           (
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int n;
  cin>>n;

  if(n==0){
    cout<<"1"<<endl;
  }else if(n==1){
    cout<<"2"<<endl;
  }else if(n==2){
    cout<<"1"<<endl;
  }else{
    cout<<"0"<<endl;

  return 0;
}

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

#include<bits/stdc++.h>

int main(){
int n;
cin>>n;
if(n==0||n==2)cout<<1<<endl;
else if(n==1)cout<<2<<endl;
else cout<<0<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 | cin>>n;
      | ^~~
      | std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:15: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 | if(n==0||n==2)cout<<1<<endl;
      |               ^~~~
      |               std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:6:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 | if(n==0||n==2)cout<<1<<endl;
      |                        ^~~~
      |                        std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:7:14: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 | else if(n==1)cout<<2<<endl;
      |              ^~~~
      |              std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:7:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 | else if(n==1)cout<<2<<endl;
      |                       ^~~~
      |                       std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:8:6: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 | else cout<<0<<endl;
      |      ^~~~
      |      std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:8:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 | else cout<<0<<endl;
      |               ^~~~
      |               std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>

using namespace std;

int main(){
	cin >> x;
	if(x==0) cout << 1 << endl;
	else if(x==1) cout << 2 << endl;
	else if(x==2) cout << 1 << endl;
	else cout << 0 << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'x' was not declared in this scope
   13 |         cin >> x;
      |                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if(n == 0 || n == 2) cout<<1<<endl;
  else if(n == 1) cout<<2<<endl;;
  else cout<<0<<endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'else' without a previous 'if'
    8 |   else cout<<0<<endl;
      |   ^~~~
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args) {
    Scanner scan= new Scanner(System.in);
    boolean[][] trump = new boolean[4][13];
    char[] head = {'S' , 'H' , 'C' , 'D'};
    int n = scan.nextInt();
    for (int i = 0; i < n ; i++ ) {
      char head_in = scan.next().charAt(0);
      int num = Integer.parseInt(in.next());

      switch(head_in){
        case 'S':trump[0][num-1] = true;break;
        case 'H':trump[1][num-1] = true;break;
        case 'C':trump[2][num-1] = true;break;
        case 'D':trump[3][num-1] = true;break;
      }
    }
    for (int i =0 ;i < 4 ;i++ ) {
      for (int j = 0;j < 13 ;j++ ) {
        if (trump[i][j] == false) {
          System.out.println(head[i]+" "+(j+1));

        }

      }

    }
  }
}

Compiler output:
Main.java:10: error: cannot find symbol
      int num = Integer.parseInt(in.next());
                                 ^
  symbol:   variable in
  location: class Main
1 error
Language: Java

import java.util.*;
class Main{
  public static void main(String[] args) {
    Scanner scan= new Scanner(System.in);
    boolean[][] trump = new boolean[4][13];
    char[] head = {'S' , 'H' , 'C' , 'D'};
    int n = scan.nextInt();
    for (int i = 0; i < n ; i++ ) {
      char head_in = scan.next().charAt(0);
      int num = Integer.parseInt(in.next());

      switch(head_in){
        case 'S':trump[0][num-1] = true;break;
        case 'H':trump[1][num-1] = true;break;
        case 'C':trump[2][num-1] = true;break;
        case 'D':trump[3][num-1] = true;break;
      }
    }
    for (int i =0 ;i < 4 ;i++ ) {
      for (int j = 0;j < 13 ;j++ ) {
        if (trump[i][j] == false) {
          System.out.println(head[i]+" "+(j+1));

        }

      }

    }
  }
}

Compiler output:
Main.java:10: error: cannot find symbol
      int num = Integer.parseInt(in.next());
                                 ^
  symbol:   variable in
  location: class Main
1 error
Language: C++

#include <cstdio>
#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
using int64 = long long int;

int N;
vector<int> G[210];

int dpc[210][210][2], dpn[210][210][2];
vector<int64> merge(vector<int64> A, vector<int64> B) {
  fill(dpc[0][0], dpc[B.size()][0], 0);
  dpc[0][0][0] = 1;

  vector<int64> res(A.size() + B.size());
  for(size_t i=0; i<A.size(); i++) {
    for(size_t j=0; j<B.size(); j++) {
      for(size_t k=0; k<=j; k++) {
        // orig: i, new: j, double: k
        // total: i + j - k + 1
        (res[i + j - k + 1] += A[i] * B[j] % MOD * (dpc[j][k][0] + dpc[j][k][1]) % MOD) %= MOD;
        
        if(i == A.size()) continue;
        {
          // f = false
          int64 &val = dpc[j][k][false];
          (dpn[j+1][k][false] += val) %= MOD;
          (dpn[j+1][k+1][true] += val) %= MOD;
          (dpn[j][k][false] += val) %= MOD;
        }
        {
          // f = true
          int64 &val = dpc[j][k][true];
          (dpn[j+1][k+1][true] += val) %= MOD;
          (dpn[j][k][false] += val) %= MOD;
        }
        dpc[j][k][true] = dpc[j][k][false] = 0;
      }
    }
    swap(dpc, dpn);
  }
  return res;
}

vector<int64> solve(int cur) {
  vector<int64> res(1, 1);
  for(auto to : G[cur]) {
    auto vec = solve(to);
    res = merge(res, vec);
  }
  return res;
}

int main() {
  cin >> N;
  for(int i=0; i<N-1; i++) {
    int a, b; cin >> a >> b; a--; b--;
    G[a].push_back(b);
  }

  auto res = solve(0);
  int64 ans = 0;
  for(auto e : res) (ans += e) %= MOD;
  cout << ans << endl;
  return 0;
}

#error "four-t"


Compiler output:
a.cc:69:2: error: #error "four-t"
   69 | #error "four-t"
      |  ^~~~~
a.cc: In function 'std::vector<long long int> merge(std::vector<long long int>, std::vector<long long int>)':
a.cc:22:46: error: 'MOD' was not declared in this scope
   22 |         (res[i + j - k + 1] += A[i] * B[j] % MOD * (dpc[j][k][0] + dpc[j][k][1]) % MOD) %= MOD;
      |                                              ^~~
a.cc:27:39: error: cannot bind non-const lvalue reference of type 'int64&' {aka 'long long int&'} to a value of type 'int'
   27 |           int64 &val = dpc[j][k][false];
      |                        ~~~~~~~~~~~~~~~^
a.cc:34:38: error: cannot bind non-const lvalue reference of type 'int64&' {aka 'long long int&'} to a value of type 'int'
   34 |           int64 &val = dpc[j][k][true];
      |                        ~~~~~~~~~~~~~~^
a.cc: In function 'int main()':
a.cc:64:35: error: 'MOD' was not declared in this scope
   64 |   for(auto e : res) (ans += e) %= MOD;
      |                                   ^~~
Language: C++

#include <cstdio>
#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
using int64 = long long int;
constexpr int64 MOD = 1000000007;

int N;
vector<int> G[210];

int64 dpc[210][210][2], dpn[210][210][2];
vector<int64> merge(vector<int64> A, vector<int64> B) {
  fill(dpc[0][0], dpc[B.size()][0], 0);
  dpc[0][0][0] = 1;

  vector<int64> res(A.size() + B.size());
  for(size_t i=0; i<A.size(); i++) {
    for(size_t j=0; j<B.size(); j++) {
      for(size_t k=0; k<=j; k++) {
        // orig: i, new: j, double: k
        // total: i + j - k + 1
        (res[i + j - k + 1] += A[i] * B[j] % MOD * (dpc[j][k][0] + dpc[j][k][1]) % MOD) %= MOD;
        
        {
          // f = false
          int64 &val = dpc[j][k][false];
          (dpn[j+1][k][false] += val) %= MOD;
          (dpn[j+1][k+1][true] += val) %= MOD;
          (dpn[j][k][false] += val) %= MOD;
        }
        {
          // f = true
          int64 &val = dpc[j][k][true];
          (dpn[j+1][k+1][true] += val) %= MOD;
          (dpn[j][k][false] += val) %= MOD;
        }
        dpc[j][k][true] = dpc[j][k][false] = 0;
      }
    }
    swap(dpc, dpn);
  }
  return res;
}

void dump_vec(vector<int64> vec) {
  for(size_t i=0; i<vec.size(); i++) {
    fprintf(stderr, "%lld%c", vec[i], i+1==vec.size()?'\n':' ');
  }
}

vector<int64> solve(int cur) {
  fprintf(stderr, "solve: %d\n", cur);
  vector<int64> res(1, 1);
  for(auto to : G[cur]) {
    auto vec = solve(to);
    res = merge(res, vec);
  }
  res.insert(res.begin(), 0LL);

  fprintf(stderr, "dump: %d\n", cur);
  dump_vec(res);
  return res;
}

int main() {
  cin >> N;
  for(int i=0; i<N-1; i++) {
    int a, b; cin >> a >> b;
    G[a].push_back(b);
  }

  auto res = solve(0);
  int64 ans = 0;
  for(auto e : res) (ans += e) %= MOD;
  cout << ans << endl;
  return 0;
}

#error "uku"


Compiler output:
a.cc:80:2: error: #error "uku"
   80 | #error "uku"
      |  ^~~~~