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

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()
#define LL long long
#define pii pair<int,int>
#define pll pair<LL,LL>

using namespace std;

int main(){
    int N;cin>>N;
    LL a[N+1];REP(i,N)cin>>a[i+1];
    a[0]=0;

    for(int i=N;i>0;--i){
        LL ret = 0;
        for(int j=i;j<=N;j+=i)ret+=a[j];
        if(ret<0)for(int j=i;j<=N;j+=i)a[j]=0;
    }

    LL ans = accumulate(ALL(a));
    while(true){
        for(int i=N;i>0;--i){
            LL ret = 0;
            for(int j=i;j<=N;j+=i)ret+=a[j];
            if(ret<0)for(int j=i;j<=N;j+=i)a[j]=0;
        }
        if(ans == accumulate(ALL(a)))break;
        ans = accumulate(ALL(a));
    }



    cout<<ans<<endl;


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:20: error: request for member 'begin' in 'a', which is of non-class type 'long long int [(N + 1)]'
    3 | #define ALL(x) (x).begin(),(x).end()
      |                    ^~~~~
a.cc:21:25: note: in expansion of macro 'ALL'
   21 |     LL ans = accumulate(ALL(a));
      |                         ^~~
a.cc:3:32: error: request for member 'end' in 'a', which is of non-class type 'long long int [(N + 1)]'
    3 | #define ALL(x) (x).begin(),(x).end()
      |                                ^~~
a.cc:21:25: note: in expansion of macro 'ALL'
   21 |     LL ans = accumulate(ALL(a));
      |                         ^~~
a.cc:3:20: error: request for member 'begin' in 'a', which is of non-class type 'long long int [(N + 1)]'
    3 | #define ALL(x) (x).begin(),(x).end()
      |                    ^~~~~
a.cc:28:30: note: in expansion of macro 'ALL'
   28 |         if(ans == accumulate(ALL(a)))break;
      |                              ^~~
a.cc:3:32: error: request for member 'end' in 'a', which is of non-class type 'long long int [(N + 1)]'
    3 | #define ALL(x) (x).begin(),(x).end()
      |                                ^~~
a.cc:28:30: note: in expansion of macro 'ALL'
   28 |         if(ans == accumulate(ALL(a)))break;
      |                              ^~~
a.cc:3:20: error: request for member 'begin' in 'a', which is of non-class type 'long long int [(N + 1)]'
    3 | #define ALL(x) (x).begin(),(x).end()
      |                    ^~~~~
a.cc:29:26: note: in expansion of macro 'ALL'
   29 |         ans = accumulate(ALL(a));
      |                          ^~~
a.cc:3:32: error: request for member 'end' in 'a', which is of non-class type 'long long int [(N + 1)]'
    3 | #define ALL(x) (x).begin(),(x).end()
      |                                ^~~
a.cc:29:26: note: in expansion of macro 'ALL'
   29 |         ans = accumulate(ALL(a));
      |                          ^~~
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
//int primes[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 110};
int n;
int removed[110];
ll val[110];
ll sum, ans;
void recurse(int p)
{
	ans = max(ans, sum);
	if (p > n) return;
	recurse(p+1);
	if (removed[i]) return;
	ll s = sum;
	for (int i = p; i <= n; i+=p)
	{
		if (!removed[i])
		{
			sum-=val[i];
		}
		removed[i]++;
	}
	if (sum > s) recurse(p+1);
	for (int i = p; i <= n; i+=p)
	{
		removed[i]--;
		if (!removed[i])
		{
			sum+=val[i];
		}
	}
}
int main()
{
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) { scanf("%lld", &val[i]); sum+=val[i]; }
	recurse(1);
	printf("%lld\n", ans);
}

Compiler output:
a.cc: In function 'void recurse(int)':
a.cc:14:21: error: 'i' was not declared in this scope
   14 |         if (removed[i]) return;
      |                     ^
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <climits>
#include <cassert>

using namespace std;
typedef unsigned int index;

class Exec
{
private:
	size_t n;
	vector<long long> a;

public:
	Exec(){}

	void main()
	{
		if (n > 10 and rand() % 2)
		{
			cout << 0 << endl;
			return 0;
		}
		vector<long long> cv(n + 1);
		vector<vector<index>> back(n + 1);
		vector<bool> used(n + 1);
		for (index i = 1; i <= n; i++)
		{
			for (index j = 1; j * j <= i; j++)
			{
				if (i % j == 0)
				{
					cv[j] += a[i];
					back[i].push_back(j);
					if (j * j < i)
					{
						cv[i / j] += a[i];
						back[i].push_back(i / j);
					}
				}
			}
		}
		for (index i = (index)n; i != 0; i--)
		{
			if (cv[i] < 0)
			{
				for (index k = i; k <= n; k += i)
				{
					if (!used[k])
					{
						used[k] = true;
						for (auto j: back[k])
						{
							cv[j] -= a[k];
						}
					}
				}
			}
		}
		long long ans = 0;
		for (index i = 1; i <= n; i++)
		{
			if (!used[i])
				ans += a[i];
		}
		cout << ans << endl;
	}

	void read()
	{
		cin >> n;
		a.resize(n + 1);
		for (index i = 1; i <= n; i++)
		{
			cin >> a[i];
		}
	}

};

int main()
{
#ifdef ONPC
	assert(freopen("a.in", "r", stdin));
	assert(freopen("a.out", "w", stdout));
#else
#endif
	Exec a;
	a.read();
	a.main();
}


Compiler output:
a.cc: In member function 'void Exec::main()':
a.cc:25:32: error: return-statement with a value, in function returning 'void' [-fpermissive]
   25 |                         return 0;
      |                                ^
Language: Java

import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;
import java.util.stream.Stream;

class Main{
	static class System{
		private static final InputStream in=java.lang.System.in;
		private static final PrintWriter out=new PrintWriter(java.lang.System.out,false);
	}
	public static void main(String[]$){
		new Main().solve();
		System.out.flush();
	}
	static Scanner s=new Scanner(System.in);
	static IntStream REPS(int v){return IntStream.range(0,v);}
	static IntStream REPS(int l,int r){return IntStream.rangeClosed(l,r);}
	static int gInt(){return s.nextInt();}
	static long gLong(){return s.nextLong();}
	static long gDouble(){return s.nextLong();}

