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

#include <bits/stdc++.h>
using namespace tsd;
int main(){
char a[100][100];
int b = 0,c = 0;
  
  cin >> b >> c;
  for(int Q = 0;Q < b;Q++){
  	for(int W = 0;W < c;W++){
    	cin >> a[Q][W];
    }
  }
  
  for(int Q = 0;Q < b;Q++){
    for(int S = 0;S < 2;S++){
  	for(int W = 0;W < c;W++){
    	cout << a[Q][W];
    }
    }
    cout << endl;
  }
return 0;
}

Compiler output:
a.cc:2:17: error: 'tsd' is not a namespace-name
    2 | using namespace tsd;
      |                 ^~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> b >> c;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:17:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |         cout << a[Q][W];
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:20:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |     cout << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:20:13: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   20 |     cout << endl;
      |             ^~~~
      |             std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
  int a,b;
  string h[100];
  cin>>a>>b;
  for(int i=0;i<a,i++){
    cin>>h[i];
    cout<<h[i]<<endl;
    cout<<h[i]<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: expected ';' before ')' token
    8 |   for(int i=0;i<a,i++){
      |                      ^
      |                      ;
Language: C++

#include <bits/stdc++.h>
#define rep(i, a, b) for(int i=(a);i<(b);++i)
using namespace std;

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

const int INF = (1 << 30) - 1;
const ll INF64 = ((ll)1 << 62) - 1;
const ll MOD = 1e9 + 7;
const double PI = 3.1415926535897932384626433832795;

int main()
{
	ll a, b;
	cin >> a >> b;
	string c[b];
	for (int i = 0; i < b; ++i)
	{
		cin >> c[i]
	}
	for (int i = 0; i < b; ++i)
	{
		for (int j = 0; j < 2; ++j)
		{
			cout << c[i] << endl;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:28: error: expected ';' before '}' token
   20 |                 cin >> c[i]
      |                            ^
      |                            ;
   21 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>
#define rep(i, a, b) for(int i=(a);i<(b);++i)
using namespace std;

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

const int INF = (1 << 30) - 1;
const ll INF64 = ((ll)1 << 62) - 1;
const ll MOD = 1e9 + 7;
const double PI = 3.1415926535897932384626433832795;

int main()
{
	ll a, b;
	cin >> a >> b >> x;
	string c[b];
	for (int i = 0; i < b; ++i)
	{
		cin >> c[i]
	}
	for (int i = 0; i < b; ++i)
	{
		for (int j = 0; j < 2; ++j)
		{
			cout << c[i] << endl;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:26: error: 'x' was not declared in this scope
   16 |         cin >> a >> b >> x;
      |                          ^
a.cc:20:28: error: expected ';' before '}' token
   20 |                 cin >> c[i]
      |                            ^
      |                            ;
   21 |         }
      |         ~
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    private static Scanner scan;

    private static void start() {
        scan = new Scanner(java.lang.System.in);

        scan = Input.getScanner();
        System.init();
    }

    private static void finish() {
        System.close();
    }


    public static void main(String[] args) {
        start();

        int h = scan.nextInt();
        int w = scan.nextInt();
        scan.nextLine();

        char[][] papan = new char[h][w];
        for (int i = 0; i < h; i++) {
            String s = scan.nextLine();
            for (int j = 0; j < w; j++) {
                papan[i][j] = s.charAt(j);
            }
        }
        char[][] papan2 = new char[2 * h][w];
        for (int i = 0; i < (2 * h); i++) {
            for (int j = 0; j < w; j++) {
                int floor = (int) Math.floor((i) / 2);
                papan2[i][j] = papan[floor][j];
            }
        }
        for (int i = 0; i < 2 * h; i++) {
            for (int j = 0; j < w; j++) {
                System.out.print(papan2[i][j]);
            }
            System.out.println();
        }
        finish();
    }
}


Compiler output:
Main.java:12: error: cannot find symbol
        scan = Input.getScanner();
               ^
  symbol:   variable Input
  location: class Main
Main.java:13: error: cannot find symbol
        System.init();
              ^
  symbol:   method init()
  location: class System
Main.java:17: error: cannot find symbol
        System.close();
              ^
  symbol:   method close()
  location: class System
3 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	int h, w; cin >> h >> w;
	for(int i = 0; i < h; ++i){cin >> s; cout << s << endl << s << endl;}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:43: error: 's' was not declared in this scope
    5 |         for(int i = 0; i < h; ++i){cin >> s; cout << s << endl << s << endl;}
      |                                           ^
Language: Java

import java.util.*;

public class m3a {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<String> s = new ArrayList<String>();
		int H = sc.nextInt();
		int W = sc.nextInt();
		for(int i = 0;i < H;i++) {
			String a = sc.next();
			for(int m = 0;m < 2;m++) {
				s.add(a);
			}
		}
		for(String k : s) {
			System.out.println(k);
		}
	}
}

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

#include <bits/stdc++.h>

#define INF 100000000
#define MOD9(a) (a%1000000009)
#define MOD7(a) (a%1000000007)
#define ABS(a) (a<0?-(a):a)
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define REP(i,a) for(int i=0;i<a;i++) 

using namespace std;
int main(){
  int H,W;
  cin >> H >> W;
  char c[H][W];
  REP(i, H){
    cin >> c[i];
  }

  REP(i, H){
    REP(k, 2){
      REP(j, W){
        cout << c[i][j];
      }
      cout << endl;
    }
  }
}

#include <bits/stdc++.h>

#define INF 100000000
#define MOD9(a) (a%1000000009)
#define MOD7(a) (a%1000000007)
#define ABS(a) (a<0?-(a):a)
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define REP(i,a) for(int i=0;i<a;i++) 

using namespace std;
int main(){
  int H,W;
  cin >> H >> W;
  char c[H][W];
  REP(i, H){
    cin >> c[i];
  }

  REP(i, H){
    REP(k, 2){
      REP(j, W){
        cout << c[i][j];
      }
      cout << endl;
    }
  }
}



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

#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <set>
#include <map>
#include <deque>
#define WMAX 10000
#define HMAX 10000

//コメントアウトするとdebug()を実行しない
#define DEBUG

using namespace std;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

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

int H,W;
char C[HMAX][WMAX];
char c;
string S = {"abcde"};
static const int dx[8] = {0,1,1,1,0,-1,-1,-1},
					dy[8] = {1,1,0,-1,-1,-1,0,1};

void solve(){
	for (int i = 0; i < H; ++i)
	{
		for (int j = 0; j < 2; ++j)
		{
			for (int k = 0; k < W; ++k)
			{
				cout << C[i][k];
			}
			cout << "\n";
		}
	}
}

void answer(){
	cout << ans << "\n";
}

int main(){
	cin >> H >> W;
	for (int i = 0; i < H; ++i)
	{
		for (int j = 0; j < W; ++j)
		{
			cin >> C[i][j];
		}
	}
	solve();
	return 0;
}

Compiler output:
a.cc: In function 'void answer()':
a.cc:50:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   50 |         cout << ans << "\n";
      |                 ^~~
      |                 abs
Language: C++

import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt(),
			w = sc.nextInt();
		for(int i = 0; i < h; i++){
			String c = sc.next();
			System.out.println(c);
			System.out.println(c);
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class Main {
      | ^~~~~~
Language: C++

#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
#include<unordered_map>
using namespace std;
typedef long long ll;
int main() {
	int h,w;
	cin>>h>>w;
	char a[100][100];
	for(int i=0;i<h;i++){
		string s;
		cin>>s;
		for(int j=0;j<w;j++){
			a[i][j]=s[j];
		}
	}
	for(int i=0;i<h*2;i++){
		for(int j=0;j<w;j++){
			cout<<a[floor((double)(i+1)/2)][j];
		}
		cout<<endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:32: error: invalid types 'char [100][100][double]' for array subscript
   29 |                         cout<<a[floor((double)(i+1)/2)][j];
      |                                ^
Language: C++

#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
#include<unordered_map>
using namespace std;
typedef long long ll;
int main() {
	int h,w;
	cin>>h>>w;
	char a[100][100];
	for(int i=0;i<h;i++){
		string s;
		cin>>s;
		for(int j=0;j<w;j++){
			a[i][j]=s[j];
		}
	}
	for(int i=0;i<h*2;i++){
		for(int j=0;j<w;j++){
			cout<<a[floor((double)(i+1)/2)];
		}
		cout<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:32: error: invalid types 'char [100][100][double]' for array subscript
   29 |                         cout<<a[floor((double)(i+1)/2)];
      |                                ^
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int H = sc.nextInt();
    int W = sc.nextInt();
   char[][] picture = new char[H][W];
    for(int i = 0; i < H; i++) {
      for(int j = 0; j < W; j++) {
        picture[i][j] = sc.next();
      }
    }
 //   String[][] output = new String[2 * H][W];
    for(int i = 0; i < (2 * H); i++) {
      for(int j = 0; j < W; j++) {
    //    output[i][j] = picture[(i + 2) / 2 - 1][j];
      }
    }
    for(int i = 0; i < (2 * H); i++) {
      for(int j = 0; j < W; j++) {
   //     System.out.print(output[i][j]);
      }
   //   if(i != (2 * H - 1)) System.out.println("");
    }
  }
}

Compiler output:
Main.java:11: error: incompatible types: String cannot be converted to char
        picture[i][j] = sc.next();
                               ^
1 error
Language: Java

import java.util.Scanner;

public class main {
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		int H = stdIn.nextInt();
		int W = stdIn.nextInt();
		stdIn.nextLine();
		String[] C = new String[H];
		for(int i=0;i<H;i++){
			C[i] = stdIn.nextLine();
		}
		for(String Ci :C){
			System.out.println(Ci);
			System.out.println(Ci);
		}
	}
}


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

package main

import (
	"fmt"
)

func main() {
	var h, w int
	fmt.Scan(&h, &w)
	for y := 0; y < h; y++ {
		var s string
		fmt.Scan(&s)
		fmt.Println(s)
		fmt.Println(s)
	}
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
Language: C++

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

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

int main(void){
	int h, w;
	scanf("%d%d", &h, &w);
	string s;
	rep(i, h){
		cin >> s;
		cout << s << "\n";
		cout << s << "\n";
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: 'i' was not declared in this scope
   12 |         rep(i, h){
      |             ^
a.cc:6:23: note: in definition of macro 'rep'
    6 | #define rep(i, n)for((i) = 0;(i) < (n);++(i))
      |                       ^
Language: C++

n, m = gets.split(" ")
puts (1..n.to_i).map{gets}.map{|s| puts s; puts s}


Compiler output:
a.cc:2:7: error: too many decimal points in number
    2 | puts (1..n.to_i).map{gets}.map{|s| puts s; puts s}
      |       ^~~~~~~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n, m = gets.split(" ")
      | ^
a.cc:2:27: error: expected unqualified-id before '.' token
    2 | puts (1..n.to_i).map{gets}.map{|s| puts s; puts s}
      |                           ^
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args)  {
	
		Scanner s = new Scanner(System.in);
		int H = s.nextInt();
		int W = s.nextInt();
		
		String[] array = new String[H];
		for(int i=0; i<H; i++){
			array[i] = s.next();	
		}
		
		// 表示
		for(int i=0; i<H; i++){
			System.out.println(array[i]);
			System.out.println(array[i]);
		}	
	}

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

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

int main(9{
    int h,w;
    cin>>h>>w;
    for(int i=0;i<h;i++){
        string c;
        cin>>c;
        cout<<c<<endl;
        cout<<c<<endl;
    }
    return 0;
}


Compiler output:
a.cc:4:5: error: cannot declare '::main' to be a global variable
    4 | int main(9{
      |     ^~~~
a.cc:4:11: error: expected ')' before '{' token
    4 | int main(9{
      |         ~ ^
      |           )
Language: C++

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

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(a)-1;i>=b;i--)
#define chmin(a,b) (a)=min((a),(b));
#define chmax(a,b) (a)=max((a),(b));
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define printV(v) cout<<(#v)<<":";for(auto(x):(v)){cout<<" "<<(x);}cout<<endl;
#define printVS(vs) cout<<(#vs)<<":"<<endl;for(auto(s):(vs)){cout<<(s)<< endl;}
#define printVV(vv) cout<<(#vv)<<":"<<endl;for(auto(v):(vv)){for(auto(x):(v)){cout<<" "<<(x);}cout<<endl;}
#define printP(p) cout<<(#p)<<(p).first<<" "<<(p).second<<endl;
#define printVP(vp) cout<<(#vp)<<":"<<endl;for(auto(p):(vp)){cout<<(p).first<<" "<<(p).second<<endl;}

inline void output(){ cout << endl; }
template<typename First, typename... Rest>
inline void output(const First& first, const Rest&... rest) {
    cout << first << " "; output(rest...);
}

using ll = long long;
using Pii = pair<int, int>;
using TUPLE = tuple<int, int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
const int inf = 1ll << 60;
const int mod = 1e9 + 7;
using Graph = vector<vector<int>>;

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

    int h, w;
    cin >> h >> w;
    vector<string> s(h);
    rep(i, n) cin >> s[i];

    rep(i, n) {
        cout << s[i] << endl;
        cout << s[i] << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:12: error: 'n' was not declared in this scope
   42 |     rep(i, n) cin >> s[i];
      |            ^
a.cc:5:34: note: in definition of macro 'rep'
    5 | #define rep(i,n) for (int i=0;i<(n);i++)
      |                                  ^
a.cc:44:12: error: 'n' was not declared in this scope
   44 |     rep(i, n) {
      |            ^
a.cc:5:34: note: in definition of macro 'rep'
    5 | #define rep(i,n) for (int i=0;i<(n);i++)
      |                                  ^
Language: C++

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

int main(){
 int h,w; cin>>h>>w;
 vector<string> M(h);
 for(int i=0;i<h;i++){
  cin>>M[i];
 }
 for(int i=0;i<h*2;i++){
  for(int j=0;j<w;j++){
   cout<<M[i/2][j];
  }
  cout<<endl;
 }
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:2: error: 'vector' was not declared in this scope
    7 |  vector<string> M(h);
      |  ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | #include <string>
a.cc:7:15: error: expected primary-expression before '>' token
    7 |  vector<string> M(h);
      |               ^
a.cc:7:17: error: 'M' was not declared in this scope
    7 |  vector<string> M(h);
      |                 ^
Language: C

#include <stdio.h>
int main(){
int h=0,w=0;
scanf("%d %d",&h,&w );
char ij[h-1][w-1];
for(int k=0; k<h;k++){
    scanf("%s",ij[k]);
}
printf("%d %d\n",h,w);
for(int k=0; k<h;k++){
    for(int l=0; l<w; l++){
      printf("%c",ij[k][l]);
    }
  printf("\n");
for(int m=0; m<w; m++){
      printf("%c",ij[k][l]);
    }
  printf("\n");
}
} 

Compiler output:
main.c: In function 'main':
main.c:16:25: error: 'l' undeclared (first use in this function)
   16 |       printf("%c",ij[k][l]);
      |                         ^
main.c:16:25: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int h,w;
  char c[111][111];
  cin >> h >> w;
for(int i=0;i<h;i++){
cin >> c[i];
}for(int i=0;i<h;i++){
  else cout<<c[i]<<endl<<c[i]<<endl;
}  return(0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'else' without a previous 'if'
   10 |   else cout<<c[i]<<endl<<c[i]<<endl;
      |   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int h,w;
  char c[111][111];
  cin >> h >> w;
for(int i=0;i<h;i++){
cin >> c[i];
}for(int i==0;i<h;i++){
  else cout<<c[i]<<endl<<c[i]<<endl;
}  return(0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: expected ';' before '==' token
    9 | }for(int i==0;i<h;i++){
      |           ^~
      |           ;
a.cc:9:11: error: expected primary-expression before '==' token
    9 | }for(int i==0;i<h;i++){
      |           ^~
a.cc:9:18: error: expected ')' before ';' token
    9 | }for(int i==0;i<h;i++){
      |     ~            ^
      |                  )
a.cc:9:19: error: 'i' was not declared in this scope
    9 | }for(int i==0;i<h;i++){
      |                   ^
Language: C++

#include<stdio.h>

int main(){
	int i, j, a[101][101]={0,}, x, y;
	
	scanf("%d %d", &i, &j);
	
	for(x=1;x<=i;x++){
		for(y=1;y<=j;y++){
			scanf("%c ", &a[x][y]);
		}1
	}
	
	for(x=1;x<=i;x++){
		for(y=1;y<=j;y++){
			printf("%c ", &a[x][y]);
		}
		printf("\n");
		for(y=1;y<=j;y++){
			printf("%c ", &a[x][y]);
		}
		printf("\n");
		
	}
	
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: expected ';' before '}' token
   11 |                 }1
      |                   ^
      |                   ;
   12 |         }
      |         ~
Language: C++

#include <stdio.h>
using namespace std;

int h, w;
char s[105];
int main() {
	freopen("input.txt", "r", stdin);
	scanf("%d%d", &h, &w);
	gets(s);
	while(h--) {
		gets(s);
		puts(s);
		puts(s);
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    9 |         gets(s);
      |         ^~~~
      |         getw
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main()
{
    char p[1000][101];
    int h,w;
    cin>>h>>w;
    getchar();
    p[h][w];
    for(int i=0;i<h;i++)
        gets(p[i]);
    for(int i=0;i<h;i++)
        for(int j=0;j<2;j++)
            cout<<p[i]<<endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   13 |         gets(p[i]);
      |         ^~~~
      |         getw
Language: C++

#include<iostream>
using namespace std;
int main(){
int W,H;
char C[201][201];
cin>>H>>W;
for(int i=0;i<H;i++)
 for(int j=0;j<W;j++)
  cin>>C[i][j];

for(int i=H;i<2H;i++)
 for(int j=0;j<W;j++)
  C[i][j]=C[(i+1)/2][j];

for(int i=0;i<2H;i++){
 for(int j=0;j<W;j++)
  cout<<C[i][j];
  cout<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: unable to find numeric literal operator 'operator""H'
   11 | for(int i=H;i<2H;i++)
      |               ^~
a.cc:15:15: error: unable to find numeric literal operator 'operator""H'
   15 | for(int i=0;i<2H;i++){
      |               ^~
Language: C++

#include <cstdio>
#include <cstring>

int main(void) {
    int H, W;
    scanf("%d %d", &H, &W);
    char c[H+1][W+1];
    for(int i=1 ; i<=H ; i++) {
        gets(c[i]);
    }
    for(int i=1 ; i<=H ; i++) {
        puts(c[i]);
        puts(c[i]);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    9 |         gets(c[i]);
      |         ^~~~
      |         getw
Language: C++

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

int h, w;

void init(){
	scanf("%d", &h);
	scanf("%d", &w);
	char ch[1234], c[1234];
	scanf("%s", ch);
	scanf("%s", c);
	if(h == 1 and w == 4) {
		printf("%s\n", ch);
		printf("%s\n", c);
	}
	else
	{
		printf("%s\n", ch);
		printf("%s\n", c);
		printf("%s\n", strrev(ch));
		printf("%s\n", strrev(c));
	}
}

int main(){
	
	init();
	return 0;
}

Compiler output:
a.cc: In function 'void init()':
a.cc:22:32: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
   22 |                 printf("%s\n", strrev(ch));
      |                                ^~~~~~
      |                                strsep
Language: C++

int main()

 {
    char a[201][201];
    int i,j;
    char b[101][101];
    int n,m;
    cin>>n>>m;
    for(i=1;i<=n;i++)
        for(j=1;j<=m;j++)
            cin>>b[i][j];
    for(i=1;i<=2*n;i++)
        for(j=1;j<=m;j++)
        a[i][j]=b[(i+1)/2][j];
    for(i=1;i<=2*n;i++)
    {for(j=1;j<=m;j++)
    cout<<a[i][j];
    cout<<endl;
    }


 }


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     cin>>n>>m;
      |     ^~~
a.cc:17:5: error: 'cout' was not declared in this scope
   17 |     cout<<a[i][j];
      |     ^~~~
a.cc:18:5: error: 'cout' was not declared in this scope
   18 |     cout<<endl;
      |     ^~~~
a.cc:18:11: error: 'endl' was not declared in this scope
   18 |     cout<<endl;
      |           ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
int W,H;
char C[101][101];
cin>>H>>W;
for(int i=0;i<H;i++)
 for(int j=0;j<W;j++)
  cin>>C[i][j];

for(int i=H;i<2H;i++)
 for(int j=0;j<W;j++)
  C[i][j]=C[(i+1)/2][j];

for(int i=0;i<2H;i++){
 for(int j=0;j<W;j++)
  cout<<C[i][j];
  cout<<endl;
}
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: unable to find numeric literal operator 'operator""H'
   11 | for(int i=H;i<2H;i++)
      |               ^~
a.cc:15:15: error: unable to find numeric literal operator 'operator""H'
   15 | for(int i=0;i<2H;i++){
      |               ^~
Language: C++

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

int h, w;
char s[105];
int main() {
	cin >> h>> w;
	gets(s);
	while(h--) {
		gets(s);
		puts(s);
		puts(s);
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    9 |         gets(s);
      |         ^~~~
      |         getw
Language: C

#include "stdio.h"

int main() {
  int h, w;
  int i, j;
  char line[101];
  scanf("%d %d", &h, &w);
  for (i = 0; i < h; i++) {
    for (j = 0; j < w; j++) {
      line[j] = getc();
    }
    line[h] = '\0';
    getc();
    printf("%s\n", line);
    printf("%s\n", line);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:17: error: too few arguments to function 'getc'
   10 |       line[j] = getc();
      |                 ^~~~
In file included from main.c:1:
/usr/include/stdio.h:576:12: note: declared here
  576 | extern int getc (FILE *__stream) __nonnull ((1));
      |            ^~~~
main.c:13:5: error: too few arguments to function 'getc'
   13 |     getc();
      |     ^~~~
/usr/include/stdio.h:576:12: note: declared here
  576 | extern int getc (FILE *__stream) __nonnull ((1));
      |            ^~~~
Language: C

#include <stdio.h>
#include <string.h>
int main(void){
  char s[100000];
  char t[100000]; // maerd , remaerd , esare , resare 
  int s_length,i;
  scanf("%s",s);
  s_length = strlen(s);
  for(i=s_length-1;i>=0;i--){
    if(s[i]=='m'){
      t[i]='m'; t[i-1]='a'; t[i-2]='e'; t[i-3]='r'; t[i-4]='d';
      i=i-4;
    }else if(s[i]=='e'){
      t[i]='e'; t[i-1]='s'; t[i-2]='a'; t[i-3]='r'; t[i-4]='e';
      i=i-4;
    }else if(s[i-2]=='m'){
      t[i]='r'; t[i-1]='e'; t[i-2]='m'; t[i-3]='a'; t[i-4]='e';
      t[i-5]='r'; t[i-6]='d';
      i=i-6;
    }else if(s[i-2]=='s'){
      t[i]='r'; t[i-1]='e'; t[i-2]='s'; t[i-3]='a'; t[i-4]='r'; t[i-5]='e';
      i=i-5;
    }
  }
    if(strcmp(s,t)==0 && i=0){
      printf("YES\n");
    }else{
      printf("NO\n");
    }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:25:27: error: lvalue required as left operand of assignment
   25 |     if(strcmp(s,t)==0 && i=0){
      |                           ^
Language: Java

import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
    private static boolean isComposable(String s, Set<String> dictionary) {
        if (dictionary.contains(s) || s.length() == 0) {
            return true;
        }
        
        for (int i=0; i<s.length(); i++) {
            String curr = s.substring(0, i);
            while (dictionary.contains(curr) && isComposable(s.substring(i), dictionary) ) {
                return true;
            }
        }

        return false;
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        sc.close();
        Set<String> set = new HashSet<>(Arrays.asList(new String[]{"dream", "dreamer", "erase", "eraser"}));
        boolean canMake = isComposable(s, set);
        System.out.println(canMake ? "YES" : "NO");
    }
    


Compiler output:
Main.java:28: error: reached end of file while parsing
    }
     ^
1 error
Language: Java

import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
    private static boolean isComposable(String s, Set<String> dictionary) {
        if (dictionary.contains(s) || s.length() == 0) {
            return true;
        }
        
        for (int i=0; i<s.length(); i++) {
            String curr = s.substring(0, i);
            while (dictionary.contains(curr) && isComposable(s.substring(i), dictionary) ) {
                return true;
            }
        }

        return false;
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        sc.close();
        Set<String> set = new HashSet<>(Arrays.asList(new String[]{"dream", "dreamer", "erase", "eraser"}));
        boolean canMake = isComposable(s, set);
        System.out.println(canMake ? "YES" : "NO");
    }


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

#include <bits/stdc++.h>

using namespace std;

    string divide[4] = {"dream","dreamer","erase","eraser"};
int main()
{
    string S;
    cin >> S;

    reverse(S.begin(),S.end());
    for(int i=0; i<4; i++)
        reverse(divide.at(i).begin(),divide.at(i).end());

    book can = true;
    for(int i=0; i<S.size();){
        bool can2 =false;
        for(int j=0; j<4; j++){
            string d = divide.at(j);
            if(S.substr(i,d.size()) == d){
                can2 = true;
                i += d.size();
            }
        }
        if(!can2){
            can = false;
            break;
        }
    }

    if(can) cout << "YES" << endl;
    else cout << "NO" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: request for member 'at' in 'divide', which is of non-class type 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'}
   13 |         reverse(divide.at(i).begin(),divide.at(i).end());
      |                        ^~
a.cc:13:45: error: request for member 'at' in 'divide', which is of non-class type 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'}
   13 |         reverse(divide.at(i).begin(),divide.at(i).end());
      |                                             ^~
a.cc:15:5: error: 'book' was not declared in this scope; did you mean 'bool'?
   15 |     book can = true;
      |     ^~~~
      |     bool
a.cc:19:31: error: request for member 'at' in 'divide', which is of non-class type 'std::string [4]' {aka 'std::__cxx11::basic_string<char> [4]'}
   19 |             string d = divide.at(j);
      |                               ^~
a.cc:26:13: error: 'can' was not declared in this scope; did you mean 'can2'?
   26 |             can = false;
      |             ^~~
      |             can2
a.cc:31:8: error: 'can' was not declared in this scope; did you mean 'tan'?
   31 |     if(can) cout << "YES" << endl;
      |        ^~~
      |        tan
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
    string s;
    cin >> s;

    reverse(s.begin(), s.end());
    while (i < s.size()) {
        if (s.substr(i, 5) == "maerd" || s.substr(i, 5) == "esare") {
            if (i == s.size()) {
                cout << "YES" << endl;
            }
            i = i + 5; 
        }else if (s.substr(i, 6) == "eraser") {
            if (i == s.size()) {
                cout << "YES" << endl;
            }
            i = i + 6;
        }else if (s.substr(i, 7) == "remaerd") {
            if (i == s.size()) {
                cout << "YES" << endl;
            }
            i = i + 7;
        }else{
            cout << "NO" << endl;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'i' was not declared in this scope
    8 |     while (i < s.size()) {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;

int main(){
    string S;
    cin >> S;

    for(int i=S.size()-1; i>=0; i--) {
        string ss += S[i];
        if(ss=="maerd") ss="";
        else if(ss=="remaerd") ss="";
        else if(ss=="esare") ss="";
        else if(ss=="resare") ss="";
    }
    if(ss == "") cout << "YES" << endl;
    else cout << "NO" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: expected initializer before '+=' token
   11 |         string ss += S[i];
      |                   ^~
a.cc:12:12: error: 'ss' was not declared in this scope
   12 |         if(ss=="maerd") ss="";
      |            ^~
a.cc:17:8: error: 'ss' was not declared in this scope
   17 |     if(ss == "") cout << "YES" << endl;
      |        ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;

int main(){
    string S;
    cin >> S;

    for(int i=S.size()-1; i>=0; i--) {
        ss += S[i];
        if(ss=="maerd") ss="";
        else if(ss=="remaerd") ss="";
        else if(ss=="esare") ss="";
        else if(ss=="resare") ss="";
    }
    if(ss == "") cout << "YES" << endl;
    else cout << "NO" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'ss' was not declared in this scope
   11 |         ss += S[i];
      |         ^~
a.cc:17:8: error: 'ss' was not declared in this scope
   17 |     if(ss == "") cout << "YES" << endl;
      |        ^~
Language: C++

#include<bits/stdc++.h>
#define INFTY 10000000000
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
const int MOD=1000000007;
const int di[4] = {-1,0,1,0};
const int dj[4] = {0,-1,0,1};
const int INF = 1e9;
const int A = 1000005;
int main(){
    string s,t={};cin>>s;
    int sz = s.size();
    int i = sz-1;
    while(i>4)
    {
        if(s.substr(i-5,6)=="dreamer"){t = "dreamer"+t;i-=6;}
        else if(s.substr(i-5,6)=="eraser"){t = "eraser"+t;i-=6;}
        else if(s.substr(i-4,5)=="erase"){t = "erase"+t;i-=5;}
        else if(s.substr(i-4,5)=="dream"){t = "dream"+t;i-=5;}
        else{
            cout<<"NO"<<endl;
            return 0;
        }
        //cout<<t<<endl;
    }
    
    if(s==t)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}#include<bits/stdc++.h>
#define INFTY 10000000000
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
const int MOD=1000000007;
const int di[4] = {-1,0,1,0};
const int dj[4] = {0,-1,0,1};
const int INF = 1e9;
const int A = 1000005;
int main(){
    string s,t={};cin>>s;
    int sz = s.size();
    int i = sz-1;
    while(i>4)
    {
        if(s.substr(i-5,6)=="dreamer"){t = "dreamer"+t;i-=6;}
        else if(s.substr(i-5,6)=="eraser"){t = "eraser"+t;i-=6;}
        else if(s.substr(i-4,5)=="erase"){t = "erase"+t;i-=5;}
        else if(s.substr(i-4,5)=="dream"){t = "dream"+t;i-=5;}
        else{
            cout<<"NO"<<endl;
            return 0;
        }
        //cout<<t<<endl;
    }
    
    if(s==t)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}

Compiler output:
a.cc:31:2: error: stray '#' in program
   31 | }#include<bits/stdc++.h>
      |  ^
a.cc:31:3: error: 'include' does not name a type
   31 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:36:11: error: redefinition of 'const int MOD'
   36 | const int MOD=1000000007;
      |           ^~~
a.cc:6:11: note: 'const int MOD' previously defined here
    6 | const int MOD=1000000007;
      |           ^~~
a.cc:37:11: error: redefinition of 'const int di [4]'
   37 | const int di[4] = {-1,0,1,0};
      |           ^~
a.cc:7:11: note: 'const int di [4]' previously defined here
    7 | const int di[4] = {-1,0,1,0};
      |           ^~
a.cc:38:11: error: redefinition of 'const int dj [4]'
   38 | const int dj[4] = {0,-1,0,1};
      |           ^~
a.cc:8:11: note: 'const int dj [4]' previously defined here
    8 | const int dj[4] = {0,-1,0,1};
      |           ^~
a.cc:39:11: error: redefinition of 'const int INF'
   39 | const int INF = 1e9;
      |           ^~~
a.cc:9:11: note: 'const int INF' previously defined here
    9 | const int INF = 1e9;
      |           ^~~
a.cc:40:11: error: redefinition of 'const int A'
   40 | const int A = 1000005;
      |           ^
a.cc:10:11: note: 'const int A' previously defined here
   10 | const int A = 1000005;
      |           ^
a.cc:41:5: error: redefinition of 'int main()'
   41 | int main(){
      |     ^~~~
a.cc:11:5: note: 'int main()' previously defined here
   11 | int main(){
      |     ^~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main(){
  string ip;
  
  cin>>ip;
  ll n=ip.length();
  bool isPossible=false;
  string pattern[4];
  pattern[0]="maerd";
  pattern[1]="remaerd";
  pattern[2]="esare";
  pattern[3]="resaer";
  
  ll i=n-1;
  string temp="";
  for(i>=0){
    temp+=ip[i];;
    bool found=false;
    for(int j=0;j<4&&!found;j++){
      if(temp==pattern[j]){
        found=true;
        temp="";
      }
    }
    i--;
  }
  
  if(temp==""){
    isPossible=true;
  }
  
  if(isPossible){
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:11: error: expected ';' before ')' token
   21 |   for(i>=0){
      |           ^
      |           ;
a.cc:33:3: error: expected primary-expression before 'if'
   33 |   if(temp==""){
      |   ^~
a.cc:31:4: error: expected ';' before 'if'
   31 |   }
      |    ^
      |    ;
   32 | 
   33 |   if(temp==""){
      |   ~~
a.cc:33:3: error: expected primary-expression before 'if'
   33 |   if(temp==""){
      |   ^~
a.cc:31:4: error: expected ')' before 'if'
   31 |   }
      |    ^
      |    )
   32 | 
   33 |   if(temp==""){
      |   ~~
a.cc:21:6: note: to match this '('
   21 |   for(i>=0){
      |      ^
Language: C

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

const int MAX = 100000; // キュー配列の最大サイズ

int qu[MAX]; // キューを表す配列
int tail = 0, head = 0; // キューの要素区間を表す変数

// キューを初期化する
void init() {
    head = tail = 0;
}

// キューが空かどうかを判定する
int isEmpty() {
    return (head == tail);
}

// スタックが満杯かどうかを判定する
int isFull() {
    return (head == (tail + 1) % MAX);
}

// enqueue (tail に要素を格納してインクリメント)
void enqueue(int v) {
    if (isFull()) {
        puts("error: queue is full.");
        return;
    }
    qu[tail++] = v;
    if (tail == MAX) tail = 0; // リングバッファの終端に来たら 0 に
}

// dequeue (head にある要素を返して head をインクリメント)
int dequeue() {
    if (isEmpty()) {
        puts("error: stack is empty.");
        return -1;
    }
    int res = qu[head];
    ++head;
    if (head == MAX) head = 0;
    return res;
}

int is_substr(char s[], char t[], int i){
    int flag = 1;

    if(s[i] == '\0') flag = 0;

    for(int j = 0; j < strlen(t); ++j, ++i){
        if(s[i] != t[j]){
            flag = 0;
            break;
        }
    }

    return flag;
}

int main(){
    char s[100010];
    char t[4][8]={"dream","dreamer","erase","eraser"};

    scanf("%s", s);

    enqueue(0);
    int flag = 0;
    while(!isEmpty()){
        int i = dequeue();
        if(i == strlen(s)){
            flag = 1;
            break;
        }
        for(int j = 0; j < 4; ++j){
            if(is_substr(s, t[j], i) == 1){
                enqueue(i + strlen(t[j]));
            }
        }
    }

    puts(flag ? "YES" : "NO");

    return 0;
}


Compiler output:
main.c:6:5: error: variably modified 'qu' at file scope
    6 | int qu[MAX]; // キューを表す配列
      |     ^~
Language: C++

#include <bits/stdc++.h>
#define arep(a,i,n) for(ll i=(a);i<(n);i++)
#define rep(i,n) for(ll i=0;i<(n);i++)
#define cinf(x,n) for(ll i=0;i<(n);i++)cin>>x[i];
#define coutf(x,n) for(ll i=0;i<(n);i++)cout<<x[i]<<endl;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

using namespace std;

int main(){
	string s;
	cin >> s;
	while(!s.empty()){
//cout << s << endl;
//cout << s.length() << endl;
		if(s.substr(s.length()-3,3)=="eam"){
			if(substr(s.length()-5,s.end())!="dream"){
				cout << "NO" << endl;
				return 0;
			}
			s.erase(s.begin()+s.length()-5,s.end());
		}else if(s.substr(s.length()-3,3)=="mer"){
			if(substr(s.length()-7,s.end())!="dreamer"){
				cout << "NO" << endl;
				return 0;
			}
			s.erase(s.begin()+s.length()-7,s.end());
		}else if(s.substr(s.length()-3,3)=="ase"){
			if(substr(s.length()-5,s.end())!="erase"){
				cout << "NO" << endl;
				return 0;
			}
			s.erase(s.begin()+s.length()-5,s.end());
		}else if(s.substr(s.length()-3,3)=="ser"){
			if(substr(s.length()-6,s.end())!="eraser"){
				cout << "NO" << endl;
				return 0;
			}
			s.erase(s.begin()+s.length()-6,s.end());
		}else{
			cout << "NO" << endl;
			return 0;
		}

	}
	cout << "YES" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:28: error: 'substr' was not declared in this scope; did you mean 'strstr'?
   19 |                         if(substr(s.length()-5,s.end())!="dream"){
      |                            ^~~~~~
      |                            strstr
a.cc:25:28: error: 'substr' was not declared in this scope; did you mean 'strstr'?
   25 |                         if(substr(s.length()-7,s.end())!="dreamer"){
      |                            ^~~~~~
      |                            strstr
a.cc:31:28: error: 'substr' was not declared in this scope; did you mean 'strstr'?
   31 |                         if(substr(s.length()-5,s.end())!="erase"){
      |                            ^~~~~~
      |                            strstr
a.cc:37:28: error: 'substr' was not declared in this scope; did you mean 'strstr'?
   37 |                         if(substr(s.length()-6,s.end())!="eraser"){
      |                            ^~~~~~
      |                            strstr
Language: C++

#include<iostream>
using namespace std;

int main () {
  string S;
  cin >> S;
  string T;
  int i = S.length() - 1;
  if (S[0] != 'd' or S[0] != 'e'){
    cout << "NO\n";
  } else {
    while (S.length() > 0){
      string arr5;
      for (int j = 4; j >= 0; j --){
        arr5 += S[i - j];
      }
      string arr6;
      for (int j = 5; j >= 0; j --){
        arr6 += S[i - j];
      }
      string arr7;
      for (int j = 6; j >= 0; j --){
        arr7 += S[i - j];
      }
      if (arr5 == "dream"){
        S -= "dream";
        i -= 5;
      } else if (arr5 == "erase"){
        S -= "erase";
        i -= 5;
      } else if (arr7 == "dreamer"){
        S -= "dreamer";
        i -= 7;
      } else if (arr6 == "eraser"){
        S -= "eraser";
        i -= 6;
      } else {
        cout << "NO\n"; 
        return 0;
      } 
    }
    if (S.length() == 0){
      cout << "YES\n";
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [6]')
   26 |         S -= "dream";
      |         ~~^~~~~~~~~~
a.cc:29:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [6]')
   29 |         S -= "erase";
      |         ~~^~~~~~~~~~
a.cc:32:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [8]')
   32 |         S -= "dreamer";
      |         ~~^~~~~~~~~~~~
a.cc:35:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [7]')
   35 |         S -= "eraser";
      |         ~~^~~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main () {
  string S;
  cin >> S;
  string T;
  int i = S.length() - 1;
  if (S[0] != 'd' or S[0] != 'e'){
    cout << "NO\n";
  } else {
    while (S.length() > 0){
      int arr5[5];
      for (int j = 4; j >= 0; j --){
        arr5 += S[i - j];
      }
      int arr6[6];
      for (int j = 5; j >= 0; j --){
        arr6 += S[i - j];
      }
      int arr7[7];
      for (int j = 6; j >= 0; j --){
        arr7 += S[i - j];
      }
      if (arr5 == "dream"){
        S -= "dream";
        i -= 5;
      } else if (arr5 == "erase"){
        S -= "erase";
        i -= 5;
      } else if (arr7 == "dreamer"){
        S -= "dreamer";
        i -= 7;
      } else if (arr6 == "eraser"){
        S -= "eraser";
        i -= 6;
      } else {
        cout << "NO\n"; 
        return 0;
      } 
    }
    if (S.length() == 0){
      cout << "YES\n";
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: incompatible types in assignment of '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'int [5]'
   15 |         arr5 += S[i - j];
a.cc:19:14: error: incompatible types in assignment of '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'int [6]'
   19 |         arr6 += S[i - j];
a.cc:23:14: error: incompatible types in assignment of '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'int [7]'
   23 |         arr7 += S[i - j];
a.cc:25:16: error: comparison between distinct pointer types 'int*' and 'const char*' lacks a cast
   25 |       if (arr5 == "dream"){
      |           ~~~~~^~~~~~~~~~
a.cc:26:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [6]')
   26 |         S -= "dream";
      |         ~~^~~~~~~~~~
a.cc:28:23: error: comparison between distinct pointer types 'int*' and 'const char*' lacks a cast
   28 |       } else if (arr5 == "erase"){
      |                  ~~~~~^~~~~~~~~~
a.cc:29:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [6]')
   29 |         S -= "erase";
      |         ~~^~~~~~~~~~
a.cc:31:23: error: comparison between distinct pointer types 'int*' and 'const char*' lacks a cast
   31 |       } else if (arr7 == "dreamer"){
      |                  ~~~~~^~~~~~~~~~~~
a.cc:32:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [8]')
   32 |         S -= "dreamer";
      |         ~~^~~~~~~~~~~~
a.cc:34:23: error: comparison between distinct pointer types 'int*' and 'const char*' lacks a cast
   34 |       } else if (arr6 == "eraser"){
      |                  ~~~~~^~~~~~~~~~~
a.cc:35:11: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [7]')
   35 |         S -= "eraser";
      |         ~~^~~~~~~~~~~