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

#include <iostream>
#include <string>
using namespace std;
int main() {
	int a,b,i,x=0,y=0,f=0;
	string s;
	cin >> a >> b >> s;
	for(i=0;i<s.size();i++) {
		if(a[i]=='-')
			f=1;
		else if(f==0)
			x++;
		else
			y++;
	}
	if(x==a && y==b)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: invalid types 'int[int]' for array subscript
    9 |                 if(a[i]=='-')
      |                     ^
Language: C++

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

int main() {
  int A, B, S;
  cin >> A >> B >> S;
  for (int i = 0; i < A; i++) {
    if (!('0' <= S[i] && S[i] <= '9')) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (S[A] != '-') {
    cout << "No" << endl;
    return 0;
  }
  for (int i = A + 1; i < A + B + 1; i++) {
    if (!('0' <= S[i] && S[i] <= '9')) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: invalid types 'int[int]' for array subscript
    8 |     if (!('0' <= S[i] && S[i] <= '9')) {
      |                   ^
a.cc:8:27: error: invalid types 'int[int]' for array subscript
    8 |     if (!('0' <= S[i] && S[i] <= '9')) {
      |                           ^
a.cc:13:8: error: invalid types 'int[int]' for array subscript
   13 |   if (S[A] != '-') {
      |        ^
a.cc:18:19: error: invalid types 'int[int]' for array subscript
   18 |     if (!('0' <= S[i] && S[i] <= '9')) {
      |                   ^
a.cc:18:27: error: invalid types 'int[int]' for array subscript
   18 |     if (!('0' <= S[i] && S[i] <= '9')) {
      |                           ^
Language: C++

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

int main(){
int A,B;
  cin>>A>>B;
  char S(11);
  cin>>S;
  
for(int i=0; i<A; i++){
 if(!('0'<=S[i] && S[i]<='9')){cout<<"No"<<endl;}
}
if(!(S[A]=='-')){cout<<"No"<<endl;}
for(int i=A+1; i<=A+B; i++){
 if(!('0'<=S[i] && S[i]<='9')){cout<<"No"<<endl;}
}  
cout<<"Yes"<<endl;  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: invalid types 'char[int]' for array subscript
   11 |  if(!('0'<=S[i] && S[i]<='9')){cout<<"No"<<endl;}
      |             ^
a.cc:11:21: error: invalid types 'char[int]' for array subscript
   11 |  if(!('0'<=S[i] && S[i]<='9')){cout<<"No"<<endl;}
      |                     ^
a.cc:13:7: error: invalid types 'char[int]' for array subscript
   13 | if(!(S[A]=='-')){cout<<"No"<<endl;}
      |       ^
a.cc:15:13: error: invalid types 'char[int]' for array subscript
   15 |  if(!('0'<=S[i] && S[i]<='9')){cout<<"No"<<endl;}
      |             ^
a.cc:15:21: error: invalid types 'char[int]' for array subscript
   15 |  if(!('0'<=S[i] && S[i]<='9')){cout<<"No"<<endl;}
      |                     ^
Language: C++

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

int main(){
    int a,b;
    scanf("%d %d",&a,&b);
    char s[a+b+5];
    scanf("%s",s);
    for (int i=0;i<(a+b+1);i++) {
        printf("%d\n",i);
        if (i==a && isdigit(s[i])) {
        printf("%d\n",i);
            printf("No\n");
            return 0;
        } else if (i!=a && ZZisdigit(s[i])==false) {
            printf("No\n");
            return 0;
        }
    }
    printf("Yes\n");
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:28: error: 'ZZisdigit' was not declared in this scope; did you mean 'isdigit'?
   15 |         } else if (i!=a && ZZisdigit(s[i])==false) {
      |                            ^~~~~~~~~
      |                            isdigit
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
#define SIZE_OF_ARRAY(a) (sizeof(a)/sizeof(a[0]))



int main(){
    //int ans;
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    int M;
    cin >> M;
    string S;
    cin >> S;
    int a[N];
    int b[M];
    for(int i = 0;i < N;i++){
    a[i] = S.at(i) - 48;
   // cout << a[i] << endl;
    }
    char C;
    C = S.at(N);
    //cout << C << endl;
    for(int i = 0;i < M;i++){
        b[i] = S.at(N + 1 + i) - 48;
      //  cout << b[i] << endl;
    }
    string ans = "No";
    if(C != '-' || a[i] < 0 || b[i] < 0)
        goto solve;
    for(int i = 0;i < N;i++){
        if(a[i] - 10 <= 0){
            ans = "Yes";
        }else{
            ans = "No";
            goto solve;
        }
    }
    for(int i = 0;i < M;i++){
        if(b[i] - 10 <= 0){
            ans = "Yes";
        }else{
            ans = "No";
            goto solve;
        }
    }
    solve :
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:22: error: 'i' was not declared in this scope
   52 |     if(C != '-' || a[i] < 0 || b[i] < 0)
      |                      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
main() {
	int a, b;
	cin >> a >> b;
	string s;
	cin >> s;
	bool flg = 1;
	if (s[a] == '-') {
		s.erase(a.begin() + a);
		rep(i, a + b) {
			if (!isdigit(s[i])) {
				flg = 0;
				break;
			}
		}

	}
	else {
		flg = 0;
	}
	if (flg) {
		cout << "Yes";

	}
	else {
		cout << "No";
	}

}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:11:27: error: request for member 'begin' in 'a', which is of non-class type 'int'
   11 |                 s.erase(a.begin() + a);
      |                           ^~~~~
Language: C++

#include<cstdio>
using namespace std;
int main(){
  int a, b; scanf("%d%d",&a,&b);
  char s[a+b+1]; scanf("%s", &s)
  for(int i = 0; i < a; i++){
    if(!('0' <= s[i] && s[i] <= '9')) puts("No");
  }

  if(s[a] != '-') puts("No");
  for(int j = a+1; j <= a+b; j++) if(!('0' <= s[j] && s[j] <= '9'))
  {
    puts("No");
  }
  puts("Yes");  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:33: error: expected ';' before 'for'
    5 |   char s[a+b+1]; scanf("%s", &s)
      |                                 ^
      |                                 ;
    6 |   for(int i = 0; i < a; i++){
      |   ~~~                            
a.cc:6:18: error: 'i' was not declared in this scope
    6 |   for(int i = 0; i < a; i++){
      |                  ^
Language: C++

#include<cstdio>
using namespace std;
int main(){
  int a, b; cin >> a >> b;
  char s[a+b+1]; cin >> s;
  for(int i = 0; i < a; i++){
    if(!('0' <= s[i] && s[i] <= '9')) cout << "No" << endl;
  }

  if(s[a] != '-') cout << "No" << endl;
  for(int j = a+1; j <= a+b; j++) if(!('0' <= s[j] && s[j] <= '9'))
  {
    cout << "No" << endl;
  }
  cout << "Yes" << endl;  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:13: error: 'cin' was not declared in this scope
    4 |   int a, b; cin >> a >> b;
      |             ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<cstdio>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:7:39: error: 'cout' was not declared in this scope
    7 |     if(!('0' <= s[i] && s[i] <= '9')) cout << "No" << endl;
      |                                       ^~~~
a.cc:7:39: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:7:55: error: 'endl' was not declared in this scope
    7 |     if(!('0' <= s[i] && s[i] <= '9')) cout << "No" << endl;
      |                                                       ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<cstdio>
  +++ |+#include <ostream>
    2 | using namespace std;
a.cc:10:19: error: 'cout' was not declared in this scope
   10 |   if(s[a] != '-') cout << "No" << endl;
      |                   ^~~~
a.cc:10:19: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:35: error: 'endl' was not declared in this scope
   10 |   if(s[a] != '-') cout << "No" << endl;
      |                                   ^~~~
a.cc:10:35: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:13:5: error: 'cout' was not declared in this scope
   13 |     cout << "No" << endl;
      |     ^~~~
a.cc:13:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:21: error: 'endl' was not declared in this scope
   13 |     cout << "No" << endl;
      |                     ^~~~
a.cc:13:21: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:15:3: error: 'cout' was not declared in this scope
   15 |   cout << "Yes" << endl;
      |   ^~~~
a.cc:15:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:20: error: 'endl' was not declared in this scope
   15 |   cout << "Yes" << endl;
      |                    ^~~~
a.cc:15:20: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a, b; cin >> a >> b;
  char s[a+b+1]; cin >> s;
  for(int i = 0; i < a; i++){
    if(!('0' <= s[i] && s[i] <= '9')) cout << "No" << endl;
  }

  if(s[a] != '-') cout << "No" << endl;
  for(int j = a+1; j <= a+b; j++){
    if(!('0' <= s[j] && s[j] <= '9')) cout << "No" << endl;
  }
  else {
    cout << "Yes" << endl;
  }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'else' without a previous 'if'
   14 |   else {
      |   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a, b; cin >> a >> b;
  char s[a+b+1]; cin >> s;
  for(int i = 0; i < a; i++){
    if(!('0' <= s[i] && s[i] <= '9')) cout << "No" << endl;
  }

  if(s[a] != '-') cout << "No" << endl;
  for(int j = a+1; j <= a+b; j++){
    if(!('0' <= s[j] && s[j] <= '9')) cout << "No" << endl;
  }
  else if cout << "Yes" << endl;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'else' without a previous 'if'
   14 |   else if cout << "Yes" << endl;
      |   ^~~~
a.cc:14:11: error: expected '(' before 'cout'
   14 |   else if cout << "Yes" << endl;
      |           ^~~~
      |           (
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a, b; cin >> a >> b;
  char s[a+b+1]; cin >> s;
  for(int i = 0; i < a; i++){
    if(!('0' <= s[i] && s[i] <= '9')) cout << "No" << endl;
  }

  if(s[a] != '-') cout << "No" << endl;
  for(int j = a+1; j <= a+b; j++){
    if(!('0' <= s[j] && s[j] <= '9')) cout << "No" << endl;
  }
  else cout << "Yes" << endl;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'else' without a previous 'if'
   14 |   else cout << "Yes" << endl;
      |   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a, b; cin >> a >> b;
  char s[12]; cin >> s;
  for(int i = 0; i < a; i++){
    if(!('0' <= s[i] && s[i] <= '9')) cout << "No" << endl;

    if(s[a] != '-') cout << "No" << endl;
    for(int j = a+1; j <= a+b; j++){
      if(!('0' <= s[j] && s[j] <= '9')) cout << "No" << endl;
      else cout << "Yes" << endl;
      }
    }
  }
}

Compiler output:
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a, b; cin >> a >> b;
  char s[12]; cin >> s;
  for(int i = 0; i < a; i++){
    if(!('0' <= s[i] && s[i] <= '9')) cout << "No" << endl;

    if(s[a] != '-') cout << "No" << endl;
    for(int j = a+1; j <= a+b; j++){
      if(!('0' <= s[j] && s[j] <= '9')) cout << "No" << endl;
      else cout << "Yes" << endl;
        }
      }
    }
  }
}

Compiler output:
a.cc:16:3: error: expected declaration before '}' token
   16 |   }
      |   ^
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a, b; cin >> a >> b;
  char s; cin >> s;
  for(int i = 0; i < a; ++i){
    if(!('0' <= s[i] && s[i] <= '9')) cout << "No" << endl;
    else {
      if(s[a] != '-') cout << "No" << endl;
      else {
        for(int j = a+1; j <= a+b; j++){
            if(!('0' <= s[j] && s[j] <= '9')) cout << "No" << endl;
            else cout << "Yes" << endl;
        }
      }
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: invalid types 'char[int]' for array subscript
    7 |     if(!('0' <= s[i] && s[i] <= '9')) cout << "No" << endl;
      |                  ^
a.cc:7:26: error: invalid types 'char[int]' for array subscript
    7 |     if(!('0' <= s[i] && s[i] <= '9')) cout << "No" << endl;
      |                          ^
a.cc:9:11: error: invalid types 'char[int]' for array subscript
    9 |       if(s[a] != '-') cout << "No" << endl;
      |           ^
a.cc:12:26: error: invalid types 'char[int]' for array subscript
   12 |             if(!('0' <= s[j] && s[j] <= '9')) cout << "No" << endl;
      |                          ^
a.cc:12:34: error: invalid types 'char[int]' for array subscript
   12 |             if(!('0' <= s[j] && s[j] <= '9')) cout << "No" << endl;
      |                                  ^
Language: C++

#include <algorithm>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
#define fst first
#define snd second

/* clang-format off */
template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; };
template <class T> struct _vec<T, 0> { using type = T; };
template <class T, size_t D> using vec = typename _vec<T, D>::type;
template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); }
template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); }
/* clang-format on */

int main() {
  int A, B;
  string S;
  while (cin >> A >> B >> S) {
    bool ok = true;
    for (int i = 0; i < A; i++) ok &= !!isnumber(S[i]);
    ok &= S[A] == '-';
    for (int i = 0; i < B; i++) ok &= !!isnumber(S[A + i + 1]);
    cout << (ok ? "Yes" : "No") << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:41: error: 'isnumber' was not declared in this scope
   31 |     for (int i = 0; i < A; i++) ok &= !!isnumber(S[i]);
      |                                         ^~~~~~~~
a.cc:33:41: error: 'isnumber' was not declared in this scope
   33 |     for (int i = 0; i < B; i++) ok &= !!isnumber(S[A + i + 1]);
      |                                         ^~~~~~~~
Language: C++

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

int main(){
  int a,b;
  cin >> a>>b;
  string s;
  cin >>s;
  if(s.size() != a+b+1){
    cout <<"No" << endl;
    return 0;
  }
  for(int i=0;i < a;i++){
    if(s.at(i) == '-'){
      cout << "No" << endl;
      cout<<i<<endl;
      return 0;
    }
  }
  for(int i=a+1;i < a+b+1;i++){
    if(s.at(i) == '-'){
      cout << "No" << endl;
      cout<<i<<endl;
      return 0;
    }
  }
  if(s.at(a) !='-'){
     cout << "No" << endl;
      cout<<i<<endl;
      return 0;
    }
  cout << "Yes" << endl;
}

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

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

bool solve{
  int a, b;
  cin >> a >> b;
  string s;
  cin >> s;
  if(s.size() != a + b + 1){
    return false;
  }
  for(int i = 0 ; i < s.size() ; i++){
    if(i == a && s[i] != '-'){
      return false;
    }else if(s[i] < '0' || '9' < s[i]){
      return false;
    }
  }
  return true;
}

int main(){
  if(solve()){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}

Compiler output:
a.cc:5:3: error: expected primary-expression before 'int'
    5 |   int a, b;
      |   ^~~
a.cc:5:3: error: expected '}' before 'int'
a.cc:4:11: note: to match this '{'
    4 | bool solve{
      |           ^
a.cc:6:3: error: 'cin' does not name a type
    6 |   cin >> a >> b;
      |   ^~~
a.cc:8:3: error: 'cin' does not name a type
    8 |   cin >> s;
      |   ^~~
a.cc:9:3: error: expected unqualified-id before 'if'
    9 |   if(s.size() != a + b + 1){
      |   ^~
a.cc:12:3: error: expected unqualified-id before 'for'
   12 |   for(int i = 0 ; i < s.size() ; i++){
      |   ^~~
a.cc:12:19: error: 'i' does not name a type
   12 |   for(int i = 0 ; i < s.size() ; i++){
      |                   ^
a.cc:12:34: error: 'i' does not name a type
   12 |   for(int i = 0 ; i < s.size() ; i++){
      |                                  ^
a.cc:19:3: error: expected unqualified-id before 'return'
   19 |   return true;
      |   ^~~~~~
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
a.cc: In function 'int main()':
a.cc:23:11: error: 'solve' cannot be used as a function
   23 |   if(solve()){
      |      ~~~~~^~
Language: C++

#include <bits/stdc++.h>
#define ll long long
void no(){cout<<"No"<<endl;exit(0);}
void yes(){cout<<"Yes"<<endl;exit(0);}
using namespace std;
int main()
{
    int a,b;
    string s;
    cin>>a>>b;
    cin>>s;
    bool flag=true;
    for(int i=0;i<a+b+1;i++){
        if(i!=a){
        if(s[i]=='-')
        flag=false;
        }
    }
    if(s[a]!='-') flag=false;
    if(flag==true) yes();
    else no();
}

Compiler output:
a.cc: In function 'void no()':
a.cc:3:11: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    3 | void no(){cout<<"No"<<endl;exit(0);}
      |           ^~~~
      |           std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:3:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    3 | void no(){cout<<"No"<<endl;exit(0);}
      |                       ^~~~
      |                       std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc: In function 'void yes()':
a.cc:4:12: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    4 | void yes(){cout<<"Yes"<<endl;exit(0);}
      |            ^~~~
      |            std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:4:25: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    4 | void yes(){cout<<"Yes"<<endl;exit(0);}
      |                         ^~~~
      |                         std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
void no(){cout<<"No"<<endl;}
void yes(){cout<<"Yes"<<endl;}
using namespace std;
int main()
{
    int a,b;
    string s;
    cin>>a>>b;
    cin>>s;
    bool flag=true;
    for(int i=0;i<a+b+1;i++){
        if(i!=a){
        if(s[i]=='-')
        flag=false;
        }
    }
    if(s[a]!='-') flag=false;
    if(flag==true) yes();
    else no();

Compiler output:
a.cc: In function 'void no()':
a.cc:3:11: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    3 | void no(){cout<<"No"<<endl;}
      |           ^~~~
      |           std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:3:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    3 | void no(){cout<<"No"<<endl;}
      |                       ^~~~
      |                       std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc: In function 'void yes()':
a.cc:4:12: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    4 | void yes(){cout<<"Yes"<<endl;}
      |            ^~~~
      |            std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:4:25: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    4 | void yes(){cout<<"Yes"<<endl;}
      |                         ^~~~
      |                         std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc: In function 'int main()':
a.cc:21:15: error: expected '}' at end of input
   21 |     else no();
      |               ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <bits/stdc++.h>

int main(){
  int num1,num2;
  string str;
  std::cin >> num1 >> num2 >> str;
  for(int i = 0;i <num1 + num2;i++ ){
    if(i==num1){
      if(!(str[i]=='-')){std::cout << "No"<< '\n' ;return 0;}
    }
    else{
      if(!(str[i]>=0x30 && str[i]<=0x39)){std::cout << "No"<< '\n' ;return 0;}
    }
  }
  std::cout << "Yes" << '\n';
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string str;
      |   ^~~~~~
a.cc:5:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:31: error: 'str' was not declared in this scope; did you mean 'std'?
    6 |   std::cin >> num1 >> num2 >> str;
      |                               ^~~
      |                               std
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int A,B;
  bool ans = false;
  cin >> A>>B;
  string s;
  cin >> s;
  for(int i = 0;i<=A;i++){
    if(s.at(i) != '-'){
      cnt = false;
    }
    else{
      cnt = true;
      break;
    }
  }
  if(s.at(A+1) != '-'){
    cnt = true;
  }
  for(int i = A+2;i<=A+B+1;i++){
    if(s.at(i) == '-'){
      cnt = true;
      break;
    }
  }
  if(cnt == true){
    cout << "No" << endl;
  }
  else{
    cout << "Yes" << endl;
  }
  return 0;
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
   11 |       cnt = false;
      |       ^~~
      |       int
a.cc:14:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
   14 |       cnt = true;
      |       ^~~
      |       int
a.cc:19:5: error: 'cnt' was not declared in this scope; did you mean 'int'?
   19 |     cnt = true;
      |     ^~~
      |     int
a.cc:23:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
   23 |       cnt = true;
      |       ^~~
      |       int
a.cc:27:6: error: 'cnt' was not declared in this scope; did you mean 'int'?
   27 |   if(cnt == true){
      |      ^~~
      |      int
Language: C++

#include <iostream>

int main() {
    int A, B;
    std::cin >> A >> B;
    std::string S;
    std::cin >> S;

    bool cond1 = S[A] == '-';
    bool cond2 = std::all_of(S.begin(), S.begin() + A,
                             [](char c) { return std::isdigit(c); });
    bool cond3 = std::all_of(S.begin() + A + 1, S.end(),
                             [](char c) { return std::isdigit(c); });
    std::cout << (cond1 && cond2 && cond3 ? "Yes" : "No") << std::endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: 'all_of' is not a member of 'std'
   10 |     bool cond2 = std::all_of(S.begin(), S.begin() + A,
      |                       ^~~~~~
a.cc:12:23: error: 'all_of' is not a member of 'std'
   12 |     bool cond3 = std::all_of(S.begin() + A + 1, S.end(),
      |                       ^~~~~~
Language: C++

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

int main(){
  int a, b;
  bool ans = true;
  string s;
  cin >> a >> b >> s;
  for(int i = 0; i < a+b+1; i++){
    if(i == a){
      if(s[i] != '-') ans = false;
    }else{
      ans = false;
      for(char c = '0'; c <= '9'; c++){
        if(s[i] == c) ans = true;
      }
    }
    if(!ans) break;
  }
  if(ans) cout << "Yes" << endl;
  else cout << "No" << emdl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: 'emdl' was not declared in this scope
   22 |   else cout << "No" << emdl;
      |                        ^~~~
Language: C++

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

int main(){
  int a, b;
  bool ans = true;
  string s;
  cin >> a >> b >> s;
  for(int i = 0; i < a+b+1; i++){
    if(i == a){
      if(a[i] != '-') ans = false;
    }else{
      ans = false;
      for(char c = '0'; c <= '9'; c++){
        if(a[i] == c) ans = true;
      }
    }
    if(!ans) break;
  }
  if(ans) cout << "Yes" << endl;
  else cout << "No" << emdl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: invalid types 'int[int]' for array subscript
   12 |       if(a[i] != '-') ans = false;
      |           ^
a.cc:16:13: error: invalid types 'int[int]' for array subscript
   16 |         if(a[i] == c) ans = true;
      |             ^
a.cc:22:24: error: 'emdl' was not declared in this scope
   22 |   else cout << "No" << emdl;
      |                        ^~~~
Language: C++

# include <iostream>
using namespace std;

int main(){
	int a, b;
	string s;
  	cin >> a >> b >> s;
  
  	if(s.length() == a+b+1 && s[a+1] == '-'){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
}

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

import java.util.Scanner;
import java.util.regex.*;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner cd = new Scanner(System.in);
		int a = cd.nextInt();
		int b = cd.nextInt();
		String s = cd.next();
		if(s.matches("[0-9]{%d}-[0-9]{%d}",a,b)) {
			System.out.println("Yes");
		}else System.out.println("No");
	}

}


Compiler output:
Main.java:13: error: method matches in class String cannot be applied to given types;
		if(s.matches("[0-9]{%d}-[0-9]{%d}",a,b)) {
		    ^
  required: String
  found:    String,int,int
  reason: actual and formal argument lists differ in length
1 error
Language: C++

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

int main(void) {
  int a, b;
  string s;
  bool f = true;
  cin >> a >> b >> s;
  for (int i = 0; i < s.length(); ++i) {
    if (i < a or i > a) {
      if (s[i] >= '0' and s[i] <= '9') else f = false;
    }
    else if (i == a) {
      if (s[i] == '-') else f = false;
    }
  }
  cout << (f ? "Yes" : "No") << endl;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:11:40: error: expected primary-expression before 'else'
   11 |       if (s[i] >= '0' and s[i] <= '9') else f = false;
      |                                        ^~~~
a.cc:14:24: error: expected primary-expression before 'else'
   14 |       if (s[i] == '-') else f = false;
      |                        ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<math.h>
#include<cstdio>
#include<ctype.h>
#include<stdio.h>
#include<set>
#include<vector>
#include<map>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<numeric>
#include<string>
typedef long long ll;
using namespace std;

ll gcd(ll a, ll b){
if(a<b){return gcd(b,a);}
else if(a%b){return gcd(b,a%b);}
else{return b;}
}
int main(){
  ll A,B;
  cin>>A>>B;
  string S;
  cin>>S;
  ll a=0;
  for (int i = 0; i < S.size(); i++){
  if (S[i] == '1') {a++;}
  }
  if(a==1&&S[A]=='-')
  cout<<"Yes"<<endl;
  else
  cout<<"No"<<endl;
}

}


Compiler output:
a.cc:40:1: error: expected declaration before '}' token
   40 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define yes "Yes"
#define no "No"

string solve(int A, int B, string S) {
  bool answer = true;
  if ((A>=1) && (B<=5) && (S[A]=='-')) {
    for (int i=0; i<(A+B+1); i++) 
  	  if (!(('0'=<S[i]) && (S[i]=<'9')) && (i!=A))
  		answer &= false;
  } else
    answer = false;
  
  return (answer) ? yes : no;
}

int main() {
  int A, B;
  string S;
  cin >> A >> B >> S;
  cout << solve(A, B, S) << endl;
}


Compiler output:
a.cc: In function 'std::string solve(int, int, std::string)':
a.cc:10:22: error: expected primary-expression before '<' token
   10 |           if (!(('0'=<S[i]) && (S[i]=<'9')) && (i!=A))
      |                      ^
a.cc:10:38: error: expected primary-expression before '<' token
   10 |           if (!(('0'=<S[i]) && (S[i]=<'9')) && (i!=A))
      |                                      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define yes "Yes"
#define no "No"

string solve(int A, int B, string S) {
  bool answer = true;
  if ((A>=1) && (B<=5) && (S[A]=='-')) {
    for (int i=0; i<(A+B+1); i++) 
  	  if ((('0'>=S[i]) || (S[i]>='9')) && (i!=A))
  		answer &= false;
  } else
    answer = false;
  
  return (answer) ? yes : no;
}

int main() {
  int A, int B, string S;
  cin >> A >> B >> S;
  cout << solve(A, B, S) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:10: error: expected unqualified-id before 'int'
   19 |   int A, int B, string S;
      |          ^~~
a.cc:20:15: error: 'B' was not declared in this scope
   20 |   cin >> A >> B >> S;
      |               ^
a.cc:20:20: error: 'S' was not declared in this scope
   20 |   cin >> A >> B >> S;
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define yes "Yes"
#define no "No"

string solve(int A, int B, string S) {
  bool answer = true;
  if ((A>=1) && (B<=5) && (S[A]=='-')) {
    for (int i=0; i<(A+B+1); i++) 
  	  if (('0'>=S[i]) && (S[i]>='9') && (i!=A))
  		answer &= false;
  } else
    answer = false;
  
  return (answer) ? yes : no;
}

int main() {
  int A, int B, string S;
  cin >> A >> B >> S;
  cout << solve(A, B, S) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:10: error: expected unqualified-id before 'int'
   19 |   int A, int B, string S;
      |          ^~~
a.cc:20:15: error: 'B' was not declared in this scope
   20 |   cin >> A >> B >> S;
      |               ^
a.cc:20:20: error: 'S' was not declared in this scope
   20 |   cin >> A >> B >> S;
      |                    ^
Language: C++

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

int A, B;
string S;
#define yes "Yes"
#define no "No"

string solve() {
  bool answer = true;
  if ((1<=A) && (B<=5) && (S[A]=='-') && (sizeof(S)==(A+B+2)) {
    for (int i=0; i<(A+B+1); i++) 
  	  if (('0'>=S[i]) && (S[i]>='9') && (i!=A))
  		answer &= false;
  } else
    answer = false;
  
  return (answer) ? yes : no;
}

int main() {
  cin >> A >> B >> S;
  cout << solve() << endl;
}


Compiler output:
a.cc: In function 'std::string solve()':
a.cc:11:62: error: expected ';' before '{' token
   11 |   if ((1<=A) && (B<=5) && (S[A]=='-') && (sizeof(S)==(A+B+2)) {
      |                                                              ^~
      |                                                              ;
a.cc:15:5: error: expected primary-expression before 'else'
   15 |   } else
      |     ^~~~
a.cc:15:4: error: expected ')' before 'else'
   15 |   } else
      |    ^~~~~
      |    )
a.cc:11:6: note: to match this '('
   11 |   if ((1<=A) && (B<=5) && (S[A]=='-') && (sizeof(S)==(A+B+2)) {
      |      ^
Language: C++

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

int A, B;
string S;
#define yes "Yes"
#define no "No"

string solve() {
  bool answer = true;
  if ((1<=A) && (B<=5) && if (S[A] != '-')) {
    for (int i=0; i<(A+B+1); i++) 
  	  if (('0'>=S[i]) && (S[i]>='9') && (i!=A))
  		answer &= false;
  } else
    answer = false;
  
  return (answer) ? yes : no;
}

int main() {
  cin >> A >> B >> S;
  cout << solve() << endl;
}


Compiler output:
a.cc: In function 'std::string solve()':
a.cc:11:27: error: expected primary-expression before 'if'
   11 |   if ((1<=A) && (B<=5) && if (S[A] != '-')) {
      |                           ^~
a.cc:11:26: error: expected ')' before 'if'
   11 |   if ((1<=A) && (B<=5) && if (S[A] != '-')) {
      |      ~                   ^~~
      |                          )
Language: C++

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

int A, B;
string S;
#define yes "Yes"
#define no "No"

string solve() {
  bool answer = true;
  if ((1<=A) && (B<=5))
    for (int i=0; i<(A+B+1); i++);
  		if ((S[i] != '-') && (i==A) || ('0'>=S[i]) && (S[i]>='9') && (i!=A))
  			answer &= false;
  else
    answer = false;
  
  return (answer) ? yes : no;
}

int main() {
  cin >> A >> B >> S;
  cout << solve() << endl;
}


Compiler output:
a.cc: In function 'std::string solve()':
a.cc:13:24: error: 'i' was not declared in this scope
   13 |                 if ((S[i] != '-') && (i==A) || ('0'>=S[i]) && (S[i]>='9') && (i!=A))
      |                        ^
Language: C++

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

int A, B;
string S;
#define yes "Yes"
#define no "No"

string solve() {
  int i=0;
  bool answer = true;
  if ((1<=A) && (B<=5))
    for (i=0; i<(A+B+1); i++);
  		if ((S[i] != '-') && (i==A) && ('0'>=S[i]) && (S[i]>='9') && (i!=A))
  			zanswer &= false;
  return (answer) ? yes : no;
}

int main() {
  cin >> A >> B >> S;
  cout << solve() << endl;
}


Compiler output:
a.cc: In function 'std::string solve()':
a.cc:15:25: error: 'zanswer' was not declared in this scope; did you mean 'answer'?
   15 |                         zanswer &= false;
      |                         ^~~~~~~
      |                         answer
Language: C++

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

int A, B;
string S;
#define yes "Yes"
#define no "No"

string solve() {
  	int i, j=0;
    if ((S[A] == '-') && ( 1 <= A ) && ( B <= 5 ) && (sizeof(S) == (A+B+2)))
      for (i=0; (i<(A+B+1)) && ('0'<=S[i]) && (S[i]<='9'), i++);

  	return (j == (A+B+1)) ? yes : no;
}

int main() {
  cin >> A >> B >> S;
  cout << solve() << endl;
}



Compiler output:
a.cc: In function 'std::string solve()':
a.cc:12:63: error: expected ';' before ')' token
   12 |       for (i=0; (i<(A+B+1)) && ('0'<=S[i]) && (S[i]<='9'), i++);
      |                                                               ^
      |                                                               ;
Language: C++

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

int A, B;
string S;
#define yes "Yes"
#define no "No"

string solve() {
  	int i, j=0;
    if ((S[A] == '-') && ( 1 <= A ) && ( B <= 5 ) && (sizeof(S) == (A+B+2)))
      for (i=0; i<(A+B+1); j+= (int)(('0'<=S[i]) && (S[i]<='9')); i++);

  	return (j == (A+B+1)) ? yes : no;
}

int main() {
  cin >> A >> B >> S;
  cout << solve() << endl;
}



Compiler output:
a.cc: In function 'std::string solve()':
a.cc:12:65: error: expected ')' before ';' token
   12 |       for (i=0; i<(A+B+1); j+= (int)(('0'<=S[i]) && (S[i]<='9')); i++);
      |           ~                                                     ^
      |                                                                 )
a.cc:12:70: error: expected ';' before ')' token
   12 |       for (i=0; i<(A+B+1); j+= (int)(('0'<=S[i]) && (S[i]<='9')); i++);
      |                                                                      ^
      |                                                                      ;
Language: C++

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

int A, B;
string S;
#define yes "Yes"
#define no "No"

int check(char c) { return '0' <= c and c <= '9'; }

string solve() {
  	int j = 0
    if (S[A+1] == '-')
      if ( 1 <= A )
        if ( B <= 5)
          if (sizeof(S) == (A+B+2))
            for (int i=0; i<(A+B+2) && check(S[i]); i++)
              j++;

  	return (j == (A+B+1)) ? yes : no;
}

int main() {
  cin >> A >> B >> S;
  cout << solve() << endl;
  
  return 0;
}



Compiler output:
a.cc: In function 'std::string solve()':
a.cc:13:5: error: expected ',' or ';' before 'if'
   13 |     if (S[A+1] == '-')
      |     ^~
a.cc:17:27: error: 'i' was not declared in this scope
   17 |             for (int i=0; i<(A+B+2) && check(S[i]); i++)
      |                           ^
Language: C++

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

int A, B;
string S;
#define yes "Yes"
#define no "No"

int check(char c) { return '0' <= c and c <= '9'; }

string solve() {
  	int j = 0
    if (S[A+1] == '-')
      if ( 1 <= A )
        if ( B <= 5)
          for (int i=0; i<(A+B+2) && (sizeof(S) == (A+B+2)); i++)
  		  	if (check(S[i]))
              j++;

  	return (j == (A+B+1)) ? yes : no;
}

int main() {
  cin >> A >> B >> S;
  cout << solve() << endl;
  
  return 0;
}



Compiler output:
a.cc: In function 'std::string solve()':
a.cc:13:5: error: expected ',' or ';' before 'if'
   13 |     if (S[A+1] == '-')
      |     ^~
a.cc:16:25: error: 'i' was not declared in this scope
   16 |           for (int i=0; i<(A+B+2) && (sizeof(S) == (A+B+2)); i++)
      |                         ^
Language: C++

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

int A, B; string S;
#define yes "Yes"
#define no "No"

int check(char c) { return '0' <= c and c <= '9'; }

string solve() {
  	
    if (S[A] != '-')  
	  if (sizeof(S) == (A+B+1))
        if ( 1 <= A )
		  if ( B <= 5) {
            for (int i=0; i<(A+B+1); i++)
    	  	  if (check(S[i])) return yes;
      	  	  else no;
          }
  	return no;
}

void main() {
    cin >> A >> B >> S;
    cout << solve() << endl;
}



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

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

int A, B; string S;
#define yes "Yes"
#define no "No"

int check(char c) { return '0' <= c and c <= '9'; }

string solve() {
  	
    if (S[A] != '-')  
	  if (sizeof(S) == (A+B+1)) {
        if ( 1 <= A )
		  if ( B <= 5) {
            for (int i=0; i<(A+B+1); i++)
    	  	  if (check(S[i])) return yes;
      	  	  else no;
    }
  	return no;
}

void main() {
    cin >> A >> B >> S;
    cout << solve() << endl;
}



Compiler output:
a.cc: In function 'std::string solve()':
a.cc:23:13: error: a function-definition is not allowed here before '{' token
   23 | void main() {
      |             ^
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:10:16: note: to match this '{'
   10 | string solve() {
      |                ^
a.cc:26:2: warning: control reaches end of non-void function [-Wreturn-type]
   26 | }
      |  ^
Language: C++

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

int A, B; string S;
#define yes "Yes"
#define no "No"

int check(char c) { return '0' <= c and c <= '9'; }

string solve() {
  	
    if (S[A] != '-')  
	  if (sizeof(S) = (A+B+1)) {
        if ( 1 <= A )
		  if ( B <= 5) {
            for (int i=0; i<(A+B+1); i++)
    	  	  if (check(S[i])) return yes;
      	  	  else no;
    }
  	return no;
}

void main() {
    cin >> A >> B >> S;
    cout << solve() << endl;
}



Compiler output:
a.cc: In function 'std::string solve()':
a.cc:13:15: error: lvalue required as left operand of assignment
   13 |           if (sizeof(S) = (A+B+1)) {
      |               ^~~~~~~~~
a.cc:23:13: error: a function-definition is not allowed here before '{' token
   23 | void main() {
      |             ^
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:10:16: note: to match this '{'
   10 | string solve() {
      |                ^
a.cc:26:2: warning: control reaches end of non-void function [-Wreturn-type]
   26 | }
      |  ^
Language: C

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

int A, B; string S;
#define yes "Yes"
#define no "No"

int check(char c) { return '0' <= c and c <= '9'; }

string solve() {
  	
    if (S[A] != '-')  
	  if (sizeof(S) = (A+B+1)) {
        if ( 1 <= A )
		  if ( B <= 5) {
            for (int i=0; i<(A+B+1); i++)
    	  	  if (check(S[i])) return yes;
      	  	  else no;
    }
  	return no;
}

void main() {
    cin >> A >> B >> S;
    cout << solve() << endl;
}



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

int A, B; string S;
//---------------------------------------------------------------------------------------------------
#define yes "Yes"
#define no "No"
int check(char c) { return '0' <= c and c <= '9'; }
string solve() {
    rep(i, 0, A) if (!check(S[i])) return no;
    if (S[A] != '-') return no;
    rep(i, A + 1, A + B + 1) if (!check(S[i])) return no;
    return yes;
}
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> A >> B >> S;
    cout << solve() << endl;
}

Compiler output:
a.cc:1:11: error: 'string' does not name a type
    1 | int A, B; string S;
      |           ^~~~~~
a.cc:6:1: error: 'string' does not name a type
    6 | string solve() {
      | ^~~~~~
a.cc: In function 'void _main()':
a.cc:14:5: error: 'cin' was not declared in this scope
   14 |     cin >> A >> B >> S;
      |     ^~~
a.cc:14:22: error: 'S' was not declared in this scope
   14 |     cin >> A >> B >> S;
      |                      ^
a.cc:15:5: error: 'cout' was not declared in this scope
   15 |     cout << solve() << endl;
      |     ^~~~
a.cc:15:13: error: 'solve' was not declared in this scope
   15 |     cout << solve() << endl;
      |             ^~~~~
a.cc:15:24: error: 'endl' was not declared in this scope
   15 |     cout << solve() << endl;
      |                        ^~~~
Language: C++

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


int main()
{
  int a,b;
  string s;
  cin >> a >> b;
  cin >> s;
  int flag = 1;
  int left = 0;
  int right = -1;
  int count = 0;
  for(int i = 0;i < s.size();i++){
    if(s[i] == '-'){
      flag = 2;
      cout++;
    }
    if(flag == 1) left++;
    else if(flag == 2) right++;
  }

  if(left == a && right == b && count == 1) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   18 |       cout++;
      |       ~~~~^~
Language: C++

#include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#include <numeric>
#include <string>
using namespace std;
const double PI = acos(-1.0);
const string alp = "abcdefghijklmnopqrstuvwxyz";
const string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n+1)
#define SUM(c) accumulate((c).begin(),(c).end(),0)
#define UNIQ(c) (c).erase(unique((c).begin(), (c).end()), (c).end());
#define Yn(b) puts(b?"Yes":"No")
#define YN(b) puts(b?"YES":"NO")
 
bool isprime(int p) {
  if (p==1) return false;
  FOR(i,2,p) {
    if (p%i==0) return false;
  }
  return true;
}
 
int main(){
  int a,b;
  string s;
  cin >> a >> b >> s;
  REP(i,s.length()){
    if(i==a+1) {
      if (s[i]!="-") {
        puts("No");
        return 0;
      }
    } else {
      if (s[i]=="-") {
        puts("No");
        return 0;
      }
    }
  }
  puts("Yes");
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   35 |       if (s[i]!="-") {
a.cc:40:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   40 |       if (s[i]=="-") {
Language: C++

#include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#include <numeric>
#include <string>
using namespace std;
const double PI = acos(-1.0);
const string alp = "abcdefghijklmnopqrstuvwxyz";
const string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n+1)
#define SUM(c) accumulate((c).begin(),(c).end(),0)
#define UNIQ(c) (c).erase(unique((c).begin(), (c).end()), (c).end());
#define Yn(b) puts(b?"Yes":"No")
#define YN(b) puts(b?"YES":"NO")
 
bool isprime(int p) {
  if (p==1) return false;
  FOR(i,2,p) {
    if (p%i==0) return false;
  }
  return true;
}
 
int main(){
  int a,b:
  string s;
  cin >> a >> b >> s;
  REP(i,s.length()){
    if(i==a+1) {
      if (s[i]!="-") {
        puts("No");
        return 0;
      }
    } else {
      if (s[i]=="-") {
        puts("No");
        return 0;
      }
    }
  }
  puts("Yes");
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:10: error: found ':' in nested-name-specifier, expected '::'
   30 |   int a,b:
      |          ^
      |          ::
a.cc:30:9: error: 'b' has not been declared
   30 |   int a,b:
      |         ^
a.cc:31:10: error: qualified-id in declaration before 's'
   31 |   string s;
      |          ^
a.cc:32:15: error: 'b' was not declared in this scope
   32 |   cin >> a >> b >> s;
      |               ^
a.cc:32:20: error: 's' was not declared in this scope
   32 |   cin >> a >> b >> s;
      |                    ^
Language: C++

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

int main()
{
    int a, b;
    string s;
    string t = "No";
    cin >> a >> b >> s;
    rep(i,a){
        if(s[i]=='-')
            t = "No";
    }
    if(s[a]!='-')
        t = "No";
    forx(i, a + 1, a + b) 
    if (s[i] == '-')
        t = "No";
}
cout << t << endl;
return 0;
}


Compiler output:
a.cc:24:1: error: 'cout' does not name a type
   24 | cout << t << endl;
      | ^~~~
a.cc:25:1: error: expected unqualified-id before 'return'
   25 | return 0;
      | ^~~~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

#include<iostream>
#include <stdio.h>
#include<string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstdint>
#include <queue> 
#include <map>
#include <set>
#define MOD 1000000007
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
typedef long long ll;
using namespace std;

int main(){

  int a,b;
  cin >> a >> b;
  
  string s;
  cin >> s;

  REP(i,a+b+1){
    if(i == a){
      if(s[i] != '-'){
      cout << "No" << endl; return 0;
    }
    else if(s[i] < '0' || s[i] > '9'){
      cout << "No" << endl; return 0;
    }
  }
    
    cout << "Yes" << endl;
  
 return 0;
}

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