	static IntStream ints(int n){return REPS(n).map(i->gInt());}
	static Stream<String> strs(int n){return REPS(n).mapToObj(i->s.next());}

	private void solve(){
		//int n=gInt(),x=gInt(),y=gInt(),a[]=ints(n).toArray();
		int n=gInt(),a[]=ints(n).toArray();
      
      ほげ

		for(int d=1;d<n;++d) {
			int cdsum=0;
			for(int i=d-1;i<n;i+=d)
				cdsum+=a[i];
			if(cdsum<0) {
				for(int i=d-1;i<n;i+=d)
					a[i]=0;
				System.out.println(d);
			}
		}
		System.out.println(Arrays.toString(a));
		System.out.println(Arrays.stream(a).sum());
	}
}

Compiler output:
Main.java:31: error: not a statement
      ??
      ^
Main.java:31: error: ';' expected
      ??
        ^
2 errors
Language: C++

/*
 * Author : Remilia Scarlet
 */

// #pragma comment(linker, "/STACK:102400000,102400000")

#include <bits/stdc++.h>

#define For(i,l,r) for(int _r=r,i=l;i<=_r;++i)
#define rep(i,l,r) for(int _r=r,i=l;i<_r;++i)
#define dto(i,r,l) for(int _l=l,i=r;i>=_l;--i)
#define x first
#define y second
#define pb push_back
#define mk make_pair
#define oo (c=getchar())
#define SZ(V) (int(V.size()))
#define ALL(V) V.begin(),V.end()

using namespace std;

typedef double db;
typedef long long LL;
typedef pair<int ,int> PII;
typedef vector<int> VI;
typedef complex<db> cpx;
typedef vector<PII> VII;
// typedef __int128 bigint;

int ran(){return (rand()<<15)+rand();}

int IN(){
	int x=0;char c;
	for(;oo<48 && c^'-' || c>57;);bool f=c=='-';if(f)oo;
	for(;c>47 && c<58;oo)x=(x<<1)+(x<<3)+c-48;return f?-x:x;
}
void print(int x,char en='\n'){
	printf("%d",x);if(en)putchar(en);
}

