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

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);

//pairの入力
//vector<pair<ll, ll>>work(n);
//rep(i, n) {
//	ll a, b;
//	cin >> a >> b;
//	work[i] = make_pair(a, b);
//for(auto p:mp)(mapの探索)
//printf("%.10f\n",なんちゃら)

int g[15][15];
const int INF = 1001001001;
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,-1,0,1 };

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

//素因数分解
map<ll, ll>ins;
void facterize(ll n) {
	ll a = 2;
	while (n >= a * a) {
		if (n % a == 0) {
			ins[a]++;
			ins[a] = ins[a] % 1000000007;
			n /= a;
		}
		else {
			a++;
		}
	}
	ins[n]++;
}

vector<ll>relation[20], money(20, 1);

int main() {
	string s;
	cin >> s;
	bool flag = true;
	for (int i = s.length() - 1;i >= 2;--i) {
		if (i >= 5 && s[i] == 'm' && s[i - 1] == 'a' && s[i - 2] == 'e' && s[i - 3] == 'r' && s[i - 4] == 'd') {
			i -= 5;
		}
		else if (i >= 7 && s[i] == 'r' && s[i - 1] == 'e' && s[i - 2] == 'm' && s[i - 3] == 'a' && s[i - 4] == 'e' && s[i - 5] == 'r' && s[i - 6] == 'd') {
			i -= 7;
		}
		else if (i >= 5 && s[i] == 'e' && s[i - 1] == 's' && s[i - 2] == 'a' && s[i - 3] == 'r' && s[i - 4] == 'e') {
			i -= 5;
		}
		else if (i >= 6 && s[i] == 'r' && s[i - 1] == 'e' && s[i - 2] == 's' && s[i - 3] == 'a' && s[i - 4] == 'r'&&s[i-5]=='e') {
			i-=6
		}
		else {
			flag = false;
		}
	}
	if (flag)puts("YES");
	else {
		puts("NO");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:29: error: expected ';' before '}' token
   72 |                         i-=6
      |                             ^
      |                             ;
   73 |                 }
      |                 ~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);

//pairの入力
//vector<pair<ll, ll>>work(n);
//rep(i, n) {
//	ll a, b;
//	cin >> a >> b;
//	work[i] = make_pair(a, b);
//for(auto p:mp)(mapの探索)
//printf("%.10f\n",なんちゃら)

int g[15][15];
const int INF = 1001001001;
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,-1,0,1 };

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

//素因数分解
vector<pair<ll, int>>factorize(ll n) {
	vector<pair<ll, int>>res;
	for (ll i = 2;i * i <= n;++i) {
		if (n % i)continue;
		res.emplace_back(i, 0);
		while (n % i == 0) {
			n /= i;
			res.back().second++;
		}
	}
	if (n != 1)res.emplace_back(n, 1);
	return res;
}

vector<ll>relation[20], money(20, 1);

