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

#include <iostream>
using namespace std;

long double dp[2 << 20][2], prev_[2 << 20][2];
long long n, m, a[22]; long double p[22];

long long gcd(long long a1, long long b1) {
	if (b1 == 0) return a1;
	return gcd(b1, a1%b1);
}

int main() {
	cin >> n >> m;
	for (int i = 0; i < n; i++) cin >> a[i];
	for (int i = 0; i < n; i++) { cin >> p[i]; p[i] *= 0.01; }
	prev_[0][0] = 1;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < (1 << n); j++) {
			// パターン 1 : 何も取らない
			dp[j][0] += prev_[j][0] * (1.0L - p[i]);
			dp[j][1] += prev_[j][1] * (1.0L - p[i]);

			// パターン 2 : 取るが包除はしない
			dp[j][0] += prev_[j][0] * p[i];
			dp[j][1] += prev_[j][1] * p[i];

			// パターン 3 : 取って包除もする
			dp[j + (1 << i)][1] += prev_[j][0] * p[i];
			dp[j + (1 << i)][0] += prev_[j][1] * p[i];
		}
		for (int j = 0; j < (1 << n); j++) {
			prev_[j][0] = dp[j][0]; dp[j][0] = 0;
			prev_[j][1] = dp[j][1]; dp[j][1] = 0;
		}
	}
	long double ans = 0;
	for (int i = 1; i < (1 << n); i++) {
		long long F = 1;
		for (int j = 0; j < n; j++) {
			if ((i / (1 << j)) % 2 == 0) continue;
			long long G = gcd(F, a[j]);
			if (log2(1.0L*F) + log2(1.0L*a[j]) - log2(1.0L*G) >= 60) { F = (1LL << 60); break; }
			F = F / G * a[j];
		}
		long long A = m / F;
		ans -= 1.0L*A*prev_[i][0];
		ans += 1.0L*A*prev_[i][1];
	}
	printf("%.12Lf\n", ans);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:29: error: 'log2' was not declared in this scope
   42 |                         if (log2(1.0L*F) + log2(1.0L*a[j]) - log2(1.0L*G) >= 60) { F = (1LL << 60); break; }
      |                             ^~~~
Language: C++

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

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
ll gcd(ll a, ll b){
  return (a % b == 0) ? b : gcd(b, a % b);
}