void hello(){
	freopen("remi.in 

","r",stdin);
//	freopen("remi.out","w",stdout);
//	srand(time(0));
}

int n,ans,a[111],b[111],g[111],h[111];
bool pr[111];

int main(int argc, char* argv[]){
	n = IN();
	For(i,1,n)a[i] = IN();
	For(i,2,n)pr[i] = 1;
	For(i,2,n)for(int j=i+i;j<=n;j+=i)pr[j] = 0;
	ans = 0 ;
	For(i,2,n)if(i*i<=n && pr[i])g[++*g] = i;else if(pr[i])h[++*h] = i;
	rep(mask,0,1<<(*g)){
		For(i,1,n)b[i] = a[i];
		rep(i,0,*g)if(mask>>i&1){
			int x = g[i+1];
			for(int y=x;y<=n;y+=x)b[y] = 0;
		}
		For(i,1,*h){
			int tmp = 0;
			for(int x=h[i];x<=n;x+=h[i])tmp+=b[x];
			if(tmp<0){
				for(int x=h[i];x<=n;x+=h[i])b[x] = 0;
			}
		}
		int res= 0;
		For(i,1,n)res+=b[i];
		ans =  max(ans,res);
	}
	print(ans);
}

Compiler output:
a.cc:42:17: warning: missing terminating " character
   42 |         freopen("remi.in
      |                 ^
a.cc:42:17: error: missing terminating " character
   42 |         freopen("remi.in
      |                 ^~~~~~~~ 
a.cc:44:5: warning: missing terminating " character
   44 | ","r",stdin);
      |     ^
a.cc:44:5: error: missing terminating " character
   44 | ","r",stdin);
      |     ^~~~~~~~~
a.cc: In function 'void hello()':
a.cc:44:1: error: unable to find string literal operator 'operator""r' with 'const char [2]', 'long unsigned int' arguments
   44 | ","r",stdin);
      | ^~~~
Language: C++

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

#ifdef LOCAL
#include "debug.h"
#else
#define DEBUG(...)
#endif

template <class T, class F> struct lazy_segtree {
  const int n;
  vector<T> t;
  vector<F> d;
  lazy_segtree(int _n = 0) : n(_n), t(2 * n), d(n) {}
  T& operator[](int i) { return t[n + i]; }
  void build() { for (int i = n; i--; ) t[i] = t[2 * i] * t[2 * i + 1]; }
  void apply(int i, F f) {
    t[i] = f(t[i]);
    if (i < n) d[i] = d[i] * f;
  }
  void push(int i) {
    apply(2 * i, d[i]), apply(2 * i + 1, d[i]);
    d[i] = F();
  }
  void push_down(int i) {
    for (int h = __lg(i), tz = __builtin_ctz(i); h > tz; --h) push(i >> h);
  }
  void pull_up(int i) {
    while (i >>= 1) t[i] = t[2 * i] * t[2 * i + 1];
  }
  T fold(int l, int r) {
    push_down(l += n), push_down(r += n);
    T a, b;
    for (; l < r; l >>= 1, r >>= 1) {
      if (l & 1) a = a * t[l++];
      if (r & 1) b = t[--r] * b;
    }
    return a * b;
  }
  T get(int i) { return fold(i, i + 1); }
  void act(int l, int r, F f) {
    push_down(l += n), push_down(r += n);
    for (int i = l, j = r; i < j; i >>= 1, j >>= 1) {
      if (i & 1) apply(i++, f);
      if (j & 1) apply(--j, f);
    }
    pull_up(l >> __builtin_ctz(l)), pull_up(r >> __builtin_ctz(r));
  }
  void set(int i, T a) {
    push_down(i += n), push_down(i + 1);
    t[i] = a;
    pull_up(i);
  }
};

template <class T> struct mini {
  T v = inf<T>;
  mini operator*(mini b) const {
    return b.v < v ? b : *this;
  }
};
struct chmin {
  int v = 1e9;
  chmin operator*(chmin g) const {
    return {min(v, g.v)};
  }
  mini<int> operator()(mini<int> x) const {
    return {min(x.v, v)};
  }
};

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> b(n);
  for (auto&& e : b) cin >> e;
  int m;
  cin >> m;
  vector<vector<int>> ls(n + 1);
  while (m--) {
    int l, r;
    cin >> l >> r;
    --l;
    ls[r].push_back(l);
  }
  vector<int> cum(n + 1);
  for (int i = n; i--; ) {
    cum[i] = (1 - b[i]) + cum[i + 1];
  }
  lazy_segtree<mini<int>, chmin> seg(n + 1);
  seg.set(0, {cum[0]});
  for (int r = 1; r <= n; ++r) {
    seg.set(r, {cum[r] + (seg.get(r - 1).v - cum[r - 1]) + b[r - 1]});
    for (int l : ls[r]) {
      seg.act(l + 1, r + 1, {seg.get(l).v});
    }
  }
  cout << seg.get(n).v << '\n';
}


Compiler output:
a.cc:57:9: error: 'inf' was not declared in this scope; did you mean 'ynf'?
   57 |   T v = inf<T>;
      |         ^~~
      |         ynf
a.cc:57:14: error: expected primary-expression before '>' token
   57 |   T v = inf<T>;
      |              ^
a.cc:57:15: error: expected primary-expression at end of input
   57 |   T v = inf<T>;
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
struct SegTree{
	vector<int> val;
	void build(){
		val.resize((1<<19));
		for(auto &v:val){
			v=INT_MIN;
		}
	}
	void modify(int x,int v){
		x+=(1<<18)-1;
		val[x]=v;
		while(x>0){
			x=(x-1)/2;
			val[x]=max(val[x*2+1],val[x*2+2]);
		}
	}
	int query(int lc,int rc,int x=0,int l=0,int r=(1<<18)){
		if(rc<=l||lc>=r){
			return INT_MIN;
		}
		if(l>=lc&&r<=rc){
			return val[x];
		}
		int mid=(l+r)/2;
		return max(query(lc,rc,x*2+1,l,mid),query(lc,rc,x*2+2,mid,r));
	}
}seg,seg2;
int n;
int b[210000];
int sum[210000];
int ans;
int main(){
	seg.build(),seg2.build();
	cin>>n;
	for(int i=0;i<n;++i){
		cin>>b[i];
		sum[i+1]=sum[i]+!b[i];
	}
	int q;
	cin>>q;
	vector<pair<int,int> > qs(q);
	for(int i=0;i<q;++i){
		cin>>qs[i].first>>qs[i].second;
	}
	sort(qs.begin(),qs.end());
	for(auto op:qs){
		int l=op.first,r=op.second;
		int v=r-l+1-2*(sum[r]-sum[l-1]);
		int res=max(0,seg.query(0,l));
		res+=v;
		int res2=seg2.query(l,r+1);
		if(res2!=INT_MIN){
			res2+=r-2*sum[r];
		}
		int Res=max(res,res2);
		ans=max(Res,ans);
		seg.modify(r,val);
		seg.modify(r,val-r+2*sum[r]);
	}
	cout<<n-sum[n]-ans<<'\n';
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:30: error: 'val' was not declared in this scope
   59 |                 seg.modify(r,val);
      |                              ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
struct SegTree{
	vector<int> val;
	void build(){
		val.resize((1<<19));
		for(auto &v:val){
			v=INT_MIN;
		}
	}
	void modify(int x,int v){
		x+=(1<<18)-1;
		val[x]=v;
		while(x>0){
			x=(x-1)/2;
			val[x]=max(val[x*2+1],val[x*2+2]);
		}
	}
	int query(int lc,int rc,int x=0,int l=0,int r=(1<<18)){
		if(rc<=l||lc>=r){
			return INT_MIN;
		}
		if(l>=lc&&r<=rc){
			return val[x];
		}
		int mid=(l+r)/2;
		return max(query(lc,rc,x*2+1,l,mid),query(lc,rc,x*2+2,mid,r));
	}
}seg,seg2;
int n;
int b[210000];
int sum[210000];
int ans;
int main(){
	seg.build(),seg2.build();
	cin>>n;
	for(int i=0;i<n;++i){
		cin>>b[i];
		sum[i+1]=sum[i]+!b[i];
	}
	int q;
	cin>>q;
	vector<pair<int,int> > qs(q);
	for(int i=0;i<q;++i){
		cin>>qs[i].first>>qs[i].second;
	}
	sort(qs.begin(),qs.end());
	for(auto op:qs){
		int l=op.first,r=op.second;
		int v=r-l+1-2*(sum[r]-sum[l-1]);
		int res=max(0,seg.query(0,l));
		res+=v;
		int res2=seg2.query(l,r+1);
		if(res2!=INT_MIN){
			res2+=r-2*sum[r];
		}
		int Res=max(res,res2);
		ans=max(Res,ans);
		seg.upd(r,val);
		seg.upd(r,val-r+2*sum[r]);
	}
	cout<<n-sum[n]-ans<<'\n';
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:21: error: 'struct SegTree' has no member named 'upd'
   59 |                 seg.upd(r,val);
      |                     ^~~
a.cc:59:27: error: 'val' was not declared in this scope
   59 |                 seg.upd(r,val);
      |                           ^~~
a.cc:60:21: error: 'struct SegTree' has no member named 'upd'
   60 |                 seg.upd(r,val-r+2*sum[r]);
      |                     ^~~
Language: C++

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

//
// BEGIN Range minimum query
//

struct {
    int N;
    vector<long long> dat;

    void init(int n) {
      N = 1;
      while(N < n) N *= 2;
      dat.resize(2*N-1, LLONG_MAX);
    }

    // update k-th element
    void update(int k, long long a) {
      k += N-1;
      dat[k] = a;
      while(k > 0) {
        k = (k-1)/2;
        dat[k] = min(dat[k*2+1], dat[k*2+2]);
      }
    }

    // add k-th element by a
    void add(int k, long long a) {
      k += N-1;
      dat[k] += a;
      while(k > 0) {
        k = (k-1)/2;
        dat[k] = min(dat[k*2+1], dat[k*2+2]);
      }
    }

    // return k-th element
    long long get(int k) {
      return dat[k+N-1];
    }

    // return min[a, b)
    long long query(int a, int b) {
      return query(a, b, 0, 0, N);
    }
    long long query(int a, int b, int k, int l, int r) {
      if (r <= a || b <= l) return LLONG_MAX;
      if (a <= l && r <= b) return dat[k];
      int m = (l+r)/2;
      return min(query(a, b, k*2+1, l, m), query(a, b, k*2+2, m, r));
    }
} S;

//
// END range_minimum_query
//

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  int n; cin >> n;
  S.init(n+1);
  vector<int> b(n);
  int zero = 0;
  rep(i, n) {
    cin >> b[i];
    if (b[i]==0) zero++;
  }
  int q; cin >> q;
  vector<P> ra(q);
  rep(i, q) {
    ll l, r; cin >> l >> r;
    ra[i].first = l;
    ra[i].second = r;
  }
  sort(ra.begin(), ra.end());
  S.update(0, 0);
  int j = 0;
  for(int i=1; i<=n; i++) {
    while(j < q && ra[j].first==i) {
      int l = ra[j].first;
      int r = ra[j].second;
      auto mi = S.query(l-1, r);
      if (mi < S.get(r)) {
        S.update(r, mi);
      }
      j++;
    }
    auto p = (b[i-1]==0) ? -1 : 1;
    auto mi = S.get(i-1)+p;
    if (mi < S.get(i)) {
      S.update(i, mi);
    }
  }
  cout << zero+S.get(n) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:10: error: 'P' was not declared in this scope
   74 |   vector<P> ra(q);
      |          ^
a.cc:74:11: error: template argument 1 is invalid
   74 |   vector<P> ra(q);
      |           ^
a.cc:74:11: error: template argument 2 is invalid
a.cc:77:7: error: invalid types 'int[int]' for array subscript
   77 |     ra[i].first = l;
      |       ^
a.cc:78:7: error: invalid types 'int[int]' for array subscript
   78 |     ra[i].second = r;
      |       ^
a.cc:80:11: error: request for member 'begin' in 'ra', which is of non-class type 'int'
   80 |   sort(ra.begin(), ra.end());
      |           ^~~~~
a.cc:80:23: error: request for member 'end' in 'ra', which is of non-class type 'int'
   80 |   sort(ra.begin(), ra.end());
      |                       ^~~
a.cc:84:22: error: invalid types 'int[int]' for array subscript
   84 |     while(j < q && ra[j].first==i) {
      |                      ^
a.cc:85:17: error: invalid types 'int[int]' for array subscript
   85 |       int l = ra[j].first;
      |                 ^
a.cc:86:17: error: invalid types 'int[int]' for array subscript
   86 |       int r = ra[j].second;
      |                 ^
Language: C++

#include <bits/stdc++.h>
#define mod 1000000007
#define mod998 998244353
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define mkp make_pair
typedef long long ll;
using namespace std;

int N, Q, tree[1 << 19], s[1 << 18], DP[1 << 18];
pair<int, int>lr[200000];
bool b[1 << 18];

void update(int x, int t) {
	int l, r;
	l = r = x;
	x += 1 << 18;
	tree[x] = min(tree[x], t);
	while (x != 1) {
		if (x & 1) {
			l -= r - l + 1;
		}
		else {
			r += r - l + 1;
		}
		x /= 2;
		tree[x] = min(tree[x * 2] + (r - l + 1) / 2 - (s[r] - s[(l + r) / 2]), tree[x * 2 + 1]);
	}
}

int calc(int l, int r, int p, int q, int k) {
	if (r < p || q < l)return 0xE869120;
	if (p <= l&&r <= q)return tree[k] + q - r - (s[q] - s[r]);
	return min(calc(l, (l + r) / 2, p, q, k * 2), calc((l + r) / 2 + 1, r, p, q, k * 2 + 1));
}

int main() {
	cin >> N;
	for (int i = 1; i <= N; ++i) {
		cin >> b[i];
		s[i] = b[i] + s[i - 1];
	}
	cin >> Q;
	for (int i = 0; i < Q; ++i) {
		cin >> lr[i].first >> lr[i].second;
	}
	sort(lr, lr + Q);
	for (int i = 0; i < 1 << 18; ++i) {
		DP[i] = 0xE869120;
	}
	for (int i = 0; i < 1 << 19; ++i) {
		tree[i] = 0xE869120;
	}
	update(0, 0);
	DP[0] = 0;
	int t = 0;
	for (int i = 1; i <= N; ++i) {
		DP[i] = min(DP[i], DP[i - 1] + b[i]);
		while (t != Q&&lr[t].first == i) {
			DP[lr[t].second] = min(DP[lr[t].second], DP[lr[t].first - 1] + lr[t].second - lr[t].first + 1 - (s[lr[t].second] - s[lr[t].first - 1]));
			update(lr[t].second, calc(0, (1 << 18) - 1, lr[t].first, lr[t].second, 1));
			++t;
		}
	}
	cout << DP[N] << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:66:31: error: expected '}' at end of input
   66 |         cout << DP[N] << endl;
      |                               ^
a.cc:38:12: note: to match this '{'
   38 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

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

using namespace std;

const int MAX_N = 262144;

class SegTree {
public:
    SegTree();
    void update(int i, int x);
    int query(int a, int b, int k, int l, int r);
private:
    int dat[MAX_N * 2];
    int n;
};

SegTree::SegTree() {
    n = MAX_N;
    rep(i, 0, 2 * n) {
        dat[i] = INT_MAX;
    }
}

void SegTree::update(int i, int x) {
    i += n - 1;
    dat[i] = x;
    while (0 < i) {
        i = (i - 1) / 2;
        dat[i] = min(dat[i * 2 + 1], dat[i * 2 + 2]);
    }
}

int SegTree::query(int a, int b, int k = 0, int l = 0, int r = MAX_N) {
    if (r <= a || b <= l) return INT_MAX;
    if (a <= l && r <= b) return dat[k];
    else {
        int vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
        int vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
        return min(vl, vr);
    }
}

int N = 0;
int Q = 0;
vector<int> L[202020];
int B[202020];
int cnt = 0;

int solve() {
    SegTree seg;
    int d = 0;

    rep(i, 0, N) {
        for(int r : L[i]) {
            seg.update(r, min(d, seg.query(i, r + 1)));
        }
        d = min(d + (B[i] ? 1 : -1), seg.query(i, i + 1));
    }

    return d + cnt;
}

int main(int argc, const char * argv[]) {
    int b, l, r;

    cin >> N;
    rep(i, 0, N) {
        cin >> b;
        B[i] = b;
        if (!b) ++cnt;
    }

    cin >> Q;
    rep(i, 0, Q) {
        cin >> l >> r;
        --l;
        --r;
        L[l].push_back(r);
    }

    cout << solve() << endl;

    return 0;
}


Compiler output:
a.cc: In constructor 'SegTree::SegTree()':
a.cc:24:18: error: 'INT_MAX' was not declared in this scope
   24 |         dat[i] = INT_MAX;
      |                  ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <algorithm>
  +++ |+#include <climits>
    4 | 
a.cc: In member function 'int SegTree::query(int, int, int, int, int)':
a.cc:38:34: error: 'INT_MAX' was not declared in this scope
   38 |     if (r <= a || b <= l) return INT_MAX;
      |                                  ^~~~~~~
a.cc:38:34: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include"pch.h"
#include<bits/stdc++.h>
using namespace std;
#define lol(i,n) for(int i=0;i<n;i++)
#define chmax(a,b) a=max(a,b);
typedef long long ll;
#define N 20010
class RAQxRMQ {
private:
	ll dat[2 * N], laz[2 * N];
	ll eval(ll k) {
		if (k < N) {
			laz[k * 2] += laz[k];
			laz[k * 2 + 1] += laz[k];
		}
		dat[k] += laz[k],laz[k]=0;
		return dat[k];
	}
public:
	void init() {
		lol(i, 2 * N)dat[i] = -1e18, laz[i] = 0;
	}
	void add(ll l, ll r, ll x) {
		l += N, r += N + 1;
		for (ll a = l, b = r; a < b; a >>= 1, b >>= 1) {
			if (a & 1)laz[a++] += x;
			if (b & 1)laz[--b] += x;
		}
		for (ll a = l, b = r; a + b; a >>= 1, b >>= 1) {
			dat[a / 2] = max(eval(a), eval(a ^ 1));
			dat[b / 2] = max(eval(b), eval(b ^ 1));
		}
	}
	ll maxi(ll l, ll r) {
		l += N, r += N + 1;
		for (ll d = 20; d; d--) {
			eval(l >> d); eval(r >> d);
		}
		ll res = -1e18;
		for (ll a = l, b = r; a < b; a >>= 1, b >>= 1) {
			if (a & 1)chmax(res, eval(a++));
			if (b & 1)chmax(res, eval(--b));
		}
		return res;
	}
	void upd(ll i, ll x) {
		ll val = maxi(i, i);
		if (x < val)return;
		add(i, i, x-val);
	}
};
ll n, d[N], q;
vector<ll> v[N];
int main() {
	cin >> n;
	lol(i, n)cin >> d[i];
	cin >> q;
	lol(i, q) {
		ll a, b; cin >> a >> b; a--, b--;
		v[a].push_back(b);
	}
	RAQxRMQ seg; seg.init();
	seg.upd(0, 0);
	lol(i, n) {
		sort(v[i].begin(), v[i].end());
		for (auto to : v[i]) {
			seg.upd(to, seg.maxi(0, to - 1));
		}
		ll val = (d[i] == 0 ? -1 : +1);
		seg.add(i + 1, n+5, val);
	}
	ll ans = -seg.maxi(0, n+5);
	lol(i, n)ans += d[i];
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:1:9: fatal error: pch.h: No such file or directory
    1 | #include"pch.h"
      |         ^~~~~~~
compilation terminated.
Language: C++

#include <vector>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#define R register
inline int read(){
	R int x; R bool f; R char c;
	for (f=0; (c=getchar())<'0'||c>'9'; f=c=='-');
	for (x=c^'0'; (c=getchar())>='0'&&c<='9'; x=(x<<1)+(x<<3)+(c^'0'));
	return f?-x:x;
}
#define M (1<<18)
#define MN 200005
int T[M<<1],n,q,cost[MN],cnt;
std::vector<int> rang[MN];
inline void rw(int k,int v){for (k+=M; k; k>>=1) if (T[k]<=v) return; else T[k]=v;}
inline int query(int l,int r){
	R int res=0x3f3f3f3f;
	for (l+=M-1,r+=M+1; l^r^1; l>>=1,r>>=1){
		if (~l&1) res=std::min(T[l^1],res);
		if ( r&1) res=std::min(T[r^1],res);
	}return res;
}
int main(){
	n=read();for (R int i=1; i<=n; ++i)
		cost[i]=read()?1:-1,cnt+=(bool)(!(~cost[i]));
	q=read();for (R int i=1; i<=q; ++i)
		rang[read()].push_back(read())\;
	memset(T,0x3f,sizeof(T));rw(0,0);
	for (R int i=1; i<=n; ++i){
		for (auto j : rang[i]){
			R int res = T[i+M-1];
			res=std::min(res,query(std::max(i-1,1),j));
			rw(j,res);
		}rw(i,T[i+M-1]+cost[i]);
	}
	printf("%d\n",T[n+M]+cnt);
	return 0;
}

Compiler output:
a.cc:29:47: error: stray '\' in program
   29 |                 rang[read()].push_back(read())\;
      |                                               ^
a.cc: In function 'int read()':
a.cc:8:15: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    8 |         R int x; R bool f; R char c;
      |               ^
a.cc:8:25: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    8 |         R int x; R bool f; R char c;
      |                         ^
a.cc:8:35: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    8 |         R int x; R bool f; R char c;
      |                                   ^
a.cc: In function 'int query(int, int)':
a.cc:19:15: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   19 |         R int res=0x3f3f3f3f;
      |               ^~~
a.cc: In function 'int main()':
a.cc:26:29: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   26 |         n=read();for (R int i=1; i<=n; ++i)
      |                             ^
a.cc:28:29: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   28 |         q=read();for (R int i=1; i<=q; ++i)
      |                             ^
a.cc:31:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   31 |         for (R int i=1; i<=n; ++i){
      |                    ^
a.cc:33:31: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   33 |                         R int res = T[i+M-1];
      |                               ^~~
Language: C++

#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>

#define PB push_back

using namespace std;

const int N = 2e5 + 500;

vector < int > v[N];

int q,n,a[N],prf[N],dp[N];

int main(){
    scanf("%d",&n);
    if(n > 1000) return;
    for(int i = 0;i<n;i++){
        scanf("%d",a+i);
        prf[i] = !a[i];
        if(i)
            prf[i] += prf[i - 1];
    }
    scanf("%d",&q);
    for(int i = 0;i<q;i++){
        int x,y;scanf("%d%d",&x,&y);
        x--,y--;
        v[y].PB(x);
    }
    for(int i = 0;i<n;i++){
        dp[i] = a[i] + (i ? dp[i - 1] : 0);
        for(int j = 0;j<v[i].size();j++){
            dp[i] = min(prf[i] + (v[i][j] ? - prf[v[i][j] - 1] + dp[v[i][j] - 1] : 0), dp[i]);
            for(int k = v[i][j];k<i;k++)
                dp[k] = min(dp[k], (v[i][j] ? -prf[v[i][j] - 1] + dp[v[i][j] - 1] : 0) + prf[k]);
        }
    }
    printf("%d\n", dp[n - 1]);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: return-statement with no value, in function returning 'int' [-fpermissive]
   18 |     if(n > 1000) return;
      |                  ^~~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

struct Seg {
    int l, r;

    Seg(int l, int r) : l(l), r(r) {}

    Seg() {}
};

bool cmp(Seg &s1, Seg &s2) {
    return s1.r < s2.r;
}

int main() {
    int n;
    scanf("%d", &n);
    vector<int> b(n);
    vector<int> pb(n + 1), pw(n + 1);
    for (int i = 0; i < n; i++) {
        scanf("%d", &b[i]);
        pb[i + 1] = pb[i] + 1 - b[i];
        pw[i + 1] = pw[i] + b[i];
    }

    int q;
    scanf("%d", &q);
    vector<Seg> a(q);
    for (int i = 0; i < q; i++) {
        scanf("%d%d", &a[i].l, &a[i].r);
        a[i].l--;
        a[i].r--;
    }
    sort(a.begin(), a.end(), cmp);

    vector<int> dp(q, n + 1);

    for (int i = 0; i < q; i++) {
        int l = a[i].l, r = a[i].r;
        dp[i] = min(pb[r + 1] - pb[l] + pw[l], pw[r + 1]);
        for (int j = 0; j < i; j++) {
            int rr = a[j].r;
            if (rr < l) {
                dp[i] = min(dp[i], dp[j] + pb[r + 1] - pb[l] + pw[l] - pw[rr + 1]);
            } else {
                dp[i] = min(dp[i], dp[j] + pw[r + 1] - pw[rr]);
            }
        }
    }


    int ans = pw[n];
    for (int i = 0; i < q; i++) {
        ans = min(ans, dp[i] + pw[n] - pw[a[i].r + 1]);
    }

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   37 |     sort(a.begin(), a.end(), cmp);
      |     ^~~~
      |     short
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String s1 = sc.nextLine();
        String s2 = sc.nextLine();
        String list1[] = s.split("");
        String list2[] = s.split("");
        String ans = "";
        if(list1[0].equals(list2[2]) && list1[1].equals(list2[1] && list1[2].equals(list2[0]))){
            String ans = "Yes";
            System.out.println(ans);
        }else{
            String ans = "No";
            System.out.println(ans);
        }
        
    }
}


Compiler output:
Main.java:8: error: cannot find symbol
        String list1[] = s.split("");
                         ^
  symbol:   variable s
  location: class Main
Main.java:9: error: cannot find symbol
        String list2[] = s.split("");
                         ^
  symbol:   variable s
  location: class Main
Main.java:11: error: bad operand types for binary operator '&&'
        if(list1[0].equals(list2[2]) && list1[1].equals(list2[1] && list1[2].equals(list2[0]))){
                                                                 ^
  first type:  String
  second type: boolean
Main.java:12: error: variable ans is already defined in method main(String[])
            String ans = "Yes";
                   ^
Main.java:15: error: variable ans is already defined in method main(String[])
            String ans = "No";
                   ^
5 errors
Language: C++

#include <string>
using namespace std;
int main() {
	string c1, c2;
	cin >> c1 >> c2;
	if (c1[0] == c2[2] && c1[2] == c2[0])
		cout << "YES" << "\n";
	else
		cout << "NO" << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> c1 >> c2;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <string>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:7:17: error: 'cout' was not declared in this scope
    7 |                 cout << "YES" << "\n";
      |                 ^~~~
a.cc:7:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:17: error: 'cout' was not declared in this scope
    9 |                 cout << "NO" << "\n";
      |                 ^~~~
a.cc:9:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <set>

#include <regex>
#include <locale>
#include <iomanip>

using namespace std;
using ll = long long;

#define OVERLOAD3(_1,_2,_3,name,...) name
#define REP(i,n) REPI(i,0,n)
#define REPI(i,a,b) for(int i=int(a),i##_Len=int(b);i<i##_Len;++i)
#define rep(...) OVERLOAD3(__VA_ARGS__,REPI,REP,)(__VA_ARGS__)
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())

int main () {
  int s, t, sr, tr;
  cin >> sr >> tr;
  s = sr; reverse(ALL(sr));
  t = tr; reverse(ALL(tr));
  cout << (s==tr && t==sr ? "YES" : "NO") << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: request for member 'begin' in 'sr', which is of non-class type 'int'
   17 | #define ALL(x) (x).begin(),(x).end()
      |                    ^~~~~
a.cc:23:19: note: in expansion of macro 'ALL'
   23 |   s = sr; reverse(ALL(sr));
      |                   ^~~
a.cc:17:32: error: request for member 'end' in 'sr', which is of non-class type 'int'
   17 | #define ALL(x) (x).begin(),(x).end()
      |                                ^~~
a.cc:23:19: note: in expansion of macro 'ALL'
   23 |   s = sr; reverse(ALL(sr));
      |                   ^~~
a.cc:17:20: error: request for member 'begin' in 'tr', which is of non-class type 'int'
   17 | #define ALL(x) (x).begin(),(x).end()
      |                    ^~~~~
a.cc:24:19: note: in expansion of macro 'ALL'
   24 |   t = tr; reverse(ALL(tr));
      |                   ^~~
a.cc:17:32: error: request for member 'end' in 'tr', which is of non-class type 'int'
   17 | #define ALL(x) (x).begin(),(x).end()
      |                                ^~~
a.cc:24:19: note: in expansion of macro 'ALL'
   24 |   t = tr; reverse(ALL(tr));
      |                   ^~~
Language: C

#include<stdio.h>
int main(void){
	int i=0;
	char c[2][3];
	scan("%s%s%s",&c[0][0],&c[0][1],&c[0][2]);
	scan("%s%s%s",&c[1][0],&c[1][1],&c[1][2]);
	if(c[0][0]==c[1][2]){
		if(c[0][1]==c[1][1]){
			if(c[0][2]==c[1][0]){
				i=1;
			}
		}
	}
	if(i==1){
		printf("YES\n");
	}else{
		printf("NO\n");
	}
	return 0;
} 

Compiler output:
main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scan'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    5 |         scan("%s%s%s",&c[0][0],&c[0][1],&c[0][2]);
      |         ^~~~
      |         scanf
Language: C

#include<stdio.h>
#include<string>
int main(){
  char a[4],b[4];
  scanf("%c %c",&a,&b);
  if((a[0]==b[2])&&(a[1]==b[1])&&(a[2]==b[0]))
    printf("YES");
  else
    printf("NO");
  
  return 0;
}


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

#include<stdio.h>
#include<string.h>
int main(){
  char a[4],b[4];
  scanf("%c %c",&a[],&b[]);
  if((a[0]==b[2])&&(a[1]==b[1])&&(a[2]==b[0]))
    printf("YES");
  else
    printf("NO");
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:20: error: expected expression before ']' token
    5 |   scanf("%c %c",&a[],&b[]);
      |                    ^
Language: C

#include<stdio.h>
int main(){
  char a,b;
  scanf("%c %c",&a,&b);
  if((a[0]==b[2])&&(a[1]==b[1])&&(a[2]==b[0]))
    printf("YES");
  else
    printf("NO");
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:8: error: subscripted value is neither array nor pointer nor vector
    5 |   if((a[0]==b[2])&&(a[1]==b[1])&&(a[2]==b[0]))
      |        ^
main.c:5:14: error: subscripted value is neither array nor pointer nor vector
    5 |   if((a[0]==b[2])&&(a[1]==b[1])&&(a[2]==b[0]))
      |              ^
main.c:5:22: error: subscripted value is neither array nor pointer nor vector
    5 |   if((a[0]==b[2])&&(a[1]==b[1])&&(a[2]==b[0]))
      |                      ^
main.c:5:28: error: subscripted value is neither array nor pointer nor vector
    5 |   if((a[0]==b[2])&&(a[1]==b[1])&&(a[2]==b[0]))
      |                            ^
main.c:5:36: error: subscripted value is neither array nor pointer nor vector
    5 |   if((a[0]==b[2])&&(a[1]==b[1])&&(a[2]==b[0]))
      |                                    ^
main.c:5:42: error: subscripted value is neither array nor pointer nor vector
    5 |   if((a[0]==b[2])&&(a[1]==b[1])&&(a[2]==b[0]))
      |                                          ^
Language: C++

#include <iostream>

using namespace std;

int main()	{
  int a[3], b[3];
  for (int i = 0; i < 3; i++)	{
    cin >> a[i];
  }
  for (int j = 0; j < 3; j++)	{
    cin >> b[i];
  }
  for (int i = 0; i < 3; i++)	{
    if (a[i] != b[3 - i - 1])	{
      cout << "NO" << endl;
      return 0;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: 'i' was not declared in this scope
   11 |     cin >> b[i];
      |              ^
Language: C++

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

int main() {
  // 入力される(c11,c12,c13)をs1, (c21,c22,c23)をs2として入力
  string s1,s2;
  cin >> s1 >> s2;

  // s2をreverse関数を用いて反転させる
  reverse(s2.begin(),　s2.end());

  //「s1」と「反転させたs2」が同じなら 'YES' と表示
  if(s1 == s2) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}


Compiler output:
a.cc:10:22: error: extended character 　 is not valid in an identifier
   10 |   reverse(s2.begin(),　s2.end());
      |                      ^
a.cc: In function 'int main()':
a.cc:10:22: error: '\U00003000s2' was not declared in this scope
   10 |   reverse(s2.begin(),　s2.end());
      |                      ^~~~
Language: C++

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

int main() {
  // 入力される(c11,c12,c13)をs1, (c21,c22,c23)をs2として入力
  string s1,s2;
  cin >> s1 >> s2;

  // s2をreverse関数を用いて反転させる
  reverse(s2.begin(),s2.end())

  //「s1」と「反転させたs2」が同じなら 'YES' と表示
  if(s1 == s2) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:31: error: expected ';' before 'if'
   10 |   reverse(s2.begin(),s2.end())
      |                               ^
      |                               ;
......
   13 |   if(s1 == s2) {
      |   ~~                           
a.cc:15:5: error: 'else' without a previous 'if'
   15 |   } else {
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;
#include<string>
#include<strstream>
#include<sstream>

int main()
{
	string s, m;
	cin >> s >> m;
	reverse(s.begin(), s.end());
	if (s == m)
		cout << "YES";
	else
		cout << "NO";

}


Compiler output:
In file included from /usr/include/c++/14/backward/strstream:50,
                 from a.cc:4:
/usr/include/c++/14/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
   32 | #warning \
      |  ^~~~~~~
a.cc: In function 'int main()':
a.cc:11:9: error: 'reverse' was not declared in this scope
   11 |         reverse(s.begin(), s.end());
      |         ^~~~~~~
Language: C++

#include<bits/stdc++.h>
usingf namespace std;
int main()
{
string s1,s2;
  
  cin >> s1 >> s2;
  
  int sw=0;
  for(int i=0;i<3;++i)
  {if(s1.at(i)==s2.at(2-i)) sw++;
  }
  
  if(sw==3) cout <<"YES";
  else cout <<"NO";

return 0;}

Compiler output:
a.cc:2:1: error: 'usingf' does not name a type
    2 | usingf namespace std;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'string' was not declared in this scope
    5 | string s1,s2;
      | ^~~~~~
a.cc:5:1: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> s1 >> s2;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:10: error: 's1' was not declared in this scope; did you mean 'y1'?
    7 |   cin >> s1 >> s2;
      |          ^~
      |          y1
a.cc:7:16: error: 's2' was not declared in this scope
    7 |   cin >> s1 >> s2;
      |                ^~
a.cc:14:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |   if(sw==3) cout <<"YES";
      |             ^~~~
      |             std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |   else cout <<"NO";
      |        ^~~~
      |        std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main()
{
  string C[2];
  cin >> C[0] >> C[1];
  if ((C[0][0]==C[1][2]) && (C[0][1==C[1][1]) && (C[0][2==C[1][0])) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
                                                      


Compiler output:
a.cc: In function 'int main()':
a.cc:8:45: error: expected ']' before ')' token
    8 |   if ((C[0][0]==C[1][2]) && (C[0][1==C[1][1]) && (C[0][2==C[1][0])) {
      |                                             ^
      |                                             ]
a.cc:8:66: error: expected ']' before ')' token
    8 |   if ((C[0][0]==C[1][2]) && (C[0][1==C[1][1]) && (C[0][2==C[1][0])) {
      |                                                                  ^
      |                                                                  ]
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main()
{
  string C[2];
  cin >> C[0] >> C[1];
  if ((C[0][0]==C[1][2]) && (C[0][1==C[1][1) && (C[0][2==C[1][0])) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
                                                      

Compiler output:
a.cc: In function 'int main()':
a.cc:8:44: error: expected ']' before ')' token
    8 |   if ((C[0][0]==C[1][2]) && (C[0][1==C[1][1) && (C[0][2==C[1][0])) {
      |                                            ^
      |                                            ]
a.cc:8:44: error: expected ']' before ')' token
    8 |   if ((C[0][0]==C[1][2]) && (C[0][1==C[1][1) && (C[0][2==C[1][0])) {
      |                                            ^
      |                                            ]
a.cc:8:65: error: expected ']' before ')' token
    8 |   if ((C[0][0]==C[1][2]) && (C[0][1==C[1][1) && (C[0][2==C[1][0])) {
      |                                                                 ^
      |                                                                 ]
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int[] c = new int[6];
		for(int i=0; i<n; i++){
			c[i] = scn.nextInt();
		}
      	String ans = "NO";
      	if(c[0]==c[5] && c[1]==c[4] && c[2]==c[3]) ans = "YES";
      	System.out.println(ans);
	}
}

Compiler output:
Main.java:7: error: cannot find symbol
		for(int i=0; i<n; i++){
		               ^
  symbol:   variable n
  location: class Main
1 error
Language: C++

#include<bits/stdc++.h>
const int MOD = 1e9+7;
#define REP(i,n) for (int i = 0; i < (n); ++i)
#define ar array
using namespace std;
using ll = long long;
using P = pair<int,int>;

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

	char C11,C12,C13,C21,C22,C23;
	cin >> C11 >> c12 >> C13 >> C21 >> C22 >> C23;

	if (C11==C23 && C12==C22 && C13==C21) {
		cout << "YES" << endl;
	} else {
		cout << "NO" << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: 'c12' was not declared in this scope; did you mean 'C12'?
   14 |         cin >> C11 >> c12 >> C13 >> C21 >> C22 >> C23;
      |                       ^~~
      |                       C12
Language: C++

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

//type
#define ll long long
typedef pair<int, int> P;
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007    //10^9+7:合同式の法
#define MAXR 100000       //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first      //pairの一つ目の要素
#define S second     //pairの二つ目の要素
#define Z class
// OTHER
// xの二乗を返す (関数テンプレート版)
template <typename T>
T square(T x) { return x * x; }
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))
// loop
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= ll(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= ll(b); i--)
#define FORA(i, I) for (const auto &i : I)

// vector
#define ALL(x) x.begin(), x.end()

// output
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n", (x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define ln cout << '\n'
template <Z A>
void pr(A a)
{
  cout << a;
  ln;
}
template <Z A, Z B>
void pr(A a, B b)
{
  cout << a << ' ';
}

int ans = 0;
bool check = 0;
string s, t;
int N = 3;
vector<int> v(N);
int a, b;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

int main()
{
  cin >> s >> t;
  swap(s[0], s[2]);
  rep(i, 3)
  {
    if (s[i] != t[i])
    {

      NO();
      return 0;
    }
  }
  YES() :

          return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:9: error: expected ';' before ':' token
   74 |   YES() :
      |         ^
Language: Java

import java.util.Scanner;

public class Rotation {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s=scan.nextLine();
		String t=scan.nextLine();
		StringBuilder s1= new StringBuilder(t);
		s1.reverse();
		if(s.contains(s1)) System.out.println("YES");
		else System.out.println("NO");

	}

}


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

#include <iostream>
using namespace std;

int main()
{
  stirng s, t, res = "YES";
  cin >> s >> t;
  for(int i=0; i<3; i++)
    if(s[i] != t[2-i])
      res = "NO";
  
  cout << res << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'stirng' was not declared in this scope
    6 |   stirng s, t, res = "YES";
      |   ^~~~~~
a.cc:7:10: error: 's' was not declared in this scope
    7 |   cin >> s >> t;
      |          ^
a.cc:7:15: error: 't' was not declared in this scope; did you mean 'tm'?
    7 |   cin >> s >> t;
      |               ^
      |               tm
a.cc:10:7: error: 'res' was not declared in this scope
   10 |       res = "NO";
      |       ^~~
a.cc:12:11: error: 'res' was not declared in this scope
   12 |   cout << res << endl;
      |           ^~~
Language: C++

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

int main() {
  string a, b;cin>>a>>b;
  for (int i=0; i<(int);i++) {
    int j = (int)a.size() - i;
    if (a[i] != b[j]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:20: error: expected primary-expression before 'int'
    6 |   for (int i=0; i<(int);i++) {
      |                    ^~~
a.cc:6:20: error: expected ')' before 'int'
    6 |   for (int i=0; i<(int);i++) {
      |                   ~^~~
      |                    )
Language: C++

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

int main() {
  string a, b;cin>>a>>b;
  for (int i=0; i<(int);i++{
    int j = (int)a.size() - i;
    if (a[i] != b[j]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:20: error: expected primary-expression before 'int'
    6 |   for (int i=0; i<(int);i++{
      |                    ^~~
a.cc:6:20: error: expected ')' before 'int'
    6 |   for (int i=0; i<(int);i++{
      |                   ~^~~
      |                    )
a.cc:6:28: error: expected ')' before '{' token
    6 |   for (int i=0; i<(int);i++{
      |       ~                    ^
      |                            )