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

#define rep(i,n) for(int i=0;i<n;++i)
int a[1<<18],v[1<<18][2],l[1<<18],n,m,q,c;
main(){
	scanf("%d %d %d",&n,&m,&q);
	rep(i,n)rep(j,2)v[i][j]=(i+n+1-2*j)%n;
	rep(i,m){
		scanf("%d",a+i);
		rep(j,a[i])c=v[c][a[i]&1];
		l[c]=1;
		rep(j,2)v[v[c][j^1]][j]=v[c][j];
		c=v[c][0];
	}
	rep(i,q) scanf("%d",&c),printf("%d\n",1-l[c]);
}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:4:9: error: 'scanf' was not declared in this scope
    4 |         scanf("%d %d %d",&n,&m,&q);
      |         ^~~~~
a.cc:13:33: error: 'printf' was not declared in this scope
   13 |         rep(i,q) scanf("%d",&c),printf("%d\n",1-l[c]);
      |                                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #define rep(i,n) for(int i=0;i<n;++i)
Language: C++

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

int main(){
	int n,m,q;
	cin >> n >> m >> q;
	int callNomber[m];
	for(int i = 0; i < m; i++){
		cin >> callNomber[i];
	}
	vector<int> students = vector<int>[n];
	for(int i = 0; i < n; i++){
		students[i] = i;
	}
	int nowBatton = 0;
	for(int i = 0; i < m; i++){
		int tempCall = callNomber[i];
		if(tempCall % 2 != 0){
			tempCall *= -1;
		}	
		nowBatton+=tempCall;
		if(nowBatton >= students.size()){
			while(nowBatton>=students.size()){
				nowBatton -= students.size();
			}
		}
		if(nowBatton < 0){
			while(nowBatton < 0){
				nowBatton+=students.size();
			}
		}
		students.erase(students.begin() + nowBatton);
		if(nowBatton == students.size()-1){
			nowBatton = 0;
		}
	}
	for(int i = 0; i < q; i++){
		int temp;
		cin >> temp;
		for(int j = 0; j < students.size();j++){
			if(temp == students[j]){
				cout << 1 << '\n';
			}
			if(j == students.size()-1){
				cout << 0 << '\n';
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:43: error: expected primary-expression before '[' token
   12 |         vector<int> students = vector<int>[n];
      |                                           ^
Language: C++

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

#define MAX_N 200010
#define MAX_Q 1010
int N, M, Q;
int a[MAX_N];
vector<int> alive;

int main() {
  cin >> N >> M >> Q;
  for (int i=0; i<N; i++) alive.push_back(i);

  // O(M)
  int t = 0;
  for (int i=0; i<M; i++) {
    cin >> a[i];
    if (a[i] % 2 == 1) t = (t - a[i]) % alive.size();
    else               t = (t + a[i]) % alive.size();
    alive.erase(alive.begin() + t);
    t = (t + 1) % alive.size();
  }
  // O(N log(N))
  for (int i=0; i<Q; i++) {
    int q;
    cin >> q;
    cout << binary_search(alive.begin(), alive.end(), q) << "\n";
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:13: error: 'binary_search' was not declared in this scope
   28 |     cout << binary_search(alive.begin(), alive.end(), q) << "\n";
      |             ^~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>
#include <cstdio>
using namespace std;
int N, M, Q, now = 0;
int a, q;
vector<int> vec;
int main(){
	scanf("%d%d%d", &N, &M, &Q);
	cout << N << endl;
	for(int i  = 0; i < N; i++){
		vec.push_back(i);
	}
	for(int i = 0; i < M; i++){
		scanf("%d", &a);
		N = vec.size();
		if(a % 2){//???????¨???????
			if(now - a >= 0){
				vec.erase(vec.begin() + now - a);
				now -= a;
			}
			else{
				while(now - a < 0){
					a += N;
				}
				vec.erase(vec.begin() + now - a);
				now -= a;
			}
		}
		else{     //  ????¨???????
			if(now + a < N){
				vec.erase(vec.begin() + now + a);
				now += a;
			}
			else{
				while(now + a > ){
					a -= N;
				}
				vec.erase(vec.begin() + now + a);
				now += a;
			}
		}
		for(int i = 0; i < vec.size(); i++){
			cout << vec[i] << " ";
		}
		cout << endl;
	}
	for(int i = 0; i < Q; i++){
		scanf("%d", &q);
		printf("%d\n", binary_search(vec.begin(), vec.end(), q));
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:49: error: expected primary-expression before ')' token
   39 |                                 while(now + a > ){
      |                                                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
list<int>L;
signed main() {
    cout<<(*x)<<endl;
    int a, b, c; cin >> a >> b >> c;
    for (int d = 0; d < a; d++) {
        L.push_back(d);
    }
    auto f = L.begin();
    for (int d = 0; d < b; d++) {
        int e; scanf("%d", &e);
        for (int g = 0; g < e; g++) {
            if (e & 1) {
                if (f == L.begin())f = --L.end();
                else f--;
            }
            else {
                f++;
                if (f == L.end())f = L.begin();
            }
        }
        L.erase(f);
	f--;
	f++;
        if (f == L.end())f = L.begin();
    }
    for (int s = 0; s < c; s++) {
        int k; scanf("%d", &k);
        cout << binary_search(L.begin(), L.end(), k)<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: 'x' was not declared in this scope
    6 |     cout<<(*x)<<endl;
      |             ^
Language: C++

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

int main(){

  int n,m,q;

  cin >> n >> m >> q;

  int size = n;

  list<int> l;

  for(int i=0;i<n;i++){
    table[i] = true;
    vec.push_back(i);
    l.push_back(i);
  }

  list<int>::iterator index=l.begin();

  for(int i=0;i<m;i++){
    int tmp=0,j=0;
    cin >> tmp;
    if(tmp%2==0){
      while(j!=tmp){
        index++;
        if(index==l.end()){
          index = l.begin();
        }

        j++;
      }
      table[*index] = false;
      list<int>::iterator tmp=index;
      index++;
      if(index==l.end()){
        index = l.begin();
      }
      l.erase(tmp);

    }
    else{
      while(j!=tmp){
        if(index==l.begin()){
          index = l.end();
          index--;
        }
        else{
          index--;
        }
        j++;
      }
      table[*index] = false;
      list<int>::iterator tmp=index;
      index++;
      if(index==l.end()){
        index = l.begin();
      }
      l.erase(tmp);
    }
  }


  index = l.begin();

  for(int i=0;i<q;i++){
    int ansindex,ans;
    cin >> ansindex;
    ans = (table[ansindex]) ? 1 : 0;
    cout << ans << endl;
  }


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'table' was not declared in this scope; did you mean 'mutable'?
   16 |     table[i] = true;
      |     ^~~~~
      |     mutable
a.cc:17:5: error: 'vec' was not declared in this scope
   17 |     vec.push_back(i);
      |     ^~~
a.cc:35:7: error: 'table' was not declared in this scope; did you mean 'mutable'?
   35 |       table[*index] = false;
      |       ^~~~~
      |       mutable
a.cc:55:7: error: 'table' was not declared in this scope; did you mean 'mutable'?
   55 |       table[*index] = false;
      |       ^~~~~
      |       mutable
a.cc:71:12: error: 'table' was not declared in this scope; did you mean 'mutable'?
   71 |     ans = (table[ansindex]) ? 1 : 0;
      |            ^~~~~
      |            mutable
Language: C++

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

int main(){

  int n,m,q;

  cin >> n >> m >> q;

  int size = n;

  bool table[n];

  list<int> l;

  for(int i=0;i<n;i++){
    table[i] = true;
    vec.push_back(i);
    l.push_back(i);
  }

  list<int>::iterator index=l.begin();

  for(int i=0;i<m;i++){
    int tmp=0,j=0;
    cin >> tmp;
    if(tmp%2==0){
      while(j!=tmp){
        index++;
        if(index==l.end()){
          index = l.begin();
        }
        j++;
      }
      table[*index] = false;
      list<int>::iterator tmp=index;
      index++;
      if(index==l.end()){
        index = l.begin();
      }
      l.erase(tmp);

    }
    else{
      while(j!=tmp){
        if(index==l.begin()){
          index = l.end();
          index--;
        }
        else{
          index--;
        }
        j++;
      }
      table[*index] = false;
      list<int>::iterator tmp=index;
      index++;
      if(index==l.end()){
        index = l.begin();
      }
      l.erase(tmp);
    }
  }

  index = l.begin();

  for(int i=0;i<q;i++){
    int ansindex,ans;
    cin >> ansindex;
    ans = (table[ansindex]) ? 1 : 0;
    cout << ans << endl;
  }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: 'vec' was not declared in this scope
   19 |     vec.push_back(i);
      |     ^~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<functional>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#define int long long
using namespace std;

int n, d;	//1 <= n <= 2*10^5, 0 <= d <= 10^9
struct Star {
	int x, y, b;
}star[200000];

int compare(const void *s1, const void *s2) {
	int t1 = ((Star*)s1)->b;
	int t2 = ((Star*)s2)->b;
	return t1 - t2;
}
signed main() {
	int i;
	cin >> n >> d;
	for( i = 0; i < n; i++ )
		cin >> star[i].x >> star[i].y >> star[i].b;
	qsort(star, n, sizeof(star[0]), compare);

	static multiset<int> X;
	static multiset<int> Y;
	multiset<int>::iterator it;
	multiset<int>::reverse_iterator rit;
	int ins = 0;
	int del = 0;
	int j;
	int ans = 0;

	/*for( i = 0; i < n; i++ ) {
		printf("index = %d x = %d y = %d b = %d\n", i, star[i].x, star[i].y, star[i].b);
	}*/

	for( i = 0; i < n; i++ ) {
		ins = i;
		X.insert( star[ins].x );
		Y.insert( star[ins].y );
		for(; del < n; del++ ) {
			if( star[del].b < star[i].b - d ) {
				it = X.find( star[del].x );
				X.erase( it );
				it = Y.find( star[del].y );
				Y.erase( it );
			} else {
				break;
			}
		}

		it = X.begin();
		int minx = *it;
		rit = X.rbegin();
		int maxx = *rit;
		it = Y.begin();
		int miny = *it;
		rit = Y.rbegin();
		int maxy = *rit;
		ans = max( ans, (maxx - minx) * (maxy - miny) );

		//printf("ins = %d, del = %d, x[%d, %d], y[%d, %d]\n", ins, del, minx, maxx, miny, maxy);
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:41: error: invalid conversion from 'long long int (*)(const void*, const void*)' to '__compar_fn_t' {aka 'int (*)(const void*, const void*)'} [-fpermissive]
   32 |         qsort(star, n, sizeof(star[0]), compare);
      |                                         ^~~~~~~
      |                                         |
      |                                         long long int (*)(const void*, const void*)
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:971:34: note:   initializing argument 4 of 'void qsort(void*, size_t, size_t, __compar_fn_t)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include<iostream>
#include<cmath>
#include<string>
#include<cctype>
#include<vector>
#include<numeric>
#include<algorithm>
#include<bits/std++.h>
using namespace std;
/**
vector<int>ar(3);
for(auto&e:ar){
    scanf("%d",&e);
        }
sort(ar.begin(),ar.end())
int sum=accumulate(ar.begin(),ar.end(),0);
**/
//memo kyuridenamida 1237852
int main(){
    double pai=3.141592653589;
    int N,d;
    cin >> N >> d;
    vector< array<int,3> > star;
    for(int i = 0 ; i < N ; i++){
        int x,y,b;
        cin >> x >> y >> b;
        star.push_back(array<int,3>{b,x,y});
    }   
    sort(star.begin(),star.end());
    int l = 0 , r = 0;
    multiset<int> X,Y;
    long long ans = 0;
    while( r != N){
        X.insert(star[r][1]);
        Y.insert(star[r][2]);
        r++;
        while( star[r-1][0] - star[l][0] > d ){
            X.erase(X.find(star[l][1]));
            Y.erase(Y.find(star[l][2]));
            l++;
        }
        ans = max((long long)((*X.rbegin())-(*X.begin())) * ((*Y.rbegin())-(*Y.begin())),ans);
        //cout << (*X.rbegin())-(*X.begin()) << " " << ((*Y.rbegin())-(*Y.begin())) << "|" << star[r-1][0] - star[l][0] << endl;
    }
    cout << ans << endl;
}

Compiler output:
a.cc:8:9: fatal error: bits/std++.h: No such file or directory
    8 | #include<bits/std++.h>
      |         ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/std++.h>
using namespace std;
/**
vector<int>ar(3);
for(auto&e:ar){
    scanf("%d",&e);
        }
sort(ar.begin(),ar.end())
int sum=accumulate(ar.begin(),ar.end(),0);
**/
//memo kyuridenamida 1237852
int main(){
    double pai=3.141592653589;
    int N,d;
    cin >> N >> d;
    vector< array<int,3> > star;
    for(int i = 0 ; i < N ; i++){
        int x,y,b;
        cin >> x >> y >> b;
        star.push_back(array<int,3>{b,x,y});
    }   
    sort(star.begin(),star.end());
    int l = 0 , r = 0;
    multiset<int> X,Y;
    long long ans = 0;
    while( r != N){
        X.insert(star[r][1]);
        Y.insert(star[r][2]);
        r++;
        while( star[r-1][0] - star[l][0] > d ){
            X.erase(X.find(star[l][1]));
            Y.erase(Y.find(star[l][2]));
            l++;
        }
        ans = max((long long)((*X.rbegin())-(*X.begin())) * ((*Y.rbegin())-(*Y.begin())),ans);
        //cout << (*X.rbegin())-(*X.begin()) << " " << ((*Y.rbegin())-(*Y.begin())) << "|" << star[r-1][0] - star[l][0] << endl;
    }
    cout << ans << endl;
}

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

#include <iostream>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>
#include <cstdio>
using namespace std;
#define N 200000
#define F first
#define Se second
#define MP(i, j) make_pair((i), (j))
#define int long long
struct S{
	int sx, lx, sy, ly;
	S(int isx, int ilx, int isy, int ily): sx(isx), lx(ilx), sy(isy), ly(ily){}
	bool operator<(const S &s) const { 
		return 1;
	}
};
int cnt;
void init(int n_, int *dat){
	cnt = 1;
	while(cnt < n_) cnt *= 2;
	for(int i = 0; i < 2 * cnt - 1; i++) dat[i] = INT_MAX;
}
void update(int k, int a, int *dat){
	k += cnt - 1;
	dat[k] = a;
	while(k > 0){
		k = (k - 1) / 2;
		dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2]);
	}
}
int query(int a, int b, int k, int l, int r, int *dat){
	if(r <= a || b <= l) return INT_MAX;
	if(a <= l && r <= b) return dat[k];
	else{
		int v1 = query(a, b, k * 2 + 1, l, (l + r) / 2, dat);
		int vr = query(a, b, k * 2 + 2, (l + r) / 2, r, dat);
		return min(v1, vr);
	}
}
typedef pair<int, S> PS;
typedef vector<PS>::iterator it;

int i, j, n, d, stars[MAX_N][3], ax[2 * N], bx[2 * N], ay[2 * N], by[2 * N];
int ans = 0;
vector<PS> vec;

void vdc(vector<PS> &vf, S s, int now){
	if(vf[now].Se.sx > s.sx)
		vf[now].Se.sx = s.sx;
	if(vf[now].Se.lx < s.lx)
		vf[now].Se.lx = s.lx;
	if(vf[now].Se.sy > s.sy)
		vf[now].Se.sy = s.sy;
	if(vf[now].Se.ly < s.ly)
		vf[now].Se.ly = s.ly;
}

signed main(){
	cin >> n >> d;
	vec.push_back(MP(-1, S(0, 0, 0, 0)));
	for(i = 0; i < n; i++){
		int a, b, c;
		cin >> a >> b >> c;
		S s = S(a, a, b, b);
		it ite = lower_bound(vec.begin(), vec.end(), MP(c, s));
		if(vec[ite - vec.begin() - 1].F != c){
			vec.insert(ite, MP(c, s));
		}
		else{
			vdc(vec, s, ite - vec.begin() - 1);
		}
	}
	init(vec.size(), ax);
	init(vec.size(), bx);
	init(vec.size(), ay);
	init(vec.size(), by);
	S s = S(INT_MAX, 0, INT_MAX, 0);
	vec.erase(vec.begin());
	for(i = 0; i < vec.size(); i++){
		update(i, vec[i].Se.sx, ax);
		update(i, -vec[i].Se.lx, bx);
		update(i, vec[i].Se.sy, ay);
		update(i, -vec[i].Se.ly, by);
	}
	i = 0; j = 0;
	for(;;){
		while(j < vec.size()){
			if(vec[j].F - vec[i].F <= d)
				j++;
			else
				break;
		}
		ans = max(ans, (-query(i, j, 0, 0, cnt, bx) - query(i, j, 0, 0, cnt, ax)) * (-query(i, j, 0, 0, cnt, by) - query(i, j, 0, 0, cnt, ay)));
		if(j == vec.size())
			break;
		i++;
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:47:23: error: 'MAX_N' was not declared in this scope
   47 | int i, j, n, d, stars[MAX_N][3], ax[2 * N], bx[2 * N], ay[2 * N], by[2 * N];
      |                       ^~~~~
Language: C++


typedef int  unsigned long long;
#include <cstdio> 
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>

using namespace std;


struct stars
{
	int maxx=0,minx=0;
	int maxy=0,miny=0;
};


signed main()
{
	map<int, stars> data;
	int n, d;
	scanf("%llu %llu", &n, &d);

	stars foo; int x, y, b;
	for (int i = 0; i < n; ++i)
	{
		scanf("%llu %llu %llu", &x, &y, &b);
		data[b].maxx = max(data[b].maxx, x);
		data[b].minx = min(data[b].minx, x);
		data[b].maxy = max(data[b].maxy, y);
		data[b].miny = max(data[b].miny, y);
	}

	int ans=0;
	stars vec;
//	printf("%llu\n", vec.maxx);
	for (auto a : data)
	{
		for (int i = a.first; i <= d; ++i)
		{
//			printf("%d\n", data.count(i) == 0? 1:0);
			if (data.count(i) == 0)
			{
//				printf("%llu %llu\n", a.first, i);
				goto asdfasdfasdf;
			}
			vec.maxx = max(vec.maxx, a.second.maxx);
			vec.minx = min(vec.minx, a.second.minx);
			vec.maxy = max(vec.maxy, a.second.maxy);
			vec.miny = max(vec.miny, a.second.miny);
		asdfasdfasdf:;
		}
		ans = max(ans, (vec.maxx - vec.minx)*(vec.maxy - vec.miny));
	}

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

Compiler output:
a.cc:2:28: error: declaration does not declare anything [-fpermissive]
    2 | typedef int  unsigned long long;
      |                            ^~~~
Language: C++

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

typedef long long ll;
typedef pair<int, int> P;

#define pb push_back
#define in ,
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

struct Star {
  ll x, y, d;
};

ll minX[200001 * 2 - 1] = {}, maxX[200001 * 2 - 1] = {},
minY[200001 * 2 - 1] = {}, maxY[200001 * 2 - 1] = {};
ll n, nn = 1;

void update(ll k, ll a, ll c[]) {
  k += nn - 1;
  c[k] = a;

  while(k > 0) {
    k = (k - 1) / 2;
    c[k] = min(c[k * 2 + 1], c[k * 2 + 2]);
  }
}

ll query(ll a, ll b, ll k, ll l, ll r, ll c[]) {
  if(r <= a || b <= l) return INT_MAX;
  if(a <= l && r <= b) return c[k];

  ll vl = query(a, b, k * 2 + 1, l, (l + r) / 2, c);
  ll vr = query(a, b, k * 2 + 2, (l + r) / 2, r, c);

  return min(vl, vr);
}

bool asc(Star &l, Star &r) {
  return l.d < r.d;
}

ll main() {
  ll d, ans = 0;
  cin >> n >> d;
  vector<Star> v(n);

  while(nn < n) nn *= 2;

  rep(i, 0, nn * 2 - 1) {
    minX[i] = INT_MAX;
    minY[i] = INT_MAX;
    maxX[i] = INT_MAX;
    minX[i] = INT_MAX;
  }

  rep(i, 0, n) cin >> v[i].x >> v[i].y >> v[i].d;

  sort(v.begin(), v.end(), asc);
  rep(i, 0, n) {
    update(i, v[i].x * -1, maxX);
    update(i, v[i].x, minX);
    update(i, v[i].y * -1, maxY);
    update(i, v[i].y, minY);
  }

  // rep(i, 0, n) cout << v[i].x << " " << v[i].y << " " << v[i].d << endl;;

  // rep(i, 0, nn * 2 - 1) cout << minX[i] << endl;

  ll ld = v[0].d, lp = 0;
  rep(i, 1, n) {
    if(v[i].d - ld > d) {
      rep(j, lp + 1, i + 1) {
        if(v[i].d - v[j].d <= d) {
          lp = j;
          ld = v[lp].d;
          break;
        }
      }
    }
    ll hx = query(lp, i + 1, 0, 0, nn, maxX) * -1;
    ll lx = query(lp, i + 1, 0, 0, nn, minX);
    ll hy = query(lp, i + 1, 0, 0, nn, maxY) * -1;
    ll ly = query(lp, i + 1, 0, 0, nn, minY);
    if(lp != i) ans = max(ans, ((hx - lx) * (ll)(hy - ly)));
    // cout << lp << " " << i << endl;
    // cout << hx << " " << lx << " " << hy << " " << ly << endl;
    // cout << ans << endl;
  }

  cout << ans << endl;
}

Compiler output:
a.cc:51:1: error: '::main' must return 'int'
   51 | ll main() {
      | ^~
Language: C++

#pragma GCC optimize("Ofast")
#include <stdio.h>

#include <utility>
using namespace std;
int min(int a,int b){return a>b?b:a;}
struct man{
    int wei;
    int pow;
    void in(){
        scanf("%d%d",&pow,&wei);
        return ;
    }
    void carry(man a){
        wei+=a.wei;
        pow-=a.wei;
        pow=min(pow,a.pow);
        return *this;
    }
    void operator =(man a){
        wei=a.wei;
        pow=a.pow;
        return ;
    }
    void bad(){
        pow=wei=-2;
        return ;
    }
    void init(){
        pow=wei=-1;
        return ;
    }
    bool used(){
        return pow!=-1||wei!=-1;
    }
    bool cant(){
        return pow==-2&&wei==-2;
    }
};
man better(man a,man b){return a.pow>b.pow?a:b;}
bool can(man a,man b){return a.pow>=b.wei;}
const int N=1e3+10;
man a[N],ans[N][N];
int val[N][N];
man dp(int l,int r){
    if(ans[l][r].used())return ans[l][r];
    if(l==r){
        val[l][r]=1;
        ans[l][r]=a[l];
    }
    else if(r-l==1){
        man b=a[l],c=a[r];
        if(can(a[l],a[r])){
            b.carry(a[r]);
            if(can(a[r],a[l])){
                c.carry(a[l]);
                b=better(b,c);
            }
            ans[l][r]=b;
            val[l][r]=1;
        }
        else if(can(a[r],a[l])){
            ans[l][r]=c;
            ans[l][r].carry(a[l]);
            val[l][r]=1;
        }
        else{
            ans[l][r].bad();
            val[l][r]=2;
        }
    }
    else{
        man b=a[l],c=dp(l+1,r);
        val[l][r]=N;
        if(!c.cant()){
            if(can(b,c)){
                ans[l][r]=b;
                ans[l][r].carry(c);
                val[l][r]=1;
            }
            else{
                ans[l][r].bad();
                val[l][r]=2;
            }
        }
        else{
            ans[l][r].bad();
            val[l][r]=val[l+1][r]+1;
        }
        b=a[r],c=dp(l,r-1);
        if(!c.cant()){
            if(can(b,c)){
                b.carry(c);
                ans[l][r]=better(ans[l][r],b);
                val[l][r]=1;
            }
            else{
                if(val[l][r]>2){
                    val[l][r]=2;
                    ans[l][r].bad();
                }
            }
        }
        else{
            if(val[l][r]>val[l][r-1]+1){
                ans[l][r].bad();
                val[l][r]=val[l][r-1]+1;
            }
        }
        for(int i=l+1;i<r;i++){
            dp(l,i);
            dp(i+1,r);
            if(val[l][i]+val[i+1][r]<val[l][r]){
                val[l][r]=val[l][i]+val[i+1][r];
                ans[l][r].bad();
            }
        }
    }
    return ans[l][r];
}
int main(){
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        a[i].in();
        for(int j=i;j<n;j++)ans[i][j].init();
    }
    dp(0,n-1);
    printf("%d\n",val[0][n-1]);
}



Compiler output:
a.cc: In member function 'void man::carry(man)':
a.cc:18:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
   18 |         return *this;
      |                ^~~~~
Language: C++

using namespace std;
int n, w[1000], c[1000], r[1000], dp[1000][1000];
int main() {
    cin >> n; for (int i = 1; i <= n; i++) { cin >> c[i] >> w[i]; r[i] = w[i]; }
    for (int i = 1; i <= n; i++)r[i] += r[i - 1];
    for (int i = 1; i <= n; i++) { dp[i][i] = 1; }
    for (int i = 0; i < n; i++) {
        for (int j = 1; j <= n; j++) {
            int L = j, R = j + i; if (R > n)continue;
            if (dp[L][R] == 0)continue;
            int WA = r[R] - r[L - 1];
            if (L >= 2 && c[L - 1] >= WA) { dp[L - 1][R] = 1; }
            if (R < n && c[R + 1] >= WA) { dp[L][R + 1] = 1; }
        }
    }
    int cnt = 0, p = 1, q = 1;
    while (p <= n) {
        while (dp[p][q] == 1) { q++; }
        cnt++; p = q;
    }
    cout << cnt << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin >> n; for (int i = 1; i <= n; i++) { cin >> c[i] >> w[i]; r[i] = w[i]; }
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:21:5: error: 'cout' was not declared in this scope
   21 |     cout << cnt << endl;
      |     ^~~~
a.cc:21:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:20: error: 'endl' was not declared in this scope
   21 |     cout << cnt << endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

// AOJ 0304
#include<iostream>
#include<string>
#include<vector>
#define rep(i,a) for(int i=0;i<(a);++i)

typedef std::pair<int, int> P;

const int MAX_N = 100, MAX_C = 200, INF = std::numeric_limits<int>::max()>>2;

struct edge
{
	int from, to, cost;

	edge( int from, int to, int cost )
	:	from(from), to(to), cost(cost)
	{}
};

int N, C;
std::string cst[MAX_C];
std::vector<edge> es;
std::vector<P> ps;
int d[MAX_N];
bool nlp;

int read( int &p, const std::string &s )
{
	int ret = 0;

	while( p < s.size() && isdigit(s[p]) )
		ret *= 10, ret += s[p++]-'0';

	return ret;
}

void bellmanFord()
{
	std::fill( d, d+N, INF );
	d[0] = 0;
	nlp = false;

	rep( j, N )
	{
		rep( i, es.size() ) if( d[es[i].from]+es[i].cost < d[es[i].to] )
		{
			d[es[i].to] = d[es[i].from]+es[i].cost;

			if( j == N-1 )
			{ nlp = true; }
		}
	}

	return;
}

int main()
{
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);

	std::cin >> N >> C;
	rep( i, C )
	{
		std::cin >> cst[i];

		int p = 0, a = 0, b = 0, t = 0, d = 0;
		bool pm;

		a = read( p, cst[i] );
			
		if( cst[i][p] == '<' )
			t = 0, p += 2;
		else if( cst[i][p] == '>' )
			t = 1, p += 2;
		else
			t = 2, ++p;

		b = read( p, cst[i] );
		pm = cst[i][p++]=='+';
		d = read( p, cst[i] );

		--a; --b;

		if( !t )
		{
			es.push_back( edge( b, a, 0 ) );
			es.push_back( pm?edge( b, a, -d ):edge( a, b, d ) );
		}
		else if( t == 1 )
		{
			es.push_back( edge( a, b, 0 ) );
			es.push_back( pm?edge( a, b, -d ):edge( b, a, d ) );
		}
		else
			ps.push_back( P( a, b ) );
	}

	bool imp = true;
	int ans = 0;

	if( ps.empty() )
	{
		bellmanFord();
		
		imp &= nlp;

		rep( j, N )
			ans = std::max( ans, d[j] );
	}

	rep( i, 1<<ps.size() )
	{
		rep( j, ps.size() )
			es.push_back( i>>j&1?edge( ps[j].first, ps[j].second, 0 ):edge( ps[j].second, ps[j].first, 0 ) );

		 bellmanFord();

		 imp &= nlp;

		 rep( j, N )
			 ans = std::max( ans, d[j] );

		 rep( j, ps.size() )
			es.pop_back();
	}

	if( imp )
		std::cout << -1 << std::endl;
	else if( ans == INF )
		std::cout << "inf" << std::endl;
	else
		std::cout << ans << std::endl;

	return 0;
}

Compiler output:
a.cc:9:48: error: 'numeric_limits' is not a member of 'std'
    9 | const int MAX_N = 100, MAX_C = 200, INF = std::numeric_limits<int>::max()>>2;
      |                                                ^~~~~~~~~~~~~~
a.cc:9:63: error: expected primary-expression before 'int'
    9 | const int MAX_N = 100, MAX_C = 200, INF = std::numeric_limits<int>::max()>>2;
      |                                                               ^~~
Language: Java

import java.util.Scanner;

//0305
public class a {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        while (n-- > 0) {
            int r = sc.nextInt();
            int t = sc.nextInt();
            String a = "";
            for (int y = 0; y < ( t % 30 > 0 ? 2 : 1); y++) {
                for (int x = 0; x < (r % 100 > 0 ? 2 : 1); x++) {
                    if ((x | y) == 1) {
                        a += " ";
                    }
                    a += (t / 30 + y) * 5 + r / 100 + x;
                }
            }
            System.out.println(a);
        }
    }
}


Compiler output:
Main.java:4: error: class a is public, should be declared in a file named a.java
public class a {
       ^
1 error
Language: Java

import java.util.Scanner;

public class a{
public static void main(String[]args){
Scanner sc = new Scanner(System.in);
int n=sc.nextInt();
while(n-->0){
int r=sc.nextInt(),t=sc.nextInt();String a="";
for(int y=0;y<(t%30>0?2:1);y++)
for(int x=0;x<(r%100>0?2:1);x++,a+=(t/30+y)*5+r/100+x)
if((x|y)==1)
a+="";
System.out.println(a);
}
}
}


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

#include <stdio.h>
int main(){
    int n;
    scanf("%d",&n);
    while(n--){
        scanf("%d%d",&r,&t);
        if(r%100==0){
            if(t%60==0)printf("%d\n",(t/60)*5+r/100);
            else printf("%d %d\n",(t/60)*5 +r/100,(t/60+1)*5 +r/100);
        }
        else{
            if(t%60==0)printf("%d %d\n",(t/60)*5+ r/100,(t/60)*5+ r/100 +1);
            else printf("%d %d %d %d\n",(t/60)*5+ r/100,(t/60)*5+ r/100 +1,(t/60)*5+ r/100 +5,(t/60)*5+ r/100 +6);
            
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:23: error: 'r' was not declared in this scope
    6 |         scanf("%d%d",&r,&t);
      |                       ^
a.cc:6:26: error: 't' was not declared in this scope
    6 |         scanf("%d%d",&r,&t);
      |                          ^
Language: C++

#include <set>
using namespace std;
int main(){
	int n,x0,y0,x1,y1;
	for(scanf("%d",&n);n--;){
		scanf("%d%d",&x0,&y0);
		x1=(x0+99)/100;
		y1=(y0+29)/30;
		x0/=100;
		y0/=30;
		set<int>se;
		se.insert(y0*5+x0);
		se.insert(y0*5+x1);
		se.insert(y1*5+x0);
		se.insert(y1*5+x1);
		bool first=true;
		for(set<int>::iterator it=se.begin();it!=se.end();++it){
			if(!first)putchar(' ');
			first=false;
			printf("%d",*it);
		}
		puts("");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: 'scanf' was not declared in this scope
    5 |         for(scanf("%d",&n);n--;){
      |             ^~~~~
a.cc:18:35: error: 'putchar' was not declared in this scope; did you mean 'char'?
   18 |                         if(!first)putchar(' ');
      |                                   ^~~~~~~
      |                                   char
a.cc:20:25: error: 'printf' was not declared in this scope
   20 |                         printf("%d",*it);
      |                         ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    1 | #include <set>
  +++ |+#include <cstdio>
    2 | using namespace std;
a.cc:22:17: error: 'puts' was not declared in this scope
   22 |                 puts("");
      |                 ^~~~
Language: C++

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

int main(){
  int n;
  int r;
  int t;
  vector<int> target;
  vector<int> k;
  vector<vector<int>> result;
  
  cin >> n;
  
  for(int i=0;i<n;++i){
    cin>>r>>t;
    
    if(r==100)
      target.push_back(1);
    
    else if(r>100 && r<200){
      target.push_back(1);
      target.push_back(2);
    }
    else if(r==200)
      target.push_back(2);
    
    else if(r>200 && r<300){
      target.push_back(2);
      target.push_back(3);
    }
    else if(r==300)
      target.push_back(3);
    
    else if(r>300 && r<400){
      target.push_back(3);
      target.push_back(4);
    }
    
    else if(r==400)
      target.push_back(4);
    
    else if(r>400 && r<500){
      target.push_back(4);
      target.push_back(5);
    }
    else if(r==500)
      target.push_back(5);
    
    if(t==30 || t==60 || t==90 || t==120 || t==150 || t==180){
      for(auto& i:target)
	i+=(t/6);
    }
    
    else{
      if(t>0 && t<30){
	for(auto i:target)
	  target.push_back(i+5);
      }
      
      else if(t>30 && t<60){
	for(auto& i:target){
	  i+=5;
	}
      
      else if(t>60 && t<90){
	for(auto& i:target){
	  i+=10;
	}
      }
      
      else if(t>90 && t<120){
	for(auto& i:target){
	  i+=15;
	}
      }
      
      else if(t>120 && t<150){
	for(auto& i:target){
	  i+=20;
	}
      }
      
      else if(t>150 && t<180){
	for(auto& i:target){
	  i+=25;
	}
      }
      
      for(auto& i:target){
	k.push_back(i+5);
      }
      for(auto i:k)
	target.push_back(i);
    }  
    result.push_back(target);
    target.clear();
    k.clear();
  }
  
  for(int i=0;i<n;++i){
    bool flag=false;
    for(auto j:result[i]){
      if(flag==true)
	cout<<" ";
      cout<<j;
      if(flag!=true)
	flag=true;
    }
    cout<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:7: error: expected '}' before 'else'
   66 |       else if(t>60 && t<90){
      |       ^~~~
a.cc:61:28: note: to match this '{'
   61 |       else if(t>30 && t<60){
      |                            ^
Language: C++

include<iostream>
using namespace std;

int main(){

        int n;
        cin>>n;
        int r[51],t[51];
        for(int i=0;i<n;i++){
        int bufa=0;
        cin>>r[i]>>t[i];
         
        if(r[i]%100==0){
         if(t[i]%30==0||t[i]==0){
              cout<<(r[i]/100)+5*(t[i]/30)<<endl;//頂点上
          }
         else {
               bufa=(r[i]/100)+5*(t[i]/30);
              cout<<bufa<<" "<<bufa+5<<endl;//円弧上
          }
         }
         else if(t[i]%30==0||t[i]==0){
               bufa=(r[i]/100)+5*(t[i]/30);
              cout<<bufa<<" "<<bufa+1<<endl;//直線上
         }
         else{
              cout<<bufa<<" "<<bufa+1<<" "<<bufa+5<<" "<<bufa+6<<endl;
         }







Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin>>n;
      |         ^~~
a.cc:15:15: error: 'cout' was not declared in this scope
   15 |               cout<<(r[i]/100)+5*(t[i]/30)<<endl;//頂点上
      |               ^~~~
a.cc:15:45: error: 'endl' was not declared in this scope
   15 |               cout<<(r[i]/100)+5*(t[i]/30)<<endl;//頂点上
      |                                             ^~~~
a.cc:19:15: error: 'cout' was not declared in this scope
   19 |               cout<<bufa<<" "<<bufa+5<<endl;//円弧上
      |               ^~~~
a.cc:19:40: error: 'endl' was not declared in this scope
   19 |               cout<<bufa<<" "<<bufa+5<<endl;//円弧上
      |                                        ^~~~
a.cc:24:15: error: 'cout' was not declared in this scope
   24 |               cout<<bufa<<" "<<bufa+1<<endl;//直線上
      |               ^~~~
a.cc:24:40: error: 'endl' was not declared in this scope
   24 |               cout<<bufa<<" "<<bufa+1<<endl;//直線上
      |                                        ^~~~
a.cc:27:15: error: 'cout' was not declared in this scope
   27 |               cout<<bufa<<" "<<bufa+1<<" "<<bufa+5<<" "<<bufa+6<<endl;
      |               ^~~~
a.cc:27:66: error: 'endl' was not declared in this scope
   27 |               cout<<bufa<<" "<<bufa+1<<" "<<bufa+5<<" "<<bufa+6<<endl;
      |                                                                  ^~~~
a.cc:28:11: error: expected '}' at end of input
   28 |          }
      |           ^
a.cc:9:29: note: to match this '{'
    9 |         for(int i=0;i<n;i++){
      |                             ^
a.cc:28:11: error: expected '}' at end of input
   28 |          }
      |           ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

include<iostream>
using namespace std;

int main(){

        int n;
        cin>>n;
        int r[51],t[51];
        for(int i=0;i<n;i++){
        int bufa=0;
        cin>>r[i]>>t[i];
         
        if(r[i]%100==0){
         if(t[i]%30==0||t[i]==0){
              cout<<(r[i]/100)+5*(t[i]/30)<<endl;//頂点上
          }
         else {
               bufa=(r[i]/100)+5*(t[i]/30);
              cout<<bufa<<" "<<bufa+5<<endl;//円弧上
          }
         }
         else if(t[i]%30==0||t[i]==0){
               bufa=(r[i]/100)+5*(t[i]/30);
              cout<<bufa<<" "<<bufa+1<<endl;//直線上
         }
         else{
              cout<<bufa<<" "<<bufa+1<<" "<<bufa+5<<" "<<bufa+6<<endl;
         }
      return 0;
}
        


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin>>n;
      |         ^~~
a.cc:15:15: error: 'cout' was not declared in this scope
   15 |               cout<<(r[i]/100)+5*(t[i]/30)<<endl;//頂点上
      |               ^~~~
a.cc:15:45: error: 'endl' was not declared in this scope
   15 |               cout<<(r[i]/100)+5*(t[i]/30)<<endl;//頂点上
      |                                             ^~~~
a.cc:19:15: error: 'cout' was not declared in this scope
   19 |               cout<<bufa<<" "<<bufa+5<<endl;//円弧上
      |               ^~~~
a.cc:19:40: error: 'endl' was not declared in this scope
   19 |               cout<<bufa<<" "<<bufa+5<<endl;//円弧上
      |                                        ^~~~
a.cc:24:15: error: 'cout' was not declared in this scope
   24 |               cout<<bufa<<" "<<bufa+1<<endl;//直線上
      |               ^~~~
a.cc:24:40: error: 'endl' was not declared in this scope
   24 |               cout<<bufa<<" "<<bufa+1<<endl;//直線上
      |                                        ^~~~
a.cc:27:15: error: 'cout' was not declared in this scope
   27 |               cout<<bufa<<" "<<bufa+1<<" "<<bufa+5<<" "<<bufa+6<<endl;
      |               ^~~~
a.cc:27:66: error: 'endl' was not declared in this scope
   27 |               cout<<bufa<<" "<<bufa+1<<" "<<bufa+5<<" "<<bufa+6<<endl;
      |                                                                  ^~~~
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;

int main(){

        int n;
        cin>>n;
        int r[51],t[51];
        for(int i=0;i<n;i++){
        int bufa=0;
        cin>>r[i]>>t[i];
         
        if(r[i]%100==0){
         if(t[i]%30==0||t[i]==0){
              cout<<(r[i]/100)+5*(t[i]/30)<<endl;//頂点上
          }
         else {
               bufa=(r[i]/100)+5*(t[i]/30);
              cout<<bufa<<" "<<bufa+5<<endl;//円弧上
          }
         }
         else if(t[i]%30==0||t[i]==0){
               bufa=(r[i]/100)+5*(t[i]/30);
              cout<<bufa<<" "<<bufa+1<<endl;//直線上
         }
         else{
              cout<<bufa<<" "<<bufa+1<<" "<<bufa+5<<" "<<bufa+6<<endl;
         }
      return 0;
}
         


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

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

int main(){
  int n, r, t, ten[10];

  cin>>n;
  
  for(int i = 0; i < n; i++){
    cin>>r>>t;
    if(r%100 == 0){//cout<<"A"<<endl;
      if(t%30 == 0){//cout<<"B"<<endl;
	ten[0] = r/100 + (t/30)*5;
	t =1;
      } else {
	ten[0] = r/100 + (t/30)*5;
	ten[1] = r/100 + (t/30)*5 + 5;
	t = 2;
      }
    } else{
      if(t%30 == 0{
	ten[0] = r/100 + (t/30)*5;
	ten[1] = r/100+1 + (t/30)*5;
	t = 2;
      }else{
	ten[0] = r/100 + (t/30)*5;
	ten[1] = r/100 + (t/30)*5 + 5;
	ten[2] = r/100+1 + (t/30)*5;
	ten[3] = r/100+1 + (t/30)*5 + 5;
	t = 4;
      }
    }

    sort(ten, ten + t);
    for(int j = 0; j < t; j++){
      if(j) cout<<" ";
      cout<<ten[j];
    }cout<<endl;
  }
  
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:19: error: expected ')' before '{' token
   21 |       if(t%30 == 0{
      |         ~         ^
      |                   )
a.cc:32:5: error: expected primary-expression before '}' token
   32 |     }
      |     ^
Language: C

#include <stdio.h>
#include <string.h>

char result[12];
int num;
char p:

int main()
{
  int rem,flag;

  scanf("%d",&num);
  memset(result,0,sizeof(result));
  p=result[10];
  while(num)
    {
      flag=0;
      rem = num % 3;
      if(num==1)
	p[0]++;
      else if(num==2)
	{
	  p[0]--;
	  p[-1]++;
	  flag = 1;
	}
      num /= 3;
    }
  if(flag==0)
    p++;
  for(p<result+11;p++)
    printf("%c",ans[p[0]+1]);
  return(0);
}

Compiler output:
main.c:6:7: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
    6 | char p:
      |       ^
Language: C++

#include <string>
#include <iostream>
#pragma warning(disable : 4996)
using namespace std;
const int power[12] = { 1, 3, 9, 27, 91, 243, 729, 2187, 6561, 19683, 59049, 177141 };
int n;
void solve(int x, int v, string S) {
	if (x == 12) return;
	if (v == n) { reverse(S.begin(), S.end()); printf("%s\n", S.c_str()); return; }
	solve(x + 1, v - power[x], S + '-');
	solve(x + 1, v, S + '0');
	solve(x + 1, v + power[x], S + '+');
}
int main() {
	scanf("%d", &n); solve(0, 0, "");
	return 0;
}

Compiler output:
a.cc: In function 'void solve(int, int, std::string)':
a.cc:9:23: error: 'reverse' was not declared in this scope
    9 |         if (v == n) { reverse(S.begin(), S.end()); printf("%s\n", S.c_str()); return; }
      |                       ^~~~~~~
Language: C++

import java.util.Scanner;
// 0306
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt(),a[]=new int[15],i=0;
        while(n>0) {
            a[i++]=(n+1)%3-1;
            n=(n-a[i-1])/3;
        }
        while(i-->0)
            System.out.print((a[i]==0?"0":a[i]>0?"+":"-")+(i==0?"\n":""));
    }
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:11: error: expected ':' before 'static'
    4 |     public static void main(String[] args) {
      |           ^~~~~~~
      |           :
a.cc:4:29: error: 'String' has not been declared
    4 |     public static void main(String[] args) {
      |                             ^~~~~~
a.cc:4:38: error: expected ',' or '...' before 'args'
    4 |     public static void main(String[] args) {
      |                                      ^~~~
a.cc:14:2: error: expected ';' after class definition
   14 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:9: error: 'Scanner' was not declared in this scope
    5 |         Scanner sc = new Scanner(System.in);
      |         ^~~~~~~
a.cc:6:15: error: 'sc' was not declared in this scope
    6 |         int n=sc.nextInt(),a[]=new int[15],i=0;
      |               ^~
a.cc:8:13: error: 'a' was not declared in this scope
    8 |             a[i++]=(n+1)%3-1;
      |             ^
a.cc:8:15: error: 'i' was not declared in this scope
    8 |             a[i++]=(n+1)%3-1;
      |               ^
a.cc:11:15: error: 'i' was not declared in this scope
   11 |         while(i-->0)
      |               ^
a.cc:12:13: error: 'System' was not declared in this scope
   12 |             System.out.print((a[i]==0?"0":a[i]>0?"+":"-")+(i==0?"\n":""));
      |             ^~~~~~
a.cc:12:31: error: 'a' was not declared in this scope
   12 |             System.out.print((a[i]==0?"0":a[i]>0?"+":"-")+(i==0?"\n":""));
      |                               ^
Language: C++

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

#define int long long
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}

int N;
vint G[2222];

bool used[222];
bool dfs(int v,int p,int s){
    if(used[v]){
        if(s==v)return true;
        return false;
    }
    used[v]=true;
    rep(i,G[v].size(){
        int to=G[v][i];
        if(to==p)continue;
        if(dfs(to,v,s))return true;
    }
    return false;
}

signed main(){
    cin>>N;
    rep(i,N){
        int a,b;
        string s;
        cin>>a>>s>>b;
        a--;b--;b+=100;
        if(s=="wait")G[a].pb(b);
        else G[b].pb(a);
    }

    bool f=false;
    rep(i,200){
        fill_n(used,200,false);
        f|=dfs(i,-1,i);
    }
    cout<<f<<endl;
    return 0;
}

Compiler output:
a.cc:55:2: error: unterminated argument list invoking macro "rep"
   55 | }
      |  ^
a.cc: In function 'bool dfs(long long int, long long int, long long int)':
a.cc:29:5: error: 'rep' was not declared in this scope
   29 |     rep(i,G[v].size(){
      |     ^~~
a.cc:29:8: error: expected '}' at end of input
   29 |     rep(i,G[v].size(){
      |        ^
a.cc:23:28: note: to match this '{'
   23 | bool dfs(int v,int p,int s){
      |                            ^
a.cc:28:12: warning: control reaches end of non-void function [-Wreturn-type]
   28 |     used[v]=true;
      |     ~~~~~~~^~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <numeric>
#include <iomanip>
#define fi first
#define se second
#define fcout(n) cout<<fixed<<setprecision((n))
#define cinl(str) getline(cin,(str))
using namespace std;
bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;}
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
double pie=acos(-1);
int INF=10000009;
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };

int V;
vi G[2005];
vi rG[2005];
vi vs;
bool used[2005];
int cmp[2005];
void add_edge(int from, int to){
	G[from].push_back(to);
	rG[to].push_back(from);
}

void dfs(int v){
	used[v] = true;
	for(int i = 0; i < G[v].size(); i++){
		if(!used[G[v][i]]) dfs(G[v][i]);
	}
	vs.push_back(v);
}

void rdfs(int v, int k){
	used[v] = true;
	cmp[v] = k;
	for(int i = 0; i < rG[v].size(); i++){
		if(used[rG[v][i]]) rdfs(rG[v][i], k);
	}
}

int scc(){
	memset(used, 0, sizeof(used));
	vs.clear();
	for(int v = 0; v < V; v++){
		if(!used[v]) dfs(v);		
	}
	memset(used, 0, sizeof(used));
	int k=0;
	for(int i = vs.size() - 1; i >= 0; i--){
		if(!used[vs[i]]) rdfs(vs[i], k++);
	}
	return k;
}

int main() {
	int n;
	string rel;
	int u[105],d[105];
	cin>>n;
	V = 2*n;
	for(int i = 0; i < n; i++){
		cin>>u[i]>>rel>>d[i];
		if(rel == "lock"){
			add_edge(d[i],u[i]);
		}
		else{
			add_edge(u[i],d[i]);
		}
	}
	int check = scc();
	if(check == 0){
		cout<<'0'<<endl;
	}
	else{
		cout<<'1'<<endl;
	}
}
//??????

Compiler output:
a.cc: In function 'int scc()':
a.cc:58:9: error: 'memset' was not declared in this scope
   58 |         memset(used, 0, sizeof(used));
      |         ^~~~~~
a.cc:14:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   13 | #include <iomanip>
  +++ |+#include <cstring>
   14 | #define fi first