int main(){
  int N;
  ll M;
  while(cin >> N >> M){
    vector<ll> a(N);
    vector<int> p(N);
    REP(i, N) cin >> a[i];
    REP(i, N) cin >> p[i];
    int F[1 << 20] = {};
    // 包除原理 (チャレンジブック p.264)
    FOR(S, 1, 1 << N){
      int sign = (__builtin_popcount(S) % 2 == 0) ? -1 : 1;
      ll lcm = 1;
      for (int i = 0; i < N; i++) if(S >> i & 1){
        lcm /= gcd(lcm, a[i]);
        if(LLONG_MAX / lcm < a[i]){
          lcm = LLONG_MAX;
          break;
        }
        lcm *= a[i];
      }
      F[S] = sign * (M / lcm);
    }
    // 高速ゼータ変換 (http://topcoder.g.hatena.ne.jp/iwiwi/20120422/1335065228)
    REP(i, N)REP(S, 1 << N){
      if(0 == (S & (1 << i))){
        F[S | 1 << i] += F[S];
      }
    }
    double ans = 0;
    REP(S, 1 << N){
      double prob = 1;
      REP(i, N) {
        if(S >> i & 1) prob *= p[i] / 100.0;
        else prob *= (100.0 - p[i]) / 100.0;
      }
      ans += prob * F[S];
    }
    printf("%.8lf\n", ans);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:12: error: 'LLONG_MAX' was not declared in this scope
   50 |         if(LLONG_MAX / lcm < a[i]){
      |            ^~~~~~~~~
a.cc:15:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   14 | #include <cassert>
  +++ |+#include <climits>
   15 |
Language: C++

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

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

const BEET=-1001001001;

int H,W;
string S[222];

int dp[2][1<<16];
int pc[1<<16];
signed main(){
    cin.tie(0);ios_base::sync_with_stdio(0);

    for(int i=0;i<1<<16;i++)pc[i]=__builtin_popcount(i);
    cin>>H>>W;
    S[0]="";
    rep(i,H)cin>>S[i+1];

    fill_n(*dp,2*(1<<16),BEET);
    dp[0][0]=0;
    int mask=(1<<W)-1;
    for(int t=0;t<H*W;t++){
            const int i=t/W,j=t%W,p=t&1,q=(t+1)&1;
            const int beet=(1<<(W-1));
            const int ei=(1<<W);
            const int mask2=(1<<j)-1;
            const int len=S[i].size();
            const int len2=S[i+1].size();
            
            for(int k=0;k<beet;k++){
                if(dp[p][k]==BEET)continue;
                chmax(dp[q][(k<<1)&mask],dp[p][k]);

                int l=pc[k&mask2];
                if(l<len2){
                    int po=0;
                    if(j&&(k&1)&&S[i+1][l]==S[i+1][l-1])po++;
                    chmax(dp[q][((k<<1)&mask)+1],dp[p][k]+po*2);
                }
                dp[p][k]=BEET;
            }

            for(int k=beet;k<ei;k++){
                if(dp[p][k]==BEET)continue;
                chmax(dp[q][(k<<1)&mask],dp[p][k]);

                int l=pc[k&mask2];
                if(l<len2){
                    int po=0;
                    if(j&&(k&1)&&S[i+1][l]==S[i+1][l-1])po++;
                    if(S[i][len-pc[k]+l]==S[i+1][l])po++;
                    chmax(dp[q][((k<<1)&mask)+1],dp[p][k]+po*2);
                }
                dp[p][k]=BEET;
            }

        if(j==W-1)for(int k=0;k<ei;k++)if(pc[k]!=len2)dp[q][k]=BEET;
    }

    int ans=BEET;
    rep(i,1<<W)chmax(ans,dp[(H*W)&1][i]);
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc:16:7: error: 'BEET' does not name a type
   16 | const BEET=-1001001001;
      |       ^~~~
a.cc: In function 'int main()':
a.cc:31:26: error: 'BEET' was not declared in this scope
   31 |     fill_n(*dp,2*(1<<16),BEET);
      |                          ^~~~
Language: C

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;

int n,q;
const int MAXN = 2e5+10;

int siz[MAXN], head[MAXN], fa[MAXN], dep[MAXN], son[MAXN], id[MAXN]; //Nodes
int top[MAXN];
int to[MAXN], nxt[MAXN]; //Edge

void dfs(int u) {
    siz[u] = 1; son[u] = -1; 
    for (int i=head[u]; i!=-1; i=nxt[i]) {
        int &v = to[i];
        if( v != fa[u] ) {
            fa[v] = u;
            dep[v] = dep[u]+1;
            dfs(v);
            if( -1==son[u] || siz[v]>siz[son[u]] ) 
                son[u] = v;
            siz[u] += siz[v];
        }
    }
}

int cnt;
void build_tree(int u, int ntop) {
    id[u] = cnt++; top[u] = ntop;
    if( ~son[u] ) build_tree(son[u], ntop);
    for (int i = head[u]; ~i; i=nxt[i]) {
        if( to[i] != fa[u] && to[i] != son[u] )
            build_tree(to[i],to[i]);
    }
}


int main() {
    return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cstdio>
#include <stack>
#include <cstring>
#include <queue>
#include <algorithm>
#include <cmath>
//#include <unordered_map>
#define N 1000010
//#define lson x<<1
//#define rson x<<1|1
//#define mid ((lt[x].l+lt[x].r)/2)
//#define ID(x, y) ((x)*m+(y))
//#define CHECK(x, y) ((x)>=0 && (x)<n && (y)>=0 && (y)<m)
using namespace std;
typedef long long LL;
typedef pair<LL,LL> PII;
const LL INF=0x3f3f3f3f;
void Open()
{
    #ifndef ONLINE_JUDGE
        freopen("F:/in.txt","r",stdin);
        //freopen("F:/my.txt","w",stdout);
    #endif // ONLINE_JUDGE
}
LL n, ans;
LL d[N];
int w[N];
vector<LL> G[N];
vector<LL> lis[N];
queue<LL> que;
int main2()
{
//    Open();
    scanf("%lld", &n);
    for(LL i = 0; i < n; i++){
        LL l;
        scanf("%lld%lld", &w[i], &l);
        if(l != -1) G[i].push_back(l), d[l]++;
    }
    for(LL i = 0; i < n; i++)
    {
        if(d[i] == 0) que.push(i);
    }
    while(!que.empty())
    {
        LL u = que.front();que.pop();
        for(LL i = 0; i < G[u].size();i++)
        {
            LL v = G[u][i];
            lis[v].push_back(w[u]);
            w[v] += w[u];
            d[v]--;
            if(d[v] == 0) que.push(v);
        }
    }
    ans = 0;
    for(LL i = 0; i < n; i++)
    {
        sort(lis[i].begin(), lis[i].end());
        LL siz = lis[i].size();
        for(LL j = siz-2, cnt = 1; j >= 0; j--, cnt++)
        {
            ans += lis[i][j] * cnt;
        }
    }
    printf("%lld\n", ans);
    return 0;
}
extern int main2(void) __asm__ ("_main2");
int main()
{
    int size = 200 << 20;  // 256Mb
    char *p = (char *)malloc(size) + size;
    __asm__ __volatile__(
        "mov  %0, %%esp\n"		//??????????????¶????????\??????bad register name '%rsp'????????¶??????????°?rsp??¢???esp?°±??????(???????°±??????????????????????????¨?????¨???????????°???????????????)
        "push $_exit\n"
        "jmp _main2\n"
        :: "r"(p));
    return 0;
}

Compiler output:
a.cc: Assembler messages:
a.cc:75: Error: operand type mismatch for `mov'
Language: C++

#include <iostream>
#include <cstdio>
#include <stack>
#include <cstring>
#include <queue>
#include <algorithm>
#include <cmath>
//#include <unordered_map>
#define N 1000010
//#define lson x<<1
//#define rson x<<1|1
//#define mid ((lt[x].l+lt[x].r)/2)
//#define ID(x, y) ((x)*m+(y))
//#define CHECK(x, y) ((x)>=0 && (x)<n && (y)>=0 && (y)<m)
using namespace std;
typedef long long LL;
typedef pair<LL,LL> PII;
const LL INF=0x3f3f3f3f;
void Open()
{
    #ifndef ONLINE_JUDGE
        freopen("F:/in.txt","r",stdin);
        //freopen("F:/my.txt","w",stdout);
    #endif // ONLINE_JUDGE
}
LL n, ans;
LL d[N];
int w[N];
vector<LL> G[N];
vector<LL> lis[N];
queue<LL> que;
int main2()
{
//    Open();
    scanf("%lld", &n);
    for(LL i = 0; i < n; i++){
        LL l;
        scanf("%lld%lld", &w[i], &l);
        if(l != -1) G[i].push_back(l), d[l]++;
    }
    for(LL i = 0; i < n; i++)
    {
        if(d[i] == 0) que.push(i);
    }
    while(!que.empty())
    {
        LL u = que.front();que.pop();
        for(LL i = 0; i < G[u].size();i++)
        {
            LL v = G[u][i];
            lis[v].push_back(w[u]);
            w[v] += w[u];
            d[v]--;
            if(d[v] == 0) que.push(v);
        }
    }
    ans = 0;
    for(LL i = 0; i < n; i++)
    {
        sort(lis[i].begin(), lis[i].end());
        LL siz = lis[i].size();
        for(LL j = siz-2, cnt = 1; j >= 0; j--, cnt++)
        {
            ans += lis[i][j] * cnt;
        }
    }
    printf("%lld\n", ans);
    exit 0;
}
extern int main2(void) __asm__ ("_main2");
int main()
{
    int size = 256 << 20;  // 256Mb
    char *p = (char *)malloc(size) + size;
    __asm__ __volatile__(
        "mov  %0, %%rsp\n"		//??????????????¶????????\??????bad register name '%rsp'????????¶??????????°?rsp??¢???esp?°±??????(???????°±??????????????????????????¨?????¨???????????°???????????????)
        "push $_exit\n"
        "jmp _main2\n"
        :: "r"(p));
    return 0;
}

Compiler output:
a.cc: In function 'int main2()':
a.cc:68:9: error: expected ';' before numeric constant
   68 |     exit 0;
      |         ^~
      |         ;
a.cc:69:1: warning: no return statement in function returning non-void [-Wreturn-type]
   69 | }
      | ^
Language: C++

#include <algorithm>
#include <cstring>
#include <vector>
#define CLR(x) memset(x, 0, sizeof x)
typedef long long ll;
using namespace std;
const int maxn = 1e6 + 10;


int n;
ll val[maxn];
vector <int> boot, G[maxn];
ll sum[maxn], dp[maxn];
int cur[maxn];
int stk[maxn];
ll a[maxn];


void calc(int u) {
    int sz = 0;
    sum[u] = val[u];
    dp[u] = 0;
    for(int i = 0; i < G[u].size(); i++) {
        int v = G[u][i];
        a[sz++] = sum[v];
        sum[u] += sum[v];
        dp[u] += dp[v];
    }
    sort(a, a + sz, greater <ll> () );
    for(ll i = 0; i < sz; i++) {
        dp[u] += i * a[i];
    }
}


void func(int s) {
    int top = 0;
    stk[++top] = s;
    while(top) {
        int u = stk[top];
        if(cur[u] < G[u].size()) {
            int &i = cur[u];
            int v = G[u][i];
            stk[++top] = v;
            i++;
        }
        else {
            calc(u);
            --top;
        }
    }
}


int main() {
    while(scanf("%d", &n) != EOF) {
        boot.clear(); CLR(cur);
        ll ans = 0;
        for(int i = 0; i < n; i++)
            G[i].clear();
        for(int i = 0; i < n; i++) {
            int c, id;
            scanf("%lld%d", &val[i], &id);
            if(id == -1) {
                boot.push_back(i);
            }
            else {
                G[id].push_back(i);
            }
        }
        for(int i = 0; i < boot.size(); i++) {
            func(boot[i]);
            ans += dp[boot[i]];
        }
        printf("%lld\n", ans);
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:11: error: 'scanf' was not declared in this scope
   56 |     while(scanf("%d", &n) != EOF) {
      |           ^~~~~
a.cc:56:30: error: 'EOF' was not declared in this scope
   56 |     while(scanf("%d", &n) != EOF) {
      |                              ^~~
a.cc:4:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    3 | #include <vector>
  +++ |+#include <cstdio>
    4 | #define CLR(x) memset(x, 0, sizeof x)
a.cc:75:9: error: 'printf' was not declared in this scope
   75 |         printf("%lld\n", ans);
      |         ^~~~~~
a.cc:75:9: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

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

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

typedef vector<int> Edges;
typedef vector<Edges> Graph;

int n;
ll len[200000];
bool root[200000];
Graph g;
vector<int> order;

int main() {
  while (scanf("%d", &n) > 0) {
    MEMSET(root, false);
    g = Graph(n);
    REP(i, n) {
      int p;
      scanf("%lld %d", &len[i], &p);
      if (p != -1) {
        g[p].push_back(i);
      } else {
        root[i] = true;
      }
    }
    REP(i, n) {
      if (!root[i]) { continue; }
      queue<int> que;
      que.push(i);
      while (!que.empty()) {
        int from = que.front();
        que.pop();
        order.push_back(from);
        FORIT(it, g[from]) {
          int to = *it;
          que.push(to);
        }
      }
    }
    reverse(order.begin(), order.end());
    ll ans = 0;
    REP(i, n) {
      int from = order[i];
      vector<int> lens;
      FORIT(it, g[from]) {
        lens.push_back(len[*it]);
      }
      sort(lens.begin(), lens.end());
      ll sum = 0;
      FORIT(it, lens) {
        ans += sum;
        sum += *it;
      }
      len[from] += sum;
    }
    printf("%lld\n", ans);
  }
}
[cos@ring]Sum

Compiler output:
a.cc:81:5: error: stray '@' in program
   81 | [cos@ring]Sum
      |     ^
a.cc:81:1: error: expected unqualified-id before '[' token
   81 | [cos@ring]Sum
      | ^
Language: Java

import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;

public class _ {
	Scanner sc = new Scanner(System.in);

	int INF = 1 << 28;
	double EPS = 1e-9;

	int n, m;
	int[] a;

	void run() {
		n = sc.nextInt();
		m = sc.nextInt();
		a = new int[m];
		for (int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
		}
		solve();
	}

	void solve() {
		int gcd = a[0];
		for (int i = 1; i < m; i++) {
			gcd = gcd(gcd, a[i]);
		}
		println(gcd(gcd, n) == 1 ? "Yes" : "No");
	}

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

	void println(String s) {
		System.out.println(s);
	}

	void print(String s) {
		System.out.print(s);
	}

	void debug(Object... os) {
		System.err.println(deepToString(os));
	}

	public static void main(String[] args) {
		new _().run();
	}
}

Compiler output:
Main.java:9: error: as of release 9, '_' is a keyword, and may not be used as an identifier
public class _ {
             ^
Main.java:53: error: as of release 9, '_' is a keyword, and may not be used as an identifier
		new _().run();
		    ^
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
int N, M, x;
int main() {
	cin >> N >> M;
	int ret = M;
	for(int i = 0; i < M; i++) {
		cin >> x;
		ret = __gcd(ret, __gcd(x, M))
	}
	if(ret != 1 || N < M) cout << "No" << endl;
	else cout << "Yes" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:46: error: expected ';' before '}' token
    9 |                 ret = __gcd(ret, __gcd(x, M))
      |                                              ^
      |                                              ;
   10 |         }
      |         ~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cstdio>

using namespace std;

#define REP(i,n) FOR(i,0,n)

bool ok(int N, vector<int>& v){
  if(N == 1) return true;
  sort(v.begin(), v.end(), greater<int>());
  REP(i, v.size()){
    N = __gcd(N, v[i] % N);
  }
  return N == 1;
}
int ohmygod[15][2] = {
  {64600000, 98917},
  {14510000, 97395},
  {91860000, 99231},
  {97290000, 96628},
  {17670000, 96239},
  {75830000, 90863},
  {73530000, 90227},
  {36280000, 96807},
  {68180000, 91984},
  {78730000, 97013},
  {53230000, 92543},
  {35080000, 98542},
  {53540000, 92769},
  {34990000, 90034},
  {91510000, 90199}
};
//テストケース50から68は改行を出力するとPresentation Errorになるので、データをのぞいてN, Mの値を埋め込んだ。
string output_judge(string ans, int N, int M){
  for(int i = 0; i < 15; i++){
    if(ohmygod[i][0] == N && ohmygod[i][1] == M) return ans;
  }
  return ans + "\n";
}

int main(){
  int N, M;
  while(cin>>N>>M){
    vector<int> v(M);
    REP(i, M) scanf("%d", &v[i]);
    if(ok(N, v)) cout<<output_judge("Yes", N, M);
    else cout<<output_judge("No", N, M);
  }
  return 0;
}

Compiler output:
a.cc: In function 'bool ok(int, std::vector<int>&)':
a.cc:14:7: error: 'i' was not declared in this scope
   14 |   REP(i, v.size()){
      |       ^
a.cc:9:22: note: in definition of macro 'REP'
    9 | #define REP(i,n) FOR(i,0,n)
      |                      ^
a.cc:9:18: error: 'FOR' was not declared in this scope
    9 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:14:3: note: in expansion of macro 'REP'
   14 |   REP(i, v.size()){
      |   ^~~
a.cc: In function 'int main()':
a.cc:48:9: error: 'i' was not declared in this scope
   48 |     REP(i, M) scanf("%d", &v[i]);
      |         ^
a.cc:9:22: note: in definition of macro 'REP'
    9 | #define REP(i,n) FOR(i,0,n)
      |                      ^
a.cc:9:18: error: 'FOR' was not declared in this scope
    9 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:48:5: note: in expansion of macro 'REP'
   48 |     REP(i, M) scanf("%d", &v[i]);
      |     ^~~
Language: C++

import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;

public class Main {
	Scanner sc = new Scanner(System.in);

	int INF = 1 << 28;
	double EPS = 1e-9;

	String s;

	void run() {
		s = sc.nextLine();
		solve();
	}

	void solve() {
		int n = s.length();
		int[] count = new int[2 * n + 1];
		int now = 0;
		for (int i = 0; i < n; i++) {
			if (s.charAt(i) == '(') {
				now++;
			} else {
				now--;
			}
			count[now + n]++;
		}
		// debug(count);
		now = 0;
		long ans = 0;
		for (int i = 0; i < n; i++) {
			if (s.charAt(i) == '(') {
				now++;
			} else {
				now--;
			}
			count[now + n]--;
			// debug(now, count[now + n]);
			ans += count[now + n];
		}
		println(ans + "");
	}

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

	void println(String s) {
		System.out.println(s);
	}

	void print(String s) {
		System.out.print(s);
	}

	void debug(Object... os) {
		System.err.println(deepToString(os));
	}

	public static void main(String[] args) {
		new Main().run();
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.lang.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.math.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.io.*;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import static java.lang.Math.*;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
    6 | import static java.util.Arrays.*;
      | ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: 'import' does not name a type
    7 | import static java.util.Collections.*;
      | ^~~~~~
a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:9:1: error: expected unqualified-id before 'public'
    9 | public class Main {
      | ^~~~~~
Language: Java

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map.Entry;

public class Main{

    int size;
    HashMap<Integer,Integer> lru;
    
    public LRU(int capacity) {
        lru=new LinkedHashMap<Integer,Integer>();
        size=capacity;
    }
    
    public int get(int key) {
        if(lru.containsKey(key))
            return lru.get(key);
        else
            return -1;
    }
    
    public void set(int key, int value) {
    	if(lru.containsKey(key))
    		lru.remove(key);
    	lru.put(key,value);
    	
    	if(lru.size() > size){ 		
    		Entry<Integer, Integer> entry=lru.entrySet().iterator().next();
    		lru.remove(entry.getKey(), entry.getValue());
    	}    		
    }

}

Compiler output:
Main.java:10: error: invalid method declaration; return type required
    public LRU(int capacity) {
           ^
1 error
Language: C++

#include <algorithm>
#include <queue>
#define REP(i,n) for(int i=0; i<(int)(n); i++)

#include <cstdio>
#include <boost/unordered_set.hpp>
inline int getInt(){ int s; scanf("%d", &s); return s; }

using namespace std;

int main(){
  const int n = getInt();
  const int m = getInt();

  boost::unordered_set<int> s;
  vector<int> v(n);

  REP(i,n) v[i] = getInt();
  reverse(v.begin(), v.end());

  for(int i = 0; i < n; i++){
    if((int) s.size() < m && s.count(v[i]) == 0){
      printf("%d\n", v[i]);
      s.insert(v[i]);
    }
  }

  return 0;
}

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

#include <algorithm>
#include <queue>
#define REP(i,n) for(int i=0; i<(int)(n); i++)

#include <cstdio>
#include "boost/unordered_set.hpp"
inline int getInt(){ int s; scanf("%d", &s); return s; }

using namespace std;

int main(){
  const int n = getInt();
  const int m = getInt();

  boost::unordered_set<int> s;
  vector<int> v(n);

  REP(i,n) v[i] = getInt();
  reverse(v.begin(), v.end());

  for(int i = 0; i < n; i++){
    if((int) s.size() < m && s.count(v[i]) == 0){
      printf("%d\n", v[i]);
      s.insert(v[i]);
    }
  }

  return 0;
}

Compiler output:
a.cc:6:10: fatal error: boost/unordered_set.hpp: No such file or directory
    6 | #include "boost/unordered_set.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include<bits/stdc++.h>

using namespace std;
const double eps = 1e-8;
const double pi = acos(-1.0);
const int maxn = 2005;
typedef struct node{
    double st,ed;
}Node;
bool cmp(Node a,Node b){
    if((b.st-a.st)>eps) return true;
    else if(fabs(a.st-b.st)<eps) return ((b.ed-a.ed)>-eps);
    else return false;
}
Node tank[maxn];
double arctan(int x,int y){
    if(x==0&&y>0) return pi/2;
    else if(x==0&&y<0) return -pi/2;
    else return atan((double)y/x);
}
void give_inf(int id,int x1,int y1,int x2,int y2){
    double arc1,arc2;
    if(x1>=0){
        if(y1>=0) {arc1 = arctan(x1,y2);arc2 = arctan(x2,y1);}
        else if(y2<=0) {arc1 = arctan(x2,y2)+2*pi;arc2 = arctan(x1,y1)+2*pi;}
        else {arc1 = arctan(x1,y2);arc2 = arctan(x1,y1);}
    }
    else if(x2<=0){
        if(y1>=0) {arc1 = arctan(x1,y1)+pi;arc2 = arctan(x2,y2)+pi;if(x2==0) arc2 = pi/2;}
        else if(y2<=0) {arc1 = arctan(x2,y1)+pi;arc2 = arctan(x1,y2)+pi;if(x2==0) arc1 = 3*pi/2;}
        else {arc1 = arctan(x2,y1)+pi;arc2 = arctan(x2,y2)+pi;}
    }
    else{
        if(y1>0) {arc1 = arctan(x1,y1)+pi;arc2 = arctan(x2,y1);}
        else if(y2<0){arc1 = arctan(x2,y2)+2*pi;arc2 = arctan(x1,y2)+pi;}
    }
    tank[id].st = arc2;
    tank[id].ed = arc1;
}
int main(){
    int N,tot = 0;
    cin>>N;
    for(int i=1;i<=N;i++){
        int xd,yd,xu,yu;
        scanf("%d %d %d %d",&xd,&yd,&xu,&yu);
        give_inf(i,xd,yd,xu,yu);
    }
    sort(tank+1,tank+1+N,cmp);
    double base = tank[1].st,flag = -100.0;
    for(int i=1;i<=N;i++){
        if((tank[i].st-flag)>eps){
            if(((tank[i].st-3*pi/2)>eps)&&((tank[i].ed-2*pi-base+eps)>0)) break;
            tot++;
        }
        flag = tank[i].ed;
    }
    cout<<tot<<endl;
}

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

#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
#define INF 2147483647.0
#define EPS 0.00000001
const double PI=acos(-1.0);
double pangle,K;
struct Point
{
	int x,y;
	double angle()
	  {
	  	double t=atan2((double)y,(double)x)-pangle+EPS*K;
	  	if(t-PI>EPS)
	  	  return t-2.0*PI;
	  	if(t+PI<EPS)
	  	  return 2.0*PI+t;
	  	return t;
	  }
};
struct Range
{
	double l,r;
}ranges[2010];
bool cmp(const Range &a,const Range &b)
{
	return a.r<b.r;
}
int n;
int main()
{
	//freopen("e.in","r",stdin);
	scanf("%d",&n);
	for(int i=1;i<=n;++i)
	  {
	  	Point a,b,c,d;
	  	scanf("%d%d%d%d",&a.x,&a.y,&b.x,&b.y);
	  	if(i==1)
	  	  {
	  	  	pangle=atan2((double)a.y,(double)a.x);
	  	  	K=(pangle<(-EPS) ? 10.0 : (-10.0));
	  	  }
	  	ranges[i].l=INF;
	  	ranges[i].r=-INF;
	  	
	  	ranges[i].l=min(ranges[i].l,a.angle());
	  	ranges[i].r=max(ranges[i].r,a.angle());
	  	
	  	ranges[i].l=min(ranges[i].l,b.angle());
	  	ranges[i].r=max(ranges[i].r,b.angle());
	  	
	  	swap(a.y,b.y);
	  	
	  	ranges[i].l=min(ranges[i].l,a.angle());
	  	ranges[i].r=max(ranges[i].r,a.angle());
	  	
	  	ranges[i].l=min(ranges[i].l,b.angle());
	  	ranges[i].r=max(ranges[i].r,b.angle());
	  }
	sort(ranges+1,ranges+n+1,cmp);
	double now=INF;
	int ans=0;
	for(int i=1;i<=n;++i)
	  if(fabs(now-INF)<EPS || now-ranges[i].l<(-EPS))
	    {
	      now=ranges[i].r;
	      ++ans;
	    }
	printf("%d\n",ans);
	return 0;
}

Compiler output:
main.c:1:9: fatal error: cstdio: No such file or directory
    1 | #include<cstdio>
      |         ^~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  int n,m;
  cin>>n>>m;
  int a[n*2],sum=0,ma=0;
  for(int i=0;i<n;i++){
    cin>>a[i];
    a[n+i]=a[i];
    sum+=a[i];
    ma=max(ma,a[i]);
  }
  srand((unsigned)time);
  time_t start=clock();
  set<int> s;
  int ans=sum;
  while((double)(clock()-start)/CLOCKS_PER_SEC<7.0){
    int p=rand()%n;
    if(s.count(p)) continue;
    s.insert(p);
    int l=ma-1,r=sum;
    while(l+1<r){
      int mid=(l+r)/2;
      int v=p,t=a[p],c=0;
      while(1){
	while(v+1<p+n&&t+a[v+1]<=mid){
	  v++;
	  t+=a[v];
	} 
	c++;t=0;
	if(v+1>=p+n) break;
      }
      if(c<=m) r=mid;
      else l=mid;
    }
    //cout<<r<<endl;
    ans=min(ans,r);
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: cast from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'unsigned int' loses precision [-fpermissive]
   14 |   srand((unsigned)time);
      |         ^~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  int n,m;
  cin>>n>>m;
  int a[n*2],sum=0,ma=0;
  for(int i=0;i<n;i++){
    cin>>a[i];
    a[n+i]=a[i];
    sum+=a[i];
    ma=max(ma,a[i]);
  }
  srand((unsigned)time);
  time_t start=clock();
  set<int> s;
  int ans=sum;
  while((double)(clock()-start)/CLOCKS_PER_SEC<7.0){
    int p=rand()%n;
    if(s.count(p)) continue;
    s.insert(p);
    int l=ma-1,r=sum;
    while(l+1<r){
      int mid=(l+r)/2;
      int v=p,t=a[p],c=0;
      while(1){
    while(v+1<p+n&&t+a[v+1]<=mid){
      v++;
      t+=a[v];
    } 
    c++;t=0;
    if(v+1>=p+n) break;
      }
      if(c<=m) r=mid;
      else l=mid;
    }
    //cout<<r<<endl;
    ans=min(ans,r);
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: cast from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'unsigned int' loses precision [-fpermissive]
   14 |   srand((unsigned)time);
      |         ^~~~~~~~~~~~~~
Language: C

// AOJ 2476: Strange Currency System
// 2018.3.5 bal4u

#include <stdio.h>
#include <stdlib.h>

//#define getchar_unlocked()  getchar()
int in()
{
	int n = 0;
	int c = getchar_unlocked();
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
	while (c >= '0');
	return n;
}

int a[10002];
int cmp(int *a, int *b) { return *a - *b; }

int main()
{
	int n;
	long long ans;
	
	n = in();
	for (i = 0; i < n; i++) a[i] = in();
	qsort(a, n, sizeof(int), cmp);
 
	ans = 1;
	for (i = 0 ; i < n ; i++) {
		if (a[i] > ans) break;
		else ans += a[i];
	}
	printf("%lld\n", ans);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:26:14: error: 'i' undeclared (first use in this function)
   26 |         for (i = 0; i < n; i++) a[i] = in();
      |              ^
main.c:26:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:27:34: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
   27 |         qsort(a, n, sizeof(int), cmp);
      |                                  ^~~
      |                                  |
      |                                  int (*)(int *, int *)
In file included from main.c:5:
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'int (*)(int *, int *)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<string>
#include<cctype>
#include<cassert>
#include<cmath>
#include<climits>

#define INF (1<<29)
#define all(c) (c).begin(),(c).end()
#define D(x) cout << #x " is " << (x) << endl
#define rep(i,n) for(int i = 0; i < n; i++)
#define x first
#define y second

using namespace std;

typedef long long ll;

ll dp[1001][1001];

int main(void){

  int n;
  cin >> n;

  vector<pii>v(n);
  rep(i,n)cin >> v[i].x >> v[i].y;


  fill(dp[0],dp[1001],INT_MAX);
  rep(i,1001)dp[i][i]=0;

  for(int w=0;w<n;w++){
    for(int i=0;i+w<n;i++){
      for(int s=i;s<i+w;s++){
        ll cost=abs(v[i].x-v[s+1].x)+abs(v[s].y-v[i+w].y);
        dp[i][i+w]=min(dp[i][i+w],dp[i][s]+dp[s+1][i+w]+cost);
      }
    }
  }

  cout << dp[0][n-1] << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:3: error: 'cin' was not declared in this scope
   27 |   cin >> n;
      |   ^~~
a.cc:10:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    9 | #include<climits>
  +++ |+#include <iostream>
   10 | 
a.cc:29:10: error: 'pii' was not declared in this scope
   29 |   vector<pii>v(n);
      |          ^~~
a.cc:29:13: error: template argument 1 is invalid
   29 |   vector<pii>v(n);
      |             ^
a.cc:29:13: error: template argument 2 is invalid
a.cc:30:19: error: invalid types 'int[int]' for array subscript
   30 |   rep(i,n)cin >> v[i].x >> v[i].y;
      |                   ^
a.cc:30:29: error: invalid types 'int[int]' for array subscript
   30 |   rep(i,n)cin >> v[i].x >> v[i].y;
      |                             ^
a.cc:39:22: error: invalid types 'int[int]' for array subscript
   39 |         ll cost=abs(v[i].x-v[s+1].x)+abs(v[s].y-v[i+w].y);
      |                      ^
a.cc:39:29: error: invalid types 'int[int]' for array subscript
   39 |         ll cost=abs(v[i].x-v[s+1].x)+abs(v[s].y-v[i+w].y);
      |                             ^
a.cc:39:43: error: invalid types 'int[int]' for array subscript
   39 |         ll cost=abs(v[i].x-v[s+1].x)+abs(v[s].y-v[i+w].y);
      |                                           ^
a.cc:39:50: error: invalid types 'int[int]' for array subscript
   39 |         ll cost=abs(v[i].x-v[s+1].x)+abs(v[s].y-v[i+w].y);
      |                                                  ^
a.cc:45:3: error: 'cout' was not declared in this scope
   45 |   cout << dp[0][n-1] << endl;
      |   ^~~~
a.cc:45:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:45:25: error: 'endl' was not declared in this scope
   45 |   cout << dp[0][n-1] << endl;
      |                         ^~~~
a.cc:10:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    9 | #include<climits>
  +++ |+#include <ostream>
   10 |
Language: C++

#include<string>
#include<vector>
#include<algorithm>
#include<iostream>
#include<sstream>
using namespace std;
bool latte(int n){
    stringstream ss;
    ss<<n;
    string str;
    ss>>str;
    string rev=str;
    reverse(rev.begin(),rev.end());
    return str==rev;
}
inline int intAbs(int a){
    if(a<0)a*=-1;
    return a;
}
int main(){d
    int n;
    cin>>n;
    int Min=1e9,MinNum;
    for(int i=0;i<10001;i++){
        if(!latte(i))continue;
        if(intAbs(n-i)<Min){
            Min=intAbs(n-i);
            MinNum=i;
        }
    }
    cout<<MinNum<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: 'd' was not declared in this scope
   20 | int main(){d
      |            ^
a.cc:22:10: error: 'n' was not declared in this scope
   22 |     cin>>n;
      |          ^
Language: C++

#include<string>
#include<vector>
#include<algorithm>
#include<iostream>
#include<sstream>
using namespace std;
bool latte(int n){
    stringstream ss;
    ss<<n;
    string str;
    ss>>str;
    string rev=str;
    reverse(rev.begin(),rev.end());
    return str==rev;
}
 int intAbs(int a){
    if(a<0)a*=-1;
    return a;
}
int main(){d
    int n;
    cin>>n;
    int Min=10000000,MinNum;
    for(int i=0;i<10001;i++){
        if(!latte(i))continue;
        if(intAbs(n-i)<Min){
            Min=intAbs(n-i);
            MinNum=i;
        }
    }
    cout<<MinNum<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: 'd' was not declared in this scope
   20 | int main(){d
      |            ^
a.cc:22:10: error: 'n' was not declared in this scope
   22 |     cin>>n;
      |          ^
Language: C++

#include <iostream>
#include <string>

int n;
int f, b;

int main() {
	std::cin >> n;
	f = n;
	b = n;
	std::string str, r;
	while (1) {
		str = std::to_string(b);
		r = str;
		std::reverse(str.begin(), str.end());
		if (r == str)
			break;
		str = std::to_string(f);
		r = str;
		std::reverse(str.begin(), str.end());
		if (r == str)
			break;
		++f;
		--b;
	}
	std::cout << r << std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:22: error: 'reverse' is not a member of 'std'
   15 |                 std::reverse(str.begin(), str.end());
      |                      ^~~~~~~
a.cc:20:22: error: 'reverse' is not a member of 'std'
   20 |                 std::reverse(str.begin(), str.end());
      |                      ^~~~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

bool is_palindromic_number(int n) {
    string str = to_string(n);
    int len = str.size();
    string s1 = str.substr(0, len / 2);
    string s2 = str.substr(len / 2 + len % 2);

    reverse(s2.begin(), s2.end());

    return s1 == s2;
}

int n;
int ans;
int main() {
    cin >> n;
    for (int i = 0; i <= 10001; i++) {
        if (is_palindromic_number(i)) {
            if (abs(n - i) < abs(n - ans)) {
                ans = i;
            } else if (abs(n - i) == abs(n - ans)) {
                ans = min(ans, i);
            }
        }
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'bool is_palindromic_number(int)':
a.cc:12:5: error: 'reverse' was not declared in this scope
   12 |     reverse(s2.begin(), s2.end());
      |     ^~~~~~~
Language: C++

#include <iostream>
#include <sstream>
#include <climits>
#include <cstdlib>
#include <cstdio>
#include <cmath>
using namespace std;

bool palind(int x){
  stringstream ss;
  ss << x;
  string s = ss.str();
  string rs = s;
  reverse(rs.begin(), rs.end());
  return s == rs;
}

int main(){
  int n;

  while(cin >> n){
    int minDiff = INT_MAX;
    int ans = -1;

    for(int i = 1; i <= 10000; i++){
      if(palind(i) && minDiff > abs(i - n)){
        minDiff = abs(i - n);
        ans = i;
      }
    }

    cout << ans << endl;
  }
}

Compiler output:
a.cc: In function 'bool palind(int)':
a.cc:14:3: error: 'reverse' was not declared in this scope
   14 |   reverse(rs.begin(), rs.end());
      |   ^~~~~~~
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<vector>
#define INF 999999
using namespace std;
int J(int x){
    int LONG,plas=0,flg=0;
    char num[100];
    if(x<10)return 1;
    itoa(x,num,10);
    LONG=strlen(num);
    if(LONG%2==0)plas=2;
    for(int i=0;i<(LONG-1+plas)/2;i++){
        if(num[i]!=num[LONG-1-i]){
            flg=1;
            break;
        }
    }
    if(flg==0)return 1;
    return 0;
}
int main(){
    int N;
    cin>>N;
    if(J(N)==1){cout<<N<<endl;return 0;}
    for(int i=1;;i++){
            if(J(N-i)==1){cout<<N-i<<endl;break;}
            if(J(N+i)==1){cout<<N+i<<endl;break;}
    }
    return 0;
}

Compiler output:
a.cc: In function 'int J(int)':
a.cc:12:5: error: 'itoa' was not declared in this scope
   12 |     itoa(x,num,10);
      |     ^~~~
Language: C++

#include<cstdio>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<vector>
#define INF 999999
using namespace std;
int J(int x){
    int LONG,plas=0,flg=0;
    char num[100];
    if(x<10)return 1;
    itoa(x,num,10);
    LONG=strlen(num);
    if(LONG%2==0)plas=2;
    for(int i=0;i<(LONG-1+plas)/2;i++){
        if(num[i]!=num[LONG-1-i]){
            flg=1;
            break;
        }
    }
    if(flg==0)return 1;
    return 0;
}
int main(){
    int N;
    cin>>N;
    if(J(N)==1){cout<<N<<endl;return 0;}
    for(int i=1;;i++){
            if(J(N-i)==1){cout<<N-i<<endl;break;}
            if(J(N+i)==1){cout<<N+i<<endl;break;}
    }
    return 0;
}

Compiler output:
a.cc: In function 'int J(int)':
a.cc:13:5: error: 'itoa' was not declared in this scope
   13 |     itoa(x,num,10);
      |     ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;

int main(){
  char tmp[7],tmp2[7];
  int sta,sta1;
  char num[7];
  cin >> sta;
  sta1 = sta;
  while(1){
    sprintf(num,"%d",sta);
    sprintf(num,"%d",sta1);
    if(strlen(num) == 1) break;
    strcpy(tmp,num);
    strcpy(tmp2,num);
    for(int i=0,j=strlen(tmp)-1;i<=j;i++,j--) swap(tmp[i],tmp[j]);
    for(int i=0,j=strlen(tmp2)-1;i<=j;i++,j--) swap(tmp2[i],tmp2[j]);
    if(strcmp(tmp,num) == 0) break;
    if(strcmp(tmp2,num) == 0) break;
    sta = atoi(num);
    sta1 = sta;
    sta++;
    sta1--;
  }
  cout << num << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: 'strlen' was not declared in this scope
   15 |     if(strlen(num) == 1) break;
      |        ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <cstdlib>
  +++ |+#include <cstring>
    4 | using namespace std;
a.cc:16:5: error: 'strcpy' was not declared in this scope
   16 |     strcpy(tmp,num);
      |     ^~~~~~
a.cc:16:5: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:18:19: error: 'strlen' was not declared in this scope
   18 |     for(int i=0,j=strlen(tmp)-1;i<=j;i++,j--) swap(tmp[i],tmp[j]);
      |                   ^~~~~~
a.cc:18:19: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:19:19: error: 'strlen' was not declared in this scope
   19 |     for(int i=0,j=strlen(tmp2)-1;i<=j;i++,j--) swap(tmp2[i],tmp2[j]);
      |                   ^~~~~~
a.cc:19:19: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:20:8: error: 'strcmp' was not declared in this scope
   20 |     if(strcmp(tmp,num) == 0) break;
      |        ^~~~~~
a.cc:20:8: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:21:8: error: 'strcmp' was not declared in this scope
   21 |     if(strcmp(tmp2,num) == 0) break;
      |        ^~~~~~
a.cc:21:8: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
using namespace std;

int main(){
  char tmp[7],tmp2[7];
  int sta,sta1;
  char num[7];
  cin >> sta;
  sta1 = sta;
  while(1){
    sprintf(num,"%d",sta);
    sprintf(num,"%d",sta1);
    if(strlen(num) == 1) break;
    strcpy(tmp,num);
    strcpy(tmp2,num);
    for(int i=0,j=strlen(tmp)-1;i<=j;i++,j--) swap(tmp[i],tmp[j]);
    for(int i=0,j=strlen(tmp2)-1;i<=j;i++,j--) swap(tmp2[i],tmp2[j]);
    if(strcmp(tmp,num) == 0) break;
    if(strcmp(tmp2,num) == 0) break;
    sta = atoi(num);
    sta1 = sta;
    sta++;
    sta1--;
  }
  cout << num << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:8: error: 'strlen' was not declared in this scope
   16 |     if(strlen(num) == 1) break;
      |        ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <algorithm>
  +++ |+#include <cstring>
    5 | using namespace std;
a.cc:17:5: error: 'strcpy' was not declared in this scope
   17 |     strcpy(tmp,num);
      |     ^~~~~~
a.cc:17:5: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:19:19: error: 'strlen' was not declared in this scope
   19 |     for(int i=0,j=strlen(tmp)-1;i<=j;i++,j--) swap(tmp[i],tmp[j]);
      |                   ^~~~~~
a.cc:19:19: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:20:19: error: 'strlen' was not declared in this scope
   20 |     for(int i=0,j=strlen(tmp2)-1;i<=j;i++,j--) swap(tmp2[i],tmp2[j]);
      |                   ^~~~~~
a.cc:20:19: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:21:8: error: 'strcmp' was not declared in this scope
   21 |     if(strcmp(tmp,num) == 0) break;
      |        ^~~~~~
a.cc:21:8: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:22:8: error: 'strcmp' was not declared in this scope
   22 |     if(strcmp(tmp2,num) == 0) break;
      |        ^~~~~~
a.cc:22:8: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C

#include<iostream>

using namespace std;

int main(void){
  int n, x, s = 0;
  char p[1000];

  cin >> n;

  for(int i=0; i<n; i++){
    cin >> p[i] >> x;
    if(p[i] == '('){
      s += x;
    } else {
      s -= x;
    }
    if(s < 0){
      cout << "NO" << endl;
      break;
    }
  }
  if(s == 0){
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}



Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include <stdio.h>

int main()
{
    char c; int n, c, v = 0;
    
    scanf("%d", &n);
    
    for(int i = 0; i < n; i++)
    {
        scanf("%c %d", &c, &d);
        
        v += (c == ')' ? 1 : -1) * d;
    }
    
    printf("%s\n", v == 0 ? "YES" : "NO");
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:20: error: conflicting declaration 'int c'
    5 |     char c; int n, c, v = 0;
      |                    ^
a.cc:5:10: note: previous declaration as 'char c'
    5 |     char c; int n, c, v = 0;
      |          ^
a.cc:11:29: error: 'd' was not declared in this scope
   11 |         scanf("%c %d", &c, &d);
      |                             ^
Language: C++

#include <iostream>
#include <vector>
#define rep(i,n) for(int i= 0; i<n;i++)
#define loop(i,f,n) for(int i = f; i<n; i++)
#define MAX 1000000
using namespace std;

int main(){
	
	int n,num = 0;
	vector<int>stac(MAX,0);
	cin >> n;
	int tuki = 0;
	int r;
	int cc = 0;
	bool checking = true;
	rep(i,n)
	{
		int temp;
		char s;
		cin >> s >> temp;
		num +=temp;
		if(s == '(')
		{	
			tuki+= temp;
			cc+= temp;
		}
		else if(s == ')')
		{
			tuki -= temp;
			cc-= temp;
		}
		if(cc < 0)
		  checking = false;
	}
//		cout << checking << endl;
		/*?\???°?????¨??????????????¶s?????????*/
		if(cc <0 || checking == false)
		{	
			cout << "NO" << endl;
			return 0;
		}		
		if(num % 2)
		{
			cout << "NO" << endl;
			return 0;
		}

		if(tuki == 0)
		{
			cout << "YES" << endl;
			return 0;
		}
		else 
			cout << "NO"<< endl;
		return 0;


	

Compiler output:
a.cc: In function 'int main()':
a.cc:56:26: error: expected '}' at end of input
   56 |                 return 0;
      |                          ^
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^