int main() {
	string s;
	cin >> s;
	int n = s.length();
	bool flag = true;
	int i = 0;
	while (i < n && flag = true) {
		if (s[i] == 'e') {
			if (s[i + 1] != 'r' || s[i + 2] != 'a' || s[i + 3] != 's' || s[i + 4] != 'e')flag = false;
			i += 5;
			if (i >= n)break;
			if (s[i] != 'd' && s[i] != 'r'&&s[i]!='e')flag = false;
		}
		if (s[i] == 'd') {
			if (s[i + 1] != 'r' || s[i + 2] != 'e' || s[i + 3] != 'a' || s[i + 4] != 'm')flag = false;
			i += 5;
			if (i >= n)break;
			if (s[i] != 'd' && s[i] != 'r' && s[i] != 'e')flag = false;
		}
		else if (i != 0 && s[i] == 'r') {
			continue;
		}
		else {
			flag = false;
		}
	}
	if (flag)puts("YES");
	else {
		puts("NO");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:22: error: lvalue required as left operand of assignment
   61 |         while (i < n && flag = true) {
      |                ~~~~~~^~~~~~~
Language: C

// AtCoder ARC065 C - Daydream
// 2019.8.27 bal4u

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

#define gc() getchar_unlocked()

int ins(char *s) { // 文字列の入力　スペース以下の文字で入力終了
	char *p = s--;
	do *++s = gc();
	while (*s > ' ');
	*s = 0;
	return s - p;
}

int N;
char S[100005];
				
int main()
{
	int i;
	
	N = ins(S);	
	i = 0; while (i < N) {
		if (memcmp(S+i, "dream", 5) == 0 && memcmp(S+i+5, "erase", 5) == 0) i += 5;
		else if (memcmp(S+i, "dreamer", 7) == 0) i += 7;
		else if (memcmp(S+i, "eraser", 6) == 0) i += 6;
		else if (memcmp(S+i, "erase", 5) == 0) i += 5;
		else { puts("NO"); return 0;
	}
	puts("YES");
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:34:1: error: expected declaration or statement at end of input
   34 | }
      | ^
Language: C++

#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
typedef long long ll;

void Main()
{
	string S;
  	cin >> S;
    vector<string> words = {"dream", "dreamer", "erase", "eraser"};
	int N = words.size();
	int ssz = S.size();
    bool flag = false;
    
    while(1){
    	rep(i,N){
        	int wsz = words[i].size();
			if(ssz - wsz >= 0 && S.substr(ssz-wsz) == words[i]){
				flag = true;
                S = S.erase(ssz-wsz);
                break;
            }
        }
	    else if(!flag){
			//NG
            puts("NO");
            return;
        }
        ssz = S.size();
        if(1 < ssz && ssz < 5){
			//NG
            puts("NO");
            return;
        }
    }

	puts("YES");
	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}


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

#include <iostream>
using namespace std;

const string words[] = {"dream", "dreamer", "erase", "eraser"};

int main() {
    string s, result = "YES";
    cin >> s;
    for (int i = s.size(); i >= 0; ) {
        bool found = false;
        for (auto& w : words) {
            if (i >= w.size() && s.compare(i - w.wize(), w.size(), w) == 0) {
                found = true;
                i -= w.size();
                break;
            }
        }
        if (!found) {
            result = "NO";
            break;
        }
    }
    cout << result;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:50: error: 'const class std::__cxx11::basic_string<char>' has no member named 'wize'; did you mean 'size'?
   12 |             if (i >= w.size() && s.compare(i - w.wize(), w.size(), w) == 0) {
      |                                                  ^~~~
      |                                                  size
Language: C++

#include <iostream>
using namespace std;

const string words[] = {"dream", "dreamer", "erase", "eraser"};

int main() {
    string s, result = "YES";
    cin >> s;
    for (int i = s.size; i >= 0; ) {
        bool found = false;
        for (auto& w : words) {
            if (i >= w.size() && s.compare(i - w.wize(), w.size(), w) == 0) {
                found = true;
                i -= w.size();
                break;
            }
        }
        if (!found) {
            result = "NO";
            break;
        }
    }
    cout << result;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: cannot convert 'std::__cxx11::basic_string<char>::size' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
    9 |     for (int i = s.size; i >= 0; ) {
      |                    ^~~~
a.cc:12:50: error: 'const class std::__cxx11::basic_string<char>' has no member named 'wize'; did you mean 'size'?
   12 |             if (i >= w.size() && s.compare(i - w.wize(), w.size(), w) == 0) {
      |                                                  ^~~~
      |                                                  size
Language: C++

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

using namespace std;

int main(){

    string s;
    cin >> s;
    
    for(int i=0;i<s.size();i++){
        int f = 0;
        if(s.substr(i,i+6) == "dreamer" && s.substr(i+5,i+9) != "erase"){
            i += 6;
            f = 1;            
        }
        if(s.substr(i,i+5) == "eraser" && f == 0){
            i += 5
            f =1;
        }
        if((s.substr(i,i+4) == "dream" || s.substr(i,i+4) == "erase") && f == 0){
            i += 4;
            f = 1;
        }
        if(f == 0){
            cout << "NO" << endl;
            return 0;
        }
    }

    cout << "YES" << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:19: error: expected ';' before 'f'
   19 |             i += 5
      |                   ^
      |                   ;
   20 |             f =1;
      |             ~
Language: C++

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

using namespace std;

int main(){

    string s;
    cin >> s;
    
    for(int i=0;i<s.size();i++){
        int f = 0;
        if(s.substr(i,i+6) == "dreamer" && s.substr(i+5,i+9) != "erase"){
            i += 6;
            f = 1;            
        }
        if(s.substr(i,i+5) == "eraser" && f == 0;){
            i += 5
            f =1;
        }
        if((s.substr(i,i+4) == "dream" || s.substr(i,i+4) == "erase") && f == 0;){
            i += 4;
            f = 1;
        }
        if(f == 0){
            cout << "NO" << endl;
            return 0;
        }
    }

    cout << "YES" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:50: error: expected primary-expression before ')' token
   18 |         if(s.substr(i,i+5) == "eraser" && f == 0;){
      |                                                  ^
a.cc:19:19: error: expected ';' before 'f'
   19 |             i += 5
      |                   ^
      |                   ;
   20 |             f =1;
      |             ~      
a.cc:22:81: error: expected primary-expression before ')' token
   22 |         if((s.substr(i,i+4) == "dream" || s.substr(i,i+4) == "erase") && f == 0;){
      |                                                                                 ^
Language: C++

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

using namespace std;

int main(){

    string s;
    cin >> s;
    
    fot(int i=0;i<s.size();i++){
        int f = 0;
        if(s.substr(i,i+6) == "dreamer" && s.substr(i+5,i+9) != "erase"){
            i += 6;
            f = 1;            
        }
        if(s.substr(i,i+5) == "eraser" && f == 0;){
            i += 5
            f =1;
        }
        if((s.substr(i,i+4) == "dream" || s.substr(i,i+4) == "erase") && f == 0;){
            i += 4;
            f = 1;
        }
        if(f == 0){
            cout << "NO" << endl;
            return 0;
        }
    }

    cout << "YES" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: expected primary-expression before 'int'
   12 |     fot(int i=0;i<s.size();i++){
      |         ^~~
a.cc:12:17: error: 'i' was not declared in this scope
   12 |     fot(int i=0;i<s.size();i++){
      |                 ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd(b,a%b);
  }
}
 
long long lcm(long long x, long long y){
  return (x/gcd(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

int main(){
  string s;
  cin>>s;
  int len=s.size();
  int cur=0;
  string sub[]={"dreamer","eraser","dream","erase"};
  bool flag=false;
  while(cur<len){
    REP(i,4){
      if(s.substr(cur,(int)sub[i].size)==s[i]){
        cur += (int)sub[i].size();
        flag = true;
        break;
      }
    }
    if(flag){
      continue;
    }else{
      cout<<"NO"<<endl;
      return 0;
    }
  }
  cout<<"YES"<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:98:35: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   98 |       if(s.substr(cur,(int)sub[i].size)==s[i]){
      |                            ~~~~~~~^~~~
      |                                       ()
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd(b,a%b);
  }
}
 
long long lcm(long long x, long long y){
  return (x/gcd(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

int main(){
  string s;
  cin>>s;
  int len=s.size();
  int cur=0;
  string sub[]={"dreamer","eraser","dream","erase"};
  bool flag=false;
  while(cur<len){
    REP(i,4){
      if(s.substr(cur,(int)sub[i].size)==s[i]){
        cur += (int)sub[i].size;
        flag = true;
        break;
      }
    }
    if(flag){
      continue;
    }else{
      cout<<"NO"<<endl;
      return 0;
    }
  }
  cout<<"YES"<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:98:35: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   98 |       if(s.substr(cur,(int)sub[i].size)==s[i]){
      |                            ~~~~~~~^~~~
      |                                       ()
a.cc:99:28: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   99 |         cur += (int)sub[i].size;
      |                     ~~~~~~~^~~~
      |                                ()
Language: C++

#include<stdio.h>
#include<string.h>
int main()
{
	char c[100006],d[2][6]={"dream","erase"};
	long long i,l,n,m,o;
	gets(c);
	l=strlen(c);
	for(i=0;i<l;)
	{
		if(c[i]=='d')
		{
			for(o=1;o<5;o++)
			{
				if(d[0][o]==c[i+o])continue;
				else break;
			}
			if(o<5)break;
			if(c[i+5]=='e'&&c[i+6]=='r')
			{
				if(c[i+7]=='a'){
					i=i+5;
				}
				else i=i+7;
			}
			else i=i+5;
		}
		else if(c[i]=='e')
		{
		for(o=1;o<5;o++)
			{
				if(d[1][o]==c[i+o])continue;
				else break;
			}
			if(o<5)break;
			if(c[i+5]=='r') i=i+6;
			else i=i+5;
		}
		else break;
	}
	if(i==l)printf("YES");
	else printf("NO");
}


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

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

string divide[4] = {"dream", "dreamer", "erase", "eraser"};
bool dp[100010];

signed main(){

    string s; cin >> s;

    dp[0] = 1;
    for(int i = 0; i < S.size(); ++i){
        if(!dp[i]) continue;
        
        for(string s : divide){
            if(S.substr(i, s.size()) == s){
                dp[i + s.size()] = 1;
            }
        }
    }

    cout << (dp[S.size()] ? "YES" : "NO") << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: 'S' was not declared in this scope
   13 |     for(int i = 0; i < S.size(); ++i){
      |                        ^
a.cc:23:17: error: 'S' was not declared in this scope
   23 |     cout << (dp[S.size()] ? "YES" : "NO") << endl;
      |                 ^
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
//deque/functional/iterator/list/map/memory/numeric/queue/set/stack/utility/vector
//#include<bits/stdc++.h>
#define ll long long
using namespace std;
//string a="dream",b="dreamer",c="erase",d="eraser";
int main()
{
	ios::sync_with_stdio(false);
	char s[100010];
 	gets(s);
	int a=0;
	int b=strlen(s);
	int flag=1;
	while(a<b)
	{
		if(s[a]=='d'){
			a=a+5;
			if(s[a+1]=='e'&&s[a+3]!='a')
				a=a+2;
		}
		else if(s[a]=='e'){
			a=a+5;
			if(s[a]=='r') a++;
		}
		else {
			flag=0;
		}
	}
	if(flag==1&&a==b)
	cout<<"YES"<<endl;
	else cout<<"NO"<<endl;
	
return 0;
}


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

#include<stdio.h>
#include<string.h>
int main() {
	char s[100000];
	scanf("%s",s);
	int a[strlen(s)]= {0},i,j;
	for(i=0; i<strlen(s); i++) {
		if(s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m') {
			a[i]=1,a[i+1]=1,a[i+2]=1,a[i+3]=1,a[i+4]=1;
		}
		if(s[i]=='d'&&s[i+1]=='r'&&s[i+2]=='e'&&s[i+3]=='a'&&s[i+4]=='m'&&s[i+5]=='e'&&s[i+6]=='r') {
			a[i]=1,a[i+1]=1,a[i+2]=1,a[i+3]=1,a[i+4]=1,a[i+5]=1,a[i+6]=1;
		}
		if(s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e') {
			a[i]=1,a[i+1]=1,a[i+2]=1,a[i+3]=1,a[i+4]=1;
		}
		if(s[i]=='e'&&s[i+1]=='r'&&s[i+2]=='a'&&s[i+3]=='s'&&s[i+4]=='e'&&s[i+5]=='r') {
			a[i]=1,a[i+1]=1,a[i+2]=1,a[i+3]=1,a[i+4]=1,a[i+5]=1;
		}
	}
	int f=0;
	for(i=0; i<strlen(s); i++) {
		if(a[i]==0) {
			f=1;
			break;
		}
	}
	if(f==1)
		printf("NO");
	else
		printf("YES");
}

Compiler output:
main.c: In function 'main':
main.c:6:27: error: variable-sized object may not be initialized except with an empty initializer
    6 |         int a[strlen(s)]= {0},i,j;
      |                           ^
Language: C

	char A[4][8] = {
	{ 'r','e','m','a','e','r','d'},
	{ 'm','a','e','r','d' },
	{ 'r','e','s','a','r','e' },
	{ 'e','s','a','r','e' }
	};
	int AL[4] = {
	7,
	5,
	6,
	5
	};
	char S[10002];

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define forn(i, n) for (ll i = 0; i < (ll) (n); ++i)
#define sz(a) static_cast<int>((a).size())
#define pb emplace_back
#define mp make_pair
#define endl '\n'
#define f first
#define s second

#ifdef SEREZHKA
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...)
#endif

template<typename T>
void _dbg(const char* _s, T _h) { cerr << _s << " = " << _h << "\n"; }

template<typename T, typename... Ts>
void _dbg(const char*_s, T _h, Ts... _t) {
    int _b = 0;
    
    while (((_b += *_s == '(') -= *_s == ')') != 0 || *_s != ',')
        cerr << *_s++;
    
    cerr << " = " << _h << ",";
    _dbg(_s + 1, _t...);
}

using ll = long long;

const ll INF = static_cast<ll>(1e9) + 7ll;
const ll LINF = INF * INF;
const int MAXN = static_cast<int>(1e6) + 17;

int n;
string s;

bool read() {
    if (!(cin >> s))
        return false;

    return true;
}

void solve() {
    n = sz(s);
    vector<string> L = {"dream", "dreamer", "erase", "eraser"};

    while (n > 0) {
        bool ok = false;

        for (auto i : L)
            if (sz(s) >= sz(i) && s.substr(sz(s) - sz(i), sz(i)) == i) {
                ok = true;
                forn (j, sz(i)) s.pop_back();
                break;
            }

        if (!ok)
            break;
    }

    cout << ({"YES", "NO"})[s.empty()] << endl;
}

int main() {
    cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    
    while (read())
        solve();
    
    return 0;
}



Compiler output:
a.cc: In function 'void solve()':
a.cc:67:26: error: expected ';' before '}' token
   67 |     cout << ({"YES", "NO"})[s.empty()] << endl;
      |                          ^
      |                          ;
Language: C++

#include<cstdio>
#include<map>
#include<algorithm>
using namespace std;
int fa[200005],fb[200005];
map<int,map<int,int> >mp;

int fd1(int x) {
	if(fa[x]==x) return x;
	return fa[x]=fd1(fa[x]);
}

int fd2(int x) {
	if(fb[x]==x) return x;
	return fb[x]=fd2(fb[x]);
}

void U1(int x,int y) fa[fd1(x)]=fd1(y);
void U2(int x,int y) fb[fd2(x)]=fd2(y);

int main() {
	int n,k,l;
	scanf("%d %d %d",&n,&k,&l);
	for(int i=1; i<=n; i++) fa[i]=fb[i]=i;
	for(int i=1; i<=k; i++) {
		int x,y;
		scanf("%d %d",&x,&y);
		U1(x,y);
	}
	for(int i=1;i<=l;i++) {
		int x,y;
		scanf("%d %d",&x,&y);
		U2(x,y);
	}
	
    for(int i=1; i<=n; i++) mp[fd1(i)][fd2(i)]++;
	for(int i=1; i<=n; i++) printf("%d ",mp[fd1(i)][fd2(i)]);
	return 0;
}

Compiler output:
a.cc:18:22: error: expected initializer before 'fa'
   18 | void U1(int x,int y) fa[fd1(x)]=fd1(y);
      |                      ^~
a.cc:19:22: error: expected initializer before 'fb'
   19 | void U2(int x,int y) fb[fd2(x)]=fd2(y);
      |                      ^~
a.cc: In function 'int main()':
a.cc:28:17: error: 'U1' was not declared in this scope
   28 |                 U1(x,y);
      |                 ^~
a.cc:33:17: error: 'U2' was not declared in this scope
   33 |                 U2(x,y);
      |                 ^~
Language: C++

#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
using namespace std;
const int inf=1e9,dx[]={-1,0,1,0},dy[]={0,-1,0,1};
string s,word[]={"dream","erase","dreamer","eraser"};
pair<int,int> p[4]={{5,0},{5,1},{7,2},{6,3}};
void dfs(int x)
{
	if(x==s.size()-1)
	{
		cout<<"YES";
		exit(0);
	}
	for(int d=0;d<4;d++)
	{
		int len=p[d].first,wd=p[d].second;
		if(s.substr(x,len)==word[wd])
			dfs(x+len);
	}
}
int main(){
	cin>>s;
	mp["dream"]=true;
	mp["dreamer"]=true;
	mp["erase"]=true;
	mp["eraser"]=true;
	dfs(0);
	cout<<"NO";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:9: error: 'mp' was not declared in this scope; did you mean 'p'?
   32 |         mp["dream"]=true;
      |         ^~
      |         p
Language: C++

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

int main(){
	map<string,int> mp;
  	mp["maerd"]=5;
  	mp["remae"]=7;
  	mp["esare"]=5;
  	mp["resar"]=6;
  	string s;
	cin>>s;
	while(s!=""){
      	bool ok=false;
    	for(auto p:mp){
        	if(ok|=(s.substr(0,5)==p.first)) s=s.substr(mp.second);
        }
    	if(!ok)break;
    }
  	if(s=="")cout<<"YES"<<endl;
  	else cout<<"NO"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:64: error: 'class std::map<std::__cxx11::basic_string<char>, int>' has no member named 'second'
   15 |                 if(ok|=(s.substr(0,5)==p.first)) s=s.substr(mp.second);
      |                                                                ^~~~~~
Language: C++

int main() {
	std::string s;
	std::cin >> s;
	int cou=0;
	for (int i = 0; i < s.size(); i++){
		if (s[i + 0] == 'd'&&s[i + 1] == 'r'&&s[i + 2] == 'e'&&s[i + 3] == 'a'&&s[i + 4] == 'm') {
			if (s[i + 5] == 'e'&&s[i + 6] == 'r'&&!(s[i + 7] == 'a'&&s[i + 8] == 's'&&s[i + 9] == 'e')) {
				cou += 7;
				i += 6;
			}
			else {
				cou += 5;
				i += 4;
			}
		}
		 if (s[i + 0] == 'e'&&s[i + 1] == 'r'&&s[i + 2] == 'a'&&s[i + 3] == 's'&&s[i + 4] == 'e') {
			if (s[i + 5] == 'r') {
				cou += 6;
				i += 5;
			}
			else {
				cou += 5;
				i += 4;
			}
		}
}
	if (cou >= s.size()) {
		std::cout << "YES" << std::endl;
	}
	else {
		std::cout << "NO" << std::endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:14: error: 'string' is not a member of 'std'
    2 |         std::string s;
      |              ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | int main() {
a.cc:3:14: error: 'cin' is not a member of 'std'
    3 |         std::cin >> s;
      |              ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main() {
a.cc:3:21: error: 's' was not declared in this scope
    3 |         std::cin >> s;
      |                     ^
a.cc:28:22: error: 'cout' is not a member of 'std'
   28 |                 std::cout << "YES" << std::endl;
      |                      ^~~~
a.cc:28:22: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:28:44: error: 'endl' is not a member of 'std'
   28 |                 std::cout << "YES" << std::endl;
      |                                            ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | int main() {
a.cc:31:22: error: 'cout' is not a member of 'std'
   31 |                 std::cout << "NO" << std::endl;
      |                      ^~~~
a.cc:31:22: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:31:43: error: 'endl' is not a member of 'std'
   31 |                 std::cout << "NO" << std::endl;
      |                                           ^~~~
a.cc:31:43: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

S = input()

keys = ('dreameraser', 'dreamererase', 'erase', 'dream', 'dreamer', 'eraser')

for key in keys:
    S = S.replace(key, '')

if S == '':
    print('YES')
else:
    print('NO')


Compiler output:
a.cc:3:9: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
    3 | keys = ('dreameraser', 'dreamererase', 'erase', 'dream', 'dreamer', 'eraser')
      |         ^~~~~~~~~~~~~
a.cc:3:24: warning: multi-character literal with 12 characters exceeds 'int' size of 4 bytes
    3 | keys = ('dreameraser', 'dreamererase', 'erase', 'dream', 'dreamer', 'eraser')
      |                        ^~~~~~~~~~~~~~
a.cc:3:40: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
    3 | keys = ('dreameraser', 'dreamererase', 'erase', 'dream', 'dreamer', 'eraser')
      |                                        ^~~~~~~
a.cc:3:49: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
    3 | keys = ('dreameraser', 'dreamererase', 'erase', 'dream', 'dreamer', 'eraser')
      |                                                 ^~~~~~~
a.cc:3:58: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
    3 | keys = ('dreameraser', 'dreamererase', 'erase', 'dream', 'dreamer', 'eraser')
      |                                                          ^~~~~~~~~
a.cc:3:69: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
    3 | keys = ('dreameraser', 'dreamererase', 'erase', 'dream', 'dreamer', 'eraser')
      |                                                                     ^~~~~~~~
a.cc:6:24: error: empty character constant
    6 |     S = S.replace(key, '')
      |                        ^~
a.cc:8:9: error: empty character constant
    8 | if S == '':
      |         ^~
a.cc:9:11: warning: multi-character character constant [-Wmultichar]
    9 |     print('YES')
      |           ^~~~~
a.cc:11:11: warning: multi-character character constant [-Wmultichar]
   11 |     print('NO')
      |           ^~~~
a.cc:1:1: error: 'S' does not name a type
    1 | S = input()
      | ^
Language: C

#include <stdio.h>
#include <string.h>
int main(void)
{ int i,j,k,l,lens,m,n,sum,dl,tmp,flag;
	flag=0;
	char s[100000];
	char d[4][8]={"maerd","renaerd","esare","resare"};
	scanf("%s",s);
	lens=strlen(s);
	for(i=0;i<=3;i++){
		dl=strlen(d[i]);
		printf("%d",dl);
	for(j=lens;j>lens-dl;j--){
		if(j<0){
			flag=1;
			break;}
		if(s[j-1]!=d[i][lens-j]){
			flag=1;
			break;}
			if(flag==0){
			if(i==0){
				lens-=5;}
				else if(i==1)
				lens-=7;
				else if(i==2)
				lens-=5;
				else if(i==3)
				lens-=6;
				continue;}
				else if(flag==1)
				break;}
	
	if(flag==1)
	printf("No");
	else if(flag==0)
	printf("Yes");
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:39:1: error: expected declaration or statement at end of input
   39 | }
      | ^
Language: C++

s=input()

while 1:

    if s[-5:] in ["dream","erase"]:
        s=s[:-5]
    elif s[-6:] == "eraser":
        s=s[:-6]
    elif s[-7:] == "dreamer":
        s=s[:-7]
    elif s == "":
        print("YES")
        exit()
    else:
        print("NO")
        exit()


Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s=input()
      | ^
Language: C++

include<bits/stdc++.h>
std::string S;
int d1 = 5;
int d2 = 7;
int e1 = 5;
int e2 = 6;
int len = 0;

bool parse(int i) {
    if(i >= len) return true;

    if(S[i] == 'd') {
        if(S.substr(i, d1) == "dream") {
            bool r1 = parse(i + d1);
            if(r1) {
                return true;
            } else if(S.substr(i, d2) == "dreamer") {
                bool r2 = parse(i + d2);
                if(r2) {
                    return true;
                }
            }
        }
    } else if(S[i] == 'e') {
        if(S.substr(i, e1) == "erase") {
            bool r3 = parse(i + e1);
            if(r3) {
                return true;
            } else if(S.substr(i, e2) == "eraser") {
                bool r4 = parse(i + e2);
                if(r4) {
                    return true;
                }
            }
        }
    }
    return false;
}

int main() {
    std::cin >> S;
    len = S.length();

    bool res = parse(0);
    if(res) {
        std::cout << "YES" << std::endl;
    } else {
        std::cout << "NO" << std::endl;
    }
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'bool parse(int)':
a.cc:12:8: error: 'S' was not declared in this scope
   12 |     if(S[i] == 'd') {
      |        ^
a.cc: In function 'int main()':
a.cc:41:10: error: 'cin' is not a member of 'std'
   41 |     std::cin >> S;
      |          ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | include<bits/stdc++.h>
a.cc:41:17: error: 'S' was not declared in this scope
   41 |     std::cin >> S;
      |                 ^
a.cc:46:14: error: 'cout' is not a member of 'std'
   46 |         std::cout << "YES" << std::endl;
      |              ^~~~
a.cc:46:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:46:36: error: 'endl' is not a member of 'std'
   46 |         std::cout << "YES" << std::endl;
      |                                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | include<bits/stdc++.h>
a.cc:48:14: error: 'cout' is not a member of 'std'
   48 |         std::cout << "NO" << std::endl;
      |              ^~~~
a.cc:48:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:48:35: error: 'endl' is not a member of 'std'
   48 |         std::cout << "NO" << std::endl;
      |                                   ^~~~
a.cc:48:35: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include<iostream>
#include<string>
#include<vector>

using namespace std;

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

	int len;
	bool t=true;
	for(int i=0 ; i<S.size() ; i+=len){
		if(S.substr(i,1)=="e" || S.substr(i,1)=="d" ){
			else if(S.substr(i,5)=="erase"){
				if(S.substr(i+5,1)=="e")len=5;
				else if(S.substr(i+5,1)=="r")len=6;
				else len=5;
			}
			else if(S.substr(i,5)=="dream"){
				if(S.substr(i+5,2)=="er"){
					if(S.substr(i+7,2)=="er")len=7;
					else len=5;
				}
				else len=5;
			}
			else{
				t=false;
				break;
			}
		}
		else{
			t=false;
			break;
		}
	}
	cout<<(t?"YES\n" : "NO\n");
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:25: error: expected '}' before 'else'
   15 |                         else if(S.substr(i,5)=="erase"){
      |                         ^~~~
a.cc:14:62: note: to match this '{'
   14 |                 if(S.substr(i,1)=="e" || S.substr(i,1)=="d" ){
      |                                                              ^
a.cc:32:17: error: 'else' without a previous 'if'
   32 |                 else{
      |                 ^~~~
a.cc:34:25: error: break statement not within loop or switch
   34 |                         break;
      |                         ^~~~~
a.cc: At global scope:
a.cc:37:9: error: 'cout' does not name a type
   37 |         cout<<(t?"YES\n" : "NO\n");
      |         ^~~~
a.cc:39:9: error: expected unqualified-id before 'return'
   39 |         return 0;
      |         ^~~~~~
a.cc:40:1: error: expected declaration before '}' token
   40 | }
      | ^
Language: C

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

#define N 100001
#define YES 1
#define NO  0

char *t[4] = {"dream", "dreamer", "erase", "eraser"};
char *ans[2] = {"NO", "YES"};

int match(char *);
int strncmp(char *, char *, int);
int strlen(char*);

int main(void){
	char str[N];
	int r;

	scanf("%s", str);
	r=match(str);
	printf("%s\n", ans[r]);
	
	
	return 0;
}

int match(char *str){
	int len, r=NO, flg, i;
	
	if(*str == '\0') return YES;
	for(i=0; i<4; i++){
		len = strlen(t[i]);
		if(strncmp(str, t[i], len) == 0){
			r = match(str+len);
			if(r == YES) return r;
		}
	}
	
	return NO;
}

int strlen(char *p){
	int cnt=0;

	while(p[cnt++] != '\0');
	cnt--;
	return cnt;
}

int strncmp(char *a, char *b, int size){
	int i;
	
	for(i=0; i<size; i++){
		if(a[i] >  b[i]) return -1;
		else if(a[i] < b[i]) return 1;
	}
	
	return 0;


Compiler output:
main.c:12:5: warning: conflicting types for built-in function 'strncmp'; expected 'int(const char *, const char *, long unsigned int)' [-Wbuiltin-declaration-mismatch]
   12 | int strncmp(char *, char *, int);
      |     ^~~~~~~
main.c:3:1: note: 'strncmp' is declared in header '<string.h>'
    2 | #include <stdlib.h>
  +++ |+#include <string.h>
    3 | 
main.c:13:5: warning: conflicting types for built-in function 'strlen'; expected 'long unsigned int(const char *)' [-Wbuiltin-declaration-mismatch]
   13 | int strlen(char*);
      |     ^~~~~~
main.c:13:5: note: 'strlen' is declared in header '<string.h>'
main.c: In function 'strncmp':
main.c:58:9: error: expected declaration or statement at end of input
   58 |         return 0;
      |         ^~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
#define M 100005
char c[M];
int main()
{
    scanf("%s",c);
    char d1[7]={'d','r','e','a','m','e','r'},e1[6]={'e','r','a','s','e','r'};
    int flag=1;
     for(int i=0;i<strlen(c);)
     {
         if(c[i]=='d')
         {
             for(int k=0;k<8;k++)
             {
                 if(k<5)
                 {
                    if(c[i+k]!=d1[k])
                    {
                        flag=0;
                        break;
                    }
                 }
                  if(k<7)
                 {
                     if(c[i+k]!=d1[k]) { i+=5; break;}
                 }
                 if(k==7)
                 {
                     if(c[i+k]=='a') i+=5;
                     else i+=7;
                 }

            }
         }
         else
         {
             for(int g=0;g<7;g++)
             {
                 if(g<5)
                 {
                     if(c[i+g]!=e1[g])
                     {
                         flag=0;
                         break;
                     }
                 }
                 if(g<6)
                 {
                      if(c[i+g]!=e1[g]) { i+=5; break;}
                 }
                if(k==6)
                {
                    if(c[i+g]=='a') i+=5;
                    else i+=6;
                }

             }
         }
     }
     if(flag) printf("YES\n");
     else printf("NO\n");
     return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:20: error: 'k' was not declared in this scope
   54 |                 if(k==6)
      |                    ^
Language: C++

#include <stdio.h>

typedef struct Item {
	struct Item *next;
	int to;
} Item;
#define MAX_NODE (200000)
Item *train[MAX_NODE] = {0}, *road[MAX_NODE] = {0};
int parent[MAX_NODE], sizes[MAX_NODE] = {0};
int setted[MAX_NODE] = {0}, resetted[MAX_NODE] = {0};
int ans[MAX_NODE] = {0};

void add(Item* list[], int from, int to){
	Item *p = (Item*)malloc(sizeof(Item));
	p->next = list[from];
	p->to = to;
	list[from] = p;
}
void setParent(int p, int n){
	Item *it;
	int next;
	for(it=road[n]; it!=NULL; it=it->next){
		next = it->to;
		if(parent[next]!=next || p==next){ continue; }
		parent[next] = p;
		setParent(p, next);
	}
}
void setSize(int n){
	Item *it;
	int next;
	setted[n] = 1;
	sizes[parent[n]]++;
	for(it=train[n]; it!=NULL; it=it->next){
		next = it->to;
		if(setted[next]){ continue; }
		setSize(next);
	}
}
void getSize(int n){
	Item *it;
	int next;
	ans[n] = sizes[parent[n]];
	for(it=train[n]; it!=NULL; it=it->next){
		next = it->to;
		if(ans[next]){ continue; }
		getSize(next);
	}
}
void resetSize(int n){
	Item *it;
	int next;
	resetted[n] = 1;
	sizes[parent[n]] = 0;
	for(it=train[n]; it!=NULL; it=it->next){
		next = it->to;
		if(resetted[next]){ continue; }
		resetSize(next);
	}
}

int main(void){
	int i, j;
	int N, K, L, from, to;
	scanf("%d%d%d", &N, &K, &L);
	for(i=0;i<N;i++){
		parent[i] = i;
	}
	for(i=0;i<K;i++){
		scanf("%d%d", &from, &to); from--; to--;
		add(road, from, to);
		add(road, to, from);
	}
	for(i=0;i<N;i++){ if(parent[i]==i){ setParent(i, i); } }
	
	for(i=0;i<L;i++){
		scanf("%d%d", &from, &to); from--; to--;
		add(train, from, to);
		add(train, to, from);
	}
	for(i=0;i<N;i++){
		if(ans[i]){ continue; }
		setSize(i);
		getSize(i);
		resetSize(i);
	}
	printf("%d", ans[0]);
	for(i=1;i<N;i++){
		printf(" %d", ans[i]);
	}
	puts("");
	return 0;
}

Compiler output:
a.cc: In function 'void add(Item**, int, int)':
a.cc:14:26: error: 'malloc' was not declared in this scope
   14 |         Item *p = (Item*)malloc(sizeof(Item));
      |                          ^~~~~~
a.cc:2:1: note: 'malloc' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
    1 | #include <stdio.h>
  +++ |+#include <cstdlib>
    2 |
Language: Java

//package com.regular.arc065;


import java.util.Scanner;

public class Main1 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();
        String []PARTS = {"dream","dreamer","erase","eraser"};
        boolean flag = true;
        boolean able = true;
        while(flag) {
            flag = false;
            for (int i = 0; i < PARTS.length; i++) {
                if (input.endsWith(PARTS[i])) {
                    //input = input.substring(0, input.length() - PARTS[i].length());
                    input = input.substring(input.length()-6);
                    flag= true;
                }
            }
            if (input.length()==0) able =true;
            else able = false;
        }
        if(able){
            System.out.println("YES");
        }
        else{
            System.out.println("NO");
        }

        sc.close();

    }

}


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

#include<iostream>

using namespace std;

int main(){
	string S;
	cin>> S;
	
	string t;
	for(int i=S.size()-1; i>=0; i--){
		t=S[i]+t;
		if(t.size()==5){
			if(t=="raser"||t=="eamer"){
				;;
			}else if(t!="dream"&&t!="erase"){
				cout<< "NO"<< endl;
				return 0;
			}else{
				t="";
			}
		}else if(t.size()==6){
			if(t=="reamer"){
				;;
			}else if(t!="eraser"){
				cout<< "NO"<< endl;
				return 0;
			}else{
				t="";
			}
	}else if(t.size()==7){
		if(t!="dreamer"){
			cout<< "NO"<< endl;
			return 0;
		}
		t="";
	}
	
	cout<< (t.empty()? "YES": "NO")<< endl;
	
	return 0;
}

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

#include<iostream>

using namespace std;

int main(){
	string S;
	cin>> S;
	
	string t;
	for(int i=S.size()-1; i>=0; i--){
		t=S[i]+t;
		if(t.size()==5){
			if(t=="raser"||t=="eamer"){
				;;
			}else if(t!="dream"%%t!="erase"){
				cout<< "NO"<< endl;
				return 0;
			}else{
				t="";
			}
		}else if(t.size()==6){
			if(t=="reamer"){
				;;
			}else if(t!="eraser"){
				cout<< "NO"<< endl;
				return 0;
			}else{
				t="";
			}
	}else if(t.size()==7){
		if(t!="dreamer"){
			cout<< "NO"<< endl;
			return 0;
		}
		t="";
	}
	
	cout<< (t.empty()? "YES": "NO")<< endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:45: error: expected primary-expression before '%' token
   15 |                         }else if(t!="dream"%%t!="erase"){
      |                                             ^
a.cc:41:2: error: expected '}' at end of input
   41 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include<iostream>

using namespace std;

int main(){
	string S;
	cin>> S;
	
	string t;
	for(int i_S.size()-1; i>=0; i--){
		t=S[i]+t;
		if(t.size()==5){
			if(t=="raser"||t=="eamer"){
				;;
			}else if(t!="dream"%%t!="erase"){
				cout<< "NO"<< endl;
				return 0;
			}else{
				t="";
			}
		}else if(t.size()==6){
			if(t=="reamer"){
				;;
			}else if(t!="eraser"){
				cout<< "NO"<< endl;
				return 0;
			}else{
				t="";
			}
	}else if(t.size()==7){
		if(t!="dreamer"){
			cout<< "NO"<< endl;
			return 0;
		}
		t="";
	}
	
	cout<< (t.empty()? "YES": "NO")<< endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: expected ';' before '.' token
   10 |         for(int i_S.size()-1; i>=0; i--){
      |                    ^
      |                    ;
a.cc:10:20: error: expected primary-expression before '.' token
a.cc:10:31: error: 'i' was not declared in this scope
   10 |         for(int i_S.size()-1; i>=0; i--){
      |                               ^
a.cc:10:35: error: expected ')' before ';' token
   10 |         for(int i_S.size()-1; i>=0; i--){
      |            ~                      ^
      |                                   )
a.cc:10:37: error: 'i' was not declared in this scope
   10 |         for(int i_S.size()-1; i>=0; i--){
      |                                     ^
a.cc:41:2: error: expected '}' at end of input
   41 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C

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


int main() {
	char S[1000000];
	
	scanf("%s", S);
	int i;
	for(i = 0; i < strlen(S); i++) {
		if (S[i] == 'd') {
			if(S[++i] != 'r') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'e') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'a') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'm') {
				printf("NO");
				return 0;
			}
			if(S[i+1] == 'e') {
				if(S[i+2] == 'r') {
					if(S[i+3] != 'a') {
						i += 2;
					}
				}
			}
		} else if (S[i] == 'e') {
			if(S[++i] != 'r') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'a') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 's') {
				printf("NO");
				return 0;
			}
			if(S[++i] != 'e') {
				printf("NO");
				return 0;
			}
			if(S[i + 1] == 'r')
					i++;
		} else {
			printf("NO");
			return 0;
	}
	printf("YES");
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:62:1: error: expected declaration or statement at end of input
   62 | }
      | ^