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

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

int main()
{
    string S;
    cin >> S;
    if (S[0] != 'A')
    {
        S.insert(0, "A");
    }
    if (S.size() < 5)
    {
        cout << "NO" << endl;
        return;
    }
    if (S[4] != 'A')
    {
        S.insert(4, "A");
    }
    if (S.size() < 6)
    {
        cout << "NO" << endl;
        return;
    }
    if (S[6] != 'A')
    {
        S.insert(6, "A");
    }
    if (S.size() < 8)
    {
        cout << "NO" << endl;
        return;
    }
    if (S[8] != 'A')
    {
        S.insert(8, "A");
    }
    if (S != "AKIHABARA")
    {
        cout << "NO" << endl;
    }
    else
    {
        cout << "YES" << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   17 |         return;
      |         ^~~~~~
a.cc:26:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   26 |         return;
      |         ^~~~~~
a.cc:35:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   35 |         return;
      |         ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
 
// nCk を取得
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
 
int main() {
string s;
cin>>s;
string t = "";
ll n=s.size();
if(n>9){
cout << "NO" << endl;}
else{

for(ll i=0; i<n; i++){
if(s.at(i)!='A'){
t+=s.at(i);}}
string u="KIHBR";
if(t!=u){
cout << "NO" << endl;}

else{
  
ll ca=0;
while(s.at(ca)=='A'){
ca++;}
if(ca>1){
cout << "NO" << endl;}
else if(s.at(ca+1)!='I'||s.at(ca+2)!='H'){
cout << "NO" << endl;}
  
else{
  
ca++;
ca++;
ca++;
while(s.at(ca)=='A'){
ca++;
k++;}
if(k>1){
cout << "NO" << endl;}
  
else{
  
k=0;
ca++;
while(s.at(ca)=='A'){
ca++;
k++;}
if(k>1){
cout << "NO" << endl;}
else if(n-ca<2){
cout << "YES" << endl;}
else{
cout << "NO" << endl;}
}}}}}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:1: error: 'k' was not declared in this scope
   52 | k++;}
      | ^
a.cc:53:4: error: 'k' was not declared in this scope
   53 | if(k>1){
      |    ^
Language: Java

import java.util.Scanner;
public class c{
  public static void main(String args[]){
    String s=new Scanner(System.in).nextLine();
    if(s.matches("A?KIHA?BA?RA?")){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }
  }
}


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

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

int main(){
  string S;
  cin >> S;
  vector<string> T={"AKIHABARA","AKIHABAR","AKIHABRA","KIHABARA","AKIHABR","AKIHBAR","AKIHBRA",
                    "KIHABAR","KIHABRA","KIHBARA","AKIHBR","KIHABR","KIHBAR","KIHBRA"}
  bool a=false;
  for(int i=0;i<14;i++){
    if(S==T.at(i)){
      a=true;
      break;
    }
  }
  if(a){
    cout << "YES" << endl;
  }
  else{
    cout << "NO" << endl;
  }
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'bool'
    9 |   bool a=false;
      |   ^~~~
a.cc:12:7: error: 'a' was not declared in this scope
   12 |       a=true;
      |       ^
a.cc:16:6: error: 'a' was not declared in this scope
   16 |   if(a){
      |      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
const double pi=3.14159265358979323846;
int ctoi(const char c) {
    if ('0' <= c && c <= '9') return (c - '0');
    return -1;
}
vector<int> input(int n) {
    vector<int> vec(n);
    for (int i = 0; i < n; i++) {
        cin >> vec.at(i);
    }
    return vec;
}
void output(vector<int> vec) {
    for (int i = 0; i < vec.size(); i++) {
        cout << vec[i] << " ";
    }
    return;
}
vector<vector<int>> input(int n, int m) {
    vector<vector<int>> table(n, vector<int>(m));
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            cin >> table. at(i).at(j);
        }
    }
    return table;
}
void output(vector<vector<int>> table) {
    for (int i = 0; i < table.size(); i++) {
        for (int j = 0; j < table.at(0).size(); j++) {
            cout << table.at(i).at(j) << " ";
        }
        cout << endl;
    }
}
long long perm(int n, int r) {
    if (n < r) {
        cout << "error" << endl;
        return 0;
    }
    long long perm = 1;
    for (int i = n; i > n - r; i--) {
        perm *= i;
    }
    return perm;
}
long long comb(int n, int r) {
    if (n < r) {
        cout << "error" << endl;
        return 0;
    }
    long long comb = perm(n,r);
    for (int i = r; i > 0; i--) {
        comb /= i;
    }
    return comb;
}
long long homo(int n, int r) {
    return comb(n + r - 1, n - 1);
}
long long fact(int n) {
    long long fact = 1;
    for (int i = n; i > 0; i--) {
        fact *= i;
    }
    return fact;
}
int gcd(int a, int b){
    if (a % b == 0){
        return(b);
    }else{
        return(gcd(b, a % b));
    }
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
bool isprime(int n){
    if (n < 2) return false;
    else if (n == 2) return true;
    else if (n % 2 == 0) return false;

    for (int i = 3; i <= sqrt(n); i += 2){
        if (n % i == 0){
            return false;
        }
    }
    return true;
}
void sayYes(bool f) {
    if (f) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}
void sayYES(bool f) {
    if (f) {
        cout << "YES" << endl;
    }
    else {
        cout << "NO" << endl;
    }
}

int main() {
  string s;
  cin >> s;
  if(s.size()>9){
    cout << "NO" << endl;
  }else{
    rep(i,s.size()){
      if(s[i]=='A'){
        s[i]="";
      }
    }
  }
  if(s=="KIHBR"){
    cout << "YES" << endl;
  }else{
    cout << "NO" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:119:14: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
  119 |         s[i]="";
      |              ^~
      |              |
      |              const char*
Language: C++

#include<bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;

using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define REP(i, l, n) for(int i=(l), i##_len=(n); i<i##_len; ++i)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back

ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
 
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

char alpha[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};

int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, 1, -1};

int main(){
    string s; cin >> s;
    int ll[6] = {1, 0, 0, 1, 1, 1};
    vector<int> lis;
    int ch = 0;
    string ss = "KIHBR";
    int count = 0;
    if(s.size() > 9){
        cout << "NO" << endl;
        return 0;
    }
    REP(i, 0, s.size()){
        if(ch >= 5 && s[i] != 'A'){
            cout << "NO" << endl;
            return 0;
        }
        if(ch < 5 && s[i] == ss[ch]){
            lis.pb(count);
            ch++;
            count = 0;
        }else if(s[i] == 'A'){
            count++;
        }else if(s[i] != ss[ch]){
            cout << "NO" << endl;
            return 0;
        }
    }
    lis.pb(count);
    if(ll.size() != lis.size()){
        cout << "NO" << endl;
        return 0;
    }
    REP(i, 0, lis.size()){
        if(ll[i] < lis[i]){
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:11: error: request for member 'size' in 'll', which is of non-class type 'int [6]'
   67 |     if(ll.size() != lis.size()){
      |           ^~~~
Language: C++

#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
#define rep(i, n) for (int i = 0; i < n; ++i)
using ll = long long;
using namespace std;
#define P pair<int, int>
using namespace std;
int main(void){
    int ans=1;
    string s;
    cin>>s;
    string t="AKIHABARA";
    for(i=0;i<t.length();i++){
        if(s[i]!=t[i]){
            s.insert(s.begin()+i,'A');
        }
    }
    if(s.length()!=t.length())ans=0;
    for(i=0;i<t.length();i++){
        if(s[i]!=t[i])ans=0;
    }
    cout<<(ans?"YES":"NO")<<endl;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'i' was not declared in this scope
   17 |     for(i=0;i<t.length();i++){
      |         ^
a.cc:23:9: error: 'i' was not declared in this scope
   23 |     for(i=0;i<t.length();i++){
      |         ^
Language: C++

#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
#define rep(i, n) for (int i = 0; i < n; ++i)
using ll = long long;
using namespace std;
#define P pair<int, int>
using namespace std;
int main(void){
    int ans=1;
    string s;
    cin>>s;
    string t="AKIHABARA";
    for(i=0;i<t.length();i++){
        if(s[i]!=t[i]){
            s.insert(s.begin()+i,'A');
        }
    }
    if(s.length()!=t.length())ans=0;
    for(i=0;i<t.length();i++){
        if(s[i]!=t[i])ans=0;
    }
    cout<<(ans?"YES":"NO")<<endl;
}
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'i' was not declared in this scope
   17 |     for(i=0;i<t.length();i++){
      |         ^
a.cc:23:9: error: 'i' was not declared in this scope
   23 |     for(i=0;i<t.length();i++){
      |         ^
a.cc: At global scope:
a.cc:29:5: error: expected unqualified-id before 'return'
   29 |     return 0;
      |     ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: Java

import java.util.*;

public class Main{
	
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
  	String s=sc.next(),test="";
    char[] ch=s.toCharArray();
    if(s.length()>n){
      System.out.println("NO");
    }else if(s.length()==n){
      if(s.equals("AKIHABARA")){
        System.out.println("YES");
      }else{
        System.out.println("NO");
      }
    }else{
      for(int i=0;i<ch.length;i++){
        if(i==0){
          if(ch[i]=='K'){
            test+="A"+ch[i];
          }
        }else if(i==n-1){
          if(ch[i]=='A'){
            test+=ch[i];
          }else{
            test+=(ch[i]+"A");
          }
        }else{
          if(ch[i]=='K'){
            if(ch[i-1]=='A'){
              test+=ch[i];
            }else{
              test+=("A"+ch[i]);
            }
          }else if(ch[i]=='H'){
            if(ch[i+1]=='A'){
              test+=ch[i];
            }else{
              test+=(ch[i]+"A");
            }
          }else if(ch[i]=='B'){
            if(ch[i+1]=='A'){
              test+=ch[i];
            }else{
              test+=(ch[i]+"A");
            }
          }else{
            test+=ch[i];
          }
        }
      }
      if(test.equals(s)){
        System.out.println("YES");
      }else{
        System.out.println("NO");
      }
    }
  }
}


Compiler output:
Main.java:9: error: cannot find symbol
    if(s.length()>n){
                  ^
  symbol:   variable n
  location: class Main
Main.java:11: error: cannot find symbol
    }else if(s.length()==n){
                         ^
  symbol:   variable n
  location: class Main
Main.java:23: error: cannot find symbol
        }else if(i==n-1){
                    ^
  symbol:   variable n
  location: class Main
3 errors
Language: C++

#include<bits/stdc++.h>
#define endl "\n"
#pragma GCC optimize(3)
using namespace std;
string list[16]={"KIHBR","AKIHBR","KIHABR","KIHBAR","KIHBRA","AKIHABR","AKIHBAR","AKIHBRA","KIHABAR","KIHABRA","KIHBARA","AKIHABAR","AKIHABRA","AKIHBARA","KIHABARA","AKIHABARA"};
string a;
signed main()
{
	ios::sync_with_stdio(false);
	cin>>a;
	for(int i=0;i<16;i++)
		if(a==list[i])
		{
			cout<<"YES\n";
			return 0;
		}
	cout<<"NO\n";
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: reference to 'list' is ambiguous
   12 |                 if(a==list[i])
      |                       ^~~~
In file included from /usr/include/c++/14/list:65,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:150,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_list.h:633:11: note: candidates are: 'template<class _Tp, class _Alloc> class std::__cxx11::list'
  633 |     class list : protected _List_base<_Tp, _Alloc>
      |           ^~~~
a.cc:5:8: note:                 'std::string list [16]'
    5 | string list[16]={"KIHBR","AKIHBR","KIHABR","KIHBAR","KIHBRA","AKIHABR","AKIHBAR","AKIHBRA","KIHABAR","KIHABRA","KIHBARA","AKIHABAR","AKIHABRA","AKIHBARA","KIHABARA","AKIHABARA"};
      |        ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
#define ALL(v) v.begin(), v.end()
#define vmax(v) *max_element(ALL(v))
#define vmin(v) *min_element(ALL(v))
#define chmax(x, a) x = max(x, a)
#define chmin(x, a) x = min(x, a)

int main() {
  string s; cin >> s;
  if (s == "AKIHABARA" || s == "KIHABARA" || s == "AKIHBARA" || s == "AKIHABRA"
      || s == "AKIHABAR" || s == "KIHBARA" || s == "KIHABRA" || s == "KIHABAR"
      || s == "AKIHBRA" || s == "AKIHBAR" || s == "AKIHABR" || s == "KIHBRA"
      || s == "KIHBAR" || s == "AKIHBR" || s == "KIHBR"
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:56: error: expected ')' before '}' token
   17 |       || s == "KIHBAR" || s == "AKIHBR" || s == "KIHBR"
      |                                                        ^
      |                                                        )
   18 | }
      | ~                                                       
a.cc:14:6: note: to match this '('
   14 |   if (s == "AKIHABARA" || s == "KIHABARA" || s == "AKIHBARA" || s == "AKIHABRA"
      |      ^
a.cc:18:1: error: expected primary-expression before '}' token
   18 | }
      | ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>

using namespace std;
#define int long long

#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(), (x).end()

template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; abort();}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
//SOLVE

//-----CODE------//
void solve(void)
{ 
  string str;
  cin>>str;
  if(str == "AKIHABARA" || str == "KIHABARA" ||str == "AKIHBARA" ||str == "AKIHABRA" ||str == "AKIHABAR"||str == "KIHBARA"  ||str == "KIHABRA" ||str == "KIHABAR"||str == "KIHBRA" ||str == "AKIHBR" ||str == "KIHBR" || str == "AKIHBRA"|| str == "AKIHBAR" |||| str == "AKIHABR")
  {
    cout<<"YES"<<endl;
  }
  else
  {
    cout<<"NO"<<endl;
  }
  

  return;
}
int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:53:256: error: expected primary-expression before '||' token
   53 |   if(str == "AKIHABARA" || str == "KIHABARA" ||str == "AKIHBARA" ||str == "AKIHABRA" ||str == "AKIHABAR"||str == "KIHBARA"  ||str == "KIHABRA" ||str == "KIHABAR"||str == "KIHBRA" ||str == "AKIHBR" ||str == "KIHBR" || str == "AKIHBRA"|| str == "AKIHBAR" |||| str == "AKIHABR")
      |                                                                                                                                                                                                                                                                ^~
Language: C++

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

int main()
{
	char S[50];
	scanf("%s", S);
	int len = strlen(S);
	
	if(S>=10) printf("NO");
	else{
		int r;
		int c=0;
		char T[50];
		for(r=0; r<50; r++){
			if(S[r] != 'A') T[c] = S[r];
			c++;
		}
	if(T[0]=='K' && T[1]=='I' && T[2]=='H' && T[3]=='B' && T[4]=='R') printf("YES");
	else printf("NO");
	}
	
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if(S>=10) printf("NO");
      |            ~^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    string s;
    cin >> s;
    if(s == "AKIHABARA" ||
       s == "AKIHABAR" ||
       s == "AKIHABRA" ||
       s == "AKIHBARA" ||
       s == "KIHABARA" ||
       s == "AKIHABR" ||
       s == "AKIHBAR" ||
       s == "KIHABAR" ||
       s == "AKIHBRA" ||
       s == "KIHABRA" ||
       s == "KIHBARA" ||
       s == "AKIHBR" ||
       s == "KIHABR" ||
       s == "KIHBAR" ||
       s == "KIHBRA" ||
       s == "KIHBR" ||
    ){
        printf("YES\n");
    }
    else{
        printf("NO\n");
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:5: error: expected primary-expression before ')' token
   22 |     ){
      |     ^
Language: C++

//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const long long INF= 1e+18+1;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int main(){
  string s;cin>>s;
  rep(i,16){
    string t="AKIHABARA";  
    if(i&(1<<0))s[0]='#':
    if(i&(1<<1))s[1]='#';
    if(i&(1<<2))s[2]='#';
    if(i&(1<<3))s[3]='#';
    string ans="";
    rep(j,t.size()){
      if(t[j]!='#')ans+=t[j];
    }
    if(ans==t){
      cout<<"YES"<<endl;
      return 0;
    }
  }
  cout<<"NO"<<endl;
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: expected ';' before ':' token
   19 |     if(i&(1<<0))s[0]='#':
      |                         ^
      |                         ;
Language: C++

	vector <string>kihbr(16);
	int n = 4;
	for (int bit = 0; bit < (1 << n); bit++) {
		string x;
		rep(i,n){
			if (bit & (1 << i)) x += 'A';
			if (i == 0) x += "KIH";
			if (i == 1) x += "B";
			if (i == 2) x += "R";
		}
		kihbr[bit] = x;
	}
	string S,ans="NO";
	cin >> S;
	rep(i, 16) {
		if (S == kihbr[i])
			ans = "YES";
	}
	cout << ans;

Compiler output:
a.cc:1:9: error: 'vector' does not name a type
    1 |         vector <string>kihbr(16);
      |         ^~~~~~
a.cc:3:9: error: expected unqualified-id before 'for'
    3 |         for (int bit = 0; bit < (1 << n); bit++) {
      |         ^~~
a.cc:3:27: error: 'bit' does not name a type
    3 |         for (int bit = 0; bit < (1 << n); bit++) {
      |                           ^~~
a.cc:3:43: error: 'bit' does not name a type
    3 |         for (int bit = 0; bit < (1 << n); bit++) {
      |                                           ^~~
a.cc:13:9: error: 'string' does not name a type
   13 |         string S,ans="NO";
      |         ^~~~~~
a.cc:14:9: error: 'cin' does not name a type
   14 |         cin >> S;
      |         ^~~
a.cc:15:12: error: expected constructor, destructor, or type conversion before '(' token
   15 |         rep(i, 16) {
      |            ^
a.cc:19:9: error: 'cout' does not name a type
   19 |         cout << ans;
      |         ^~~~
Language: C

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

#define i_cin(X) scanf("%d", &X)
#define i_cin2(X,Y) scanf("%d %d",&X,&Y)
#define i_cin3(X,Y,Z) scanf("%d %d %d",&X,&Y,&Z)
#define l_cin(X) scanf("%ld",&X)
#define l_cin2(X,Y) scanf("%ld %ld",&X,&Y)
#define s_cin(X) scanf("%s",&X)

#define  i_cout(X) printf("%d\n",X)
#define  f_cout(X) printf("%g\n",X)
#define  i_cout2(X,Y) printf("%d %d\n",X,Y)
#define  l_cout(X) printf("%ld\n",X)
#define  s_cout(X) printf("%s\n",X)
#define  ll_cout(X) printf("%lld\n",X)

typedef long long int lli;
#define rept(x, s, n) for (int x = s; x < n; x++)


int i_cins(int n, int* A);
int l_cins2(int n, long* A,long* B);
int s_dsort(const void* a, const void* b);

int main(void) {
	int   i=0, len;
	char  S[60];

	s_cin(S);
	len = strlen(S);
	if (len < 5 || len>9) { s_cout("NO"); return 0; }

	memset(&S[len], 0x00, 60 - len);
	if (!memcmp(S, "AKIHABARA", 9)) { s_cout("YES"); return 0; }
	rept(i, 0, 4)
		if (memcmp(&S[i], "KIH", 3)) continue;
	if (i == 4) {
		s_cout("NO"); return 0;
	}
//	i_cout(i);
//	s_cout("B ");
	i = 3;

	if (S[i] == 'B') i++;
	else {
		if (!memcmp(&S[i], "AB", 2)) i += 2;
		else {
			s_cout("NO"); return 0;
		}
	}

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

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

int main() {
  string S;
  cin >> S;
  
  if ( S == "A" || S == "K" || S == "I" || S == "H" || S == "B" || S == "R" ){
    cout << "Yes" << endl;
  }
  else if ( S == "AK" || S == "KI" || S == "IH" || S == "HA" || S == "AB" || S == "BR" || S == "RA"){
    cout << "Yes" << endl;
  }
  else if ( S == "AKI" || S == "KIH" || S == "IHA" || S == "HAB" || S == "ABR" || S == "BRA" ){
    cout << "Yes" << endl;
  }
  else if ( S == "AKIH" ||  S == "KIHA" ||  S == "IHAB" ||  S == "HABA" || S == "ABAR" || S == "BARA"){
    cout << "Yes" << endl;
  }
  else if ( S == "AKIHA" || S == "KIHAB" || S == "IHABA" || S == "HABAR" || S == "ABARA" ||){
    cout << "Yes" << endl;
  }
  else if ( S == "AKIHAB" || S == "KIHABA" || S == "IHABAR" || S == "HABARA" ){
    cout << "Yes" << endl;
  }
  else if ( S == "AKIHABA" || S == "KIHABAR" || S == "IHABARA" || ){
    cout << "Yes" << endl;
  }
  else if ( S == "AKIHABAR" || S == "KIHABARA"){
    cout << "Yes" << endl;
  }
  else if ( S == "AKIHABAR" ){
    cout << "Yes" << endl;
  }
   else if ( S == "KIHBR" || S == "AKIHBR" || S == "KIHABR" || S == "AKIHABR" || S == "KIHBAR" || S == "AKIHBAR" || S == "KIHABAR" || S == "AKIHABAR" || S == "KIHBRA" || S == "AKIHBRA" || S == "KIHABRA" || S == "AKIHABRA" || S == "KIHBARA" || S == "AKIHBARA" || S == "KIHABARA" || S == "AKIHABARA"){
    cout << "Yes" << endl;
  }
  else{
     cout << "No" << endl;
  }
}
    
  
 

Compiler output:
a.cc: In function 'int main()':
a.cc:20:92: error: expected primary-expression before ')' token
   20 |   else if ( S == "AKIHA" || S == "KIHAB" || S == "IHABA" || S == "HABAR" || S == "ABARA" ||){
      |                                                                                            ^
a.cc:26:67: error: expected primary-expression before ')' token
   26 |   else if ( S == "AKIHABA" || S == "KIHABAR" || S == "IHABARA" || ){
      |                                                                   ^
Language: C++

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

// types
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

ll dp[2][102];

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	string s;
  cin>>s;
  string ans="AKIHABARA";
  
  ll cur1=0;
  ll n=ans.size();
  bool flag=true;
  REP(cur,n){
    if(cur1!= s.size() && s[cur1]==ans[cur]){
      cur1++;
      continue;
    }
    else{
      if(ans[cur]=='A')
        continue;
      else{
        flag=false;
        break;
      }
    }
  }
  
  if(pos!=s.size())
    flag=false;
         
  if(flag)
    cout<<"YES"<<endl;
  else
    cout<<"NO"<<endl;


}




Compiler output:
a.cc: In function 'int main()':
a.cc:65:6: error: 'pos' was not declared in this scope; did you mean 'pow'?
   65 |   if(pos!=s.size())
      |      ^~~
      |      pow
Language: C++

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

string s,t;

int main(){
t="AKIHABARA";
cin>>s;
  int n=s.size();
int ind=0;
for(char c:t){
  if(ind==n||s[ind]!=c){

  if(c!='A'){
    cout << "NO"<<endl;
    retrun 0;
  }
  }else{
  ++ind;
  }
}
if(ind!=n){
cout<<"NO"<<endl;
return 0;
}
cout<<"YES"<<endl;
return 0;
}


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

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

string s,t;

int main(){
t="AKIHABARA";
cin>>s;
int ind=0;
for(char c:t){
  if(ind==n||s[ind]!=c){

  if(c!='A'){
    cout << "NO"<<endl;
    retrun 0;
  }
  }else{
  ++ind;
  }
}
if(ind!=n){
cout<<"NO"<<endl;
return 0;
}
cout<<"YES"<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: 'n' was not declared in this scope
   11 |   if(ind==n||s[ind]!=c){
      |           ^
a.cc:15:5: error: 'retrun' was not declared in this scope
   15 |     retrun 0;
      |     ^~~~~~
a.cc:21:9: error: 'n' was not declared in this scope; did you mean 'yn'?
   21 | if(ind!=n){
      |         ^
      |         yn
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define REP(i, d, n) for(int i=(d); i<(n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
using P = pair<int, int>;

int main() {

  string s;
  cin >> s;
  
  string akiba = "KIHBR";
  s = " " + s + " ";
  bool ok = true;
  int idx = 0;

  set<char> f;
  REP(i, 1, s.length()-1){
    if(s[i] != 'A'){
      if(s.find(s[i]) != s.end){
        ok = false;
      }
      f.insert(s[i]);
    }
	if(s[i-1] == s[i]){
	  ok = false;
      break;
    }
    else if(s[i-1]=='K' && s[i+1]=='I'){
	  ok = false;
      break;
    }
    else if(s[i-1]=='I' && s[i+1]=='H'){
	  ok = false;
      break;
    }
    if(s[i] == akiba[idx]){
	  idx++;
    }
  }
  if(ok && idx==5 && f.size()==5){
	cout << "YES" << endl;
  }
  else{
	cout << "NO" << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:23: error: invalid operands of types 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and '<unresolved overloaded function type>' to binary 'operator!='
   22 |       if(s.find(s[i]) != s.end){
      |          ~~~~~~~~~~~~ ^~ ~~~~~
      |                |           |
      |                |           <unresolved overloaded function type>
      |                std::__cxx11::basic_string<char>::size_type {aka long unsigned int}
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

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

    string x = "AKIHABARA";
    ll j = 0;
    rep(i, 9) {
        if(x[i] == s[j]) {
            j++;
        }
        else if(x[i] == 'A') {
            ;
        }
        else {
            out("NO");
            re0;
        }
    }

    if(j == s.size()) {
        out("YES");
    }
    else {
        out("NO"):
    }
    
    re0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:18: error: expected ';' before ':' token
   56 |         out("NO"):
      |                  ^
Language: C++

//packages
#include <bits/stdc++.h>//C++14 GCC mode!!!
//alias and namespaces
using namespace std;
//macros
#define REP(i,O,N) for(int i=O;i<N;i++)//うーん、python同様にRange関数でも実装してしまおうかしら…？
#define rep(i,N) for(int i=0;i<N;i++)
#define all(v) v.begin(),v.end()//v.end()-i は[-i]相当
#define debug(x) cerr<< #x <<":"<<x<<endl;
#define v(type) std::vector<type>
#define v2(type)  std::vector<std::vector<type>>
#define v3(type)  std::vector<std::vector<std::vector<type>>>
//functions   



//solution

int main(void){
    //input
    string S;
    cin >>S;
    string check="KIHBR";
    int ans=1;
    int cnt = 0;
    int j = 0;
    rep(i,S.size()){
        if (S[i]=='A'){
            cnt+=1;
            if (cnt>1){
                ans=0;
                break;
            }
        }
        else{
            cnt = 0;
            if (S[i]!=check[j]){
                ans = 0;
                break;
            }
            else{
                j++;
            }
        }
    
    }
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:46:6: error: expected '}' at end of input
   46 |     }
      |      ^
a.cc:19:15: note: to match this '{'
   19 | int main(void){
      |               ^
Language: C++

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

int main(){
    string s;
    cin >> s;
    if (s == "AKIHABARA") cout << "YES" << endl;
    else if (s == "AKIHABAR") cout << "YES" << endl;
    else if (s == "AKIHABRA") cout << "YES" << endl;
    else if (s == "AKIHBARA") cout << "YES" << endl;
    else if (s == "KIHABARA") cout << "YES" << endl;
    else if (s == "AKIHABR") cout << "YES" << endl;
    else if (s == "AKIHBAR") cout << "YES" << endl;
    else if (s == "KIHABAR") cout << "YES" << endl;
    else if (s == "AKIHBRA") cout << "YES" << endl;
    else if (s == "KIHBARA") cout << "YES" << endl;
    else if (s == "KIHABRA") cout << "YES" << endl;
    else if (s == "AKIHBR") cout << "YES" << endl;
    else if (s == "KIHABR") cout << "YES" << endl;
    else if (s == "KIHBAR") cout << "YES" << endl;
    else if (s == "KIHBRA") cout << "YES" << endl;
    else if (s == "KIHBR") cout << "YES" << endl;
    else if cout << "NO" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:13: error: expected '(' before 'cout'
   24 |     else if cout << "NO" << endl;
      |             ^~~~
      |             (
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数

//-------------------------------------------------
//コピペするとこ



//-------------------------------------------------


int main()
{
  string s ;
  cin >> s ;
  string t = "KIHBR" ;
  int n = SZ(s) ;
  
  REP(i,n){
    int cnt = 0 ;
    if(s.at(i)=='A'){
      cnt++; 
    }
  }
  if(cnt>=4){
    cout <<"NO"<<endl ;
    return 0 ;
  }
  
  int i = 0 ;
  while(true){
    
    if(i==s.size()){
      break ;
    }
    
    if(s.at(i)=='A'){
      s.erase(s.begin() + i) ;
      i = 0 ;
    }
    
    i++ ;

  }
  
  if(s==t){
    cout <<"YES"<<endl ;
  }
  else{
    cout <<"NO"<<endl ;
  }

  return 0 ;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:49:6: error: 'cnt' was not declared in this scope; did you mean 'int'?
   49 |   if(cnt>=4){
      |      ^~~
      |      int
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数

//-------------------------------------------------
//コピペするとこ



//-------------------------------------------------


int main()
{
  string s ;
  cin >> s ;
  string t = "KIHBR" ;
  int n = SZ(s) ;
  
  REP(i,n){
    if(s.at(i)=='A'){
      erase(s.begin() + i) ;
    }
  }
  
  if(s==t){
    cout <<"Yes"<<endl ;
  }
  else{
    cout <<"No"<<endl ;
  }

  return 0 ;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:45:7: error: 'erase' was not declared in this scope
   45 |       erase(s.begin() + i) ;
      |       ^~~~~
Language: C++

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

int main() {
	string akb = "KIHBR";
	int index = 0;
	string buff;
	bool success = false;
	bool beforeA = false;
	getline(cin, buff);
	for (int i = 0; i < buff.length(); ++i) {
		for (int i2 = 0; i + i2 < buff.length(); ++i2) {
			if (buff[i + i2] == akb[index]) {
				beforeA = false;
				++index;
				if (index >= akb.length()) {
					if (buff.legth() - 1 - (i + i2) > 1) {
						break;
					}
					else if (buff.length() - 1 - (i + i2) == 1) {
						if (buff[i + i2 + 1] != 'A') {
							break;
						}
					}
					success = true;
					goto endLoop;
				}
			}
			else if (buff[i + i2] == 'A') {
				if (beforeA) {
					beforeA = false;
					break;
				}
				else {
					switch (index) {
					case 0:
					case 3:
					case 4:
					case 5:
						beforeA = true;
						break;
					default:
						beforeA = false;
						goto endLoop2;
						break;
					}
				}
			}
			else {
				beforeA = false;
				break;
			}
		}
	endLoop2:
		index = 0;
	}
endLoop:
	cout << (success ? "YES" : "NO") << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:50: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'legth'; did you mean 'length'?
   18 |                                         if (buff.legth() - 1 - (i + i2) > 1) {
      |                                                  ^~~~~
      |                                                  length
Language: C++

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

int main() {
	string akb = "KIHBR";
	int index = 0;
	string buff;
	bool success = false;
	bool beforeA = false;
	getline(cin, buff);
	for (int i = 0; i < buff.length(); ++i) {
		for (int i2 = 0; i + i2 < buff.length(); ++i2) {
			if (buff[i + i2] == akb[index]) {
				beforeA = false;
				++index;
				if (index >= akb.length()) {
					if (buff.legth() - 1 - (i + i2) > 1) {
						break;
					}
					else if (buff.legth() - 1 - (i + i2) == 1) {
						if (buff[i + i2 + 1] != 'A') {
							break;
						}
					}
					success = true;
					goto endLoop;
				}
			}
			else if (buff[i + i2] == 'A') {
				if (beforeA) {
					beforeA = false;
					break;
				}
				else {
					switch (index) {
					case 0:
					case 3:
					case 4:
					case 5:
						beforeA = true;
						break;
					default:
						beforeA = false;
						goto endLoop2;
						break;
					}
				}
			}
			else {
				beforeA = false;
				break;
			}
		}
	endLoop2:
		index = 0;
	}
endLoop:
	cout << (success ? "YES" : "NO") << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:50: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'legth'; did you mean 'length'?
   18 |                                         if (buff.legth() - 1 - (i + i2) > 1) {
      |                                                  ^~~~~
      |                                                  length
a.cc:21:55: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'legth'; did you mean 'length'?
   21 |                                         else if (buff.legth() - 1 - (i + i2) == 1) {
      |                                                       ^~~~~
      |                                                       length
Language: C++

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

int main() {
	string akb = "KIHABR";
	int index = 0;
	string buff;
	bool success = false;
	getline(cin, buff);
	for (int i = 0; i < buff.length(); ++i) {
		for (int i2 = 0; i + i2 < buff.length(); ++i2) {
			if (buff[i + i2] == akb[index]) {
				++index;
				if (index == akb.length()) {
					success = true;
					goto endLoop;
				}
			}
			if else(buff[i + i2] == 'A') {

			}
			else {
				break;
			}
		}
	}
	endLoop:
	cout << (success ? "YES" : "NO") << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:28: error: expected '(' before 'else'
   20 |                         if else(buff[i + i2] == 'A') {
      |                            ^~~~
      |                            (
a.cc:23:25: error: 'else' without a previous 'if'
   23 |                         else {
      |                         ^~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
 
int main(){
  string akb = "KIHABR";
  int index = 0;
  string buff;
  bool success = false;
  getline(cin, buff);
  for(int i = 0; i < buff.length(); ++i){
    if(buff[i] == akb[index]){
      ++index;
      if(index > 6){
        success = true;
        break;
      }
    }
  }
  cout << success ? "YES" : "NO" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:34: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   20 |   cout << success ? "YES" : "NO" << endl;
      |                             ~~~~~^~~~~~~
Language: C++

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

int main(){
  string akb = "KIHABR";
  int index = 0;
  string buff;
  bool success = false;
  getline(cin, buff);
  for(int i = 0; i < buff.length(); ++i){
    if(buff[i] == akb[index]){
      ++index;
      if(index > 6){
        success = true;
        break;
      }
    }
  }
  cout << success ? "YES" : "NO" << endl;
}

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #iinclude; did you mean #include?
    2 | #iinclude<string>
      |  ^~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:20:34: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   20 |   cout << success ? "YES" : "NO" << endl;
      |                             ~~~~~^~~~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main() {
  string s = ""; cin >> s;
  string a = "AKIHABARA";
  if (s.size() > 10) {
    cour << "NO" << endl;
    return 0;
  }
  for (int i=0; i<10; i++) {
    if (i == 9 && s,size() == 9) break;
    if (s.at(i) != a.at(i)) {
      if (a.at(i) == 'A') {
        s.insert(i, "A");
      } else {
        cout << "NO" << endl;
      }
    }
  }
  cout << "YES" << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'cour' was not declared in this scope
   10 |     cour << "NO" << endl;
      |     ^~~~
a.cc:14:16: error: no match for 'operator&&' (operand types are 'bool' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   14 |     if (i == 9 && s,size() == 9) break;
      |         ~~~~~~ ^~ ~
      |           |       |
      |           bool    std::string {aka std::__cxx11::basic_string<char>}
a.cc:14:16: note: candidate: 'operator&&(bool, bool)' (built-in)
   14 |     if (i == 9 && s,size() == 9) break;
      |         ~~~~~~~^~~~
a.cc:14:16: note:   no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
a.cc:14:25: error: no matching function for call to 'size()'
   14 |     if (i == 9 && s,size() == 9) break;
      |                     ~~~~^~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:262:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:272:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note:   candidate expects 1 argument, 0 provided
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    String key = "AKIHABARA";
    int s = 0;
    int k = 0;
    boolean ans = true;
    while (k < key.length()) {
      if( s >= s.length()
         || (S.charAt(s) != key.charAt(k))) {
        if (key.charAt(k) != 'A') {
          ans = false;
          break;
        }
      } else {
        s++;
      }
      k++;
    }
    System.out.println(ans ? "YES" : "NO");
  }
}

Compiler output:
Main.java:12: error: int cannot be dereferenced
      if( s >= s.length()
                ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
string a,yl="AKIHABARA";
int now,k;
int main()
{
    cin>>a;
    for(int s=0;s<a.size();s++)
    {
        if(a[s]==yl[now])//匹配成功
        {
            now++;
        }
        else//匹配不成功
        {
            if(s>0)
            if(a[s]==a[s-1])//连续两个一样
            {
                cout<<"NO"<<endl;
                exit(0);
            }
            if(yl[now]=='A')now++,s--;//是A，pass
            else//不是A，输出NO
            {
                cout<<"NO"<<endl;
                exit(0);
            }
        }
    }
    k=a.size();//最后，查错
    for(int s=0;s<a.size();s++)
    {
        if(a[s]=='A')k--;
    }
    if(k==5)
    cout<<"YES"<<endl;
    else
    cout<<"NO"<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:38:22: error: expected '}' at end of input
   38 |     cout<<"NO"<<endl;
      |                      ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include <stdio.h>
#include <algorithm>
#include <vector>
#define MIN(a, b) ((a)>(b)? (b): (a))
using namespace std;

int main(int argc, char* argv[])
{
    char str[55]={0};
    scanf("%s", str);
    int n=strlen(str);

    int  cnt0[6]={1,0,0,1,1,1};
    int  cnt[55]={0};
    char str2[55]={0};
    int curr=0;
    int i;
    for(i=0; i<n; i++) {
        if(str[i]=='A') {
            cnt[curr]++;
        }
        else {
            str2[curr]=str[i];
            curr++;
        }
    }
    if(curr==5 && strcmp(str2, "KIHBR")==0) {
        for(i=0; i<6; i++) {
            if(cnt[i]>cnt0[i]) {
                printf("NO\n"); return 0;
            }
        }
        printf("YES\n"); return 0;
    }
    printf("NO\n");

    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:11:11: error: 'strlen' was not declared in this scope
   11 |     int n=strlen(str);
      |           ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <vector>
  +++ |+#include <cstring>
    4 | #define MIN(a, b) ((a)>(b)? (b): (a))
a.cc:27:19: error: 'strcmp' was not declared in this scope
   27 |     if(curr==5 && strcmp(str2, "KIHBR")==0) {
      |                   ^~~~~~
a.cc:27:19: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<cstdio>
#include<algorithm>
using namespace std;
const int N=5002;
typedef long long ll;
struct cy{
	int H,P;
}a[N];
int n,i,j;
ll f[N];
int Min(int x,int y){
	return x<y?x:y;
}
bool cmp(cy x,cy y){
	return Min(x.H,y.H-x.P)>Min(y.H,x.H-y.P);
}
void init(){
	scanf("%d",&n);
	for(i=1;i<=n;i++)
		scanf("%d%d",&a[i].H,&a[i].P);
	sort(a+1,a+n+1,cmp);
}
void work(){
	memset(f,0x3f,sizeof(f));
	f[0]=0;
	for(i=1;i<=n;i++){
		for(j=N-2;j>=0;j--)
			if(f[j]<=a[i].H)
				f[j+1]=min(f[j+1],f[j]+a[i].P);
	}
	for(i=N-1;i>=0;i--)
		if(f[i]<1ll<<50){
			printf("%d\n",i);
			return;
		}
}
int main(){
	init();
	work();
	return 0;
}

Compiler output:
a.cc: In function 'void work()':
a.cc:24:9: error: 'memset' was not declared in this scope
   24 |         memset(f,0x3f,sizeof(f));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<algorithm>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin>>s;
  map<char,bool> mp;
  int count=0;
  for(int i=0;i<s.size();i++)if(s.at(i)=='A')count++;mp[s.at(i)]=true;
  if(count<5mp['K']&&mp['I']&&mp['H']&&mp['B']&&mp['R'])cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:62: error: 'i' was not declared in this scope
    8 |   for(int i=0;i<s.size();i++)if(s.at(i)=='A')count++;mp[s.at(i)]=true;
      |                                                              ^
a.cc:9:12: error: unable to find numeric literal operator 'operator""mp'
    9 |   if(count<5mp['K']&&mp['I']&&mp['H']&&mp['B']&&mp['R'])cout<<"YES"<<endl;
      |            ^~~