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

#include <iostream>
#include <string>
#include <string.h>
#include <cctype>
#include <algorithm>
using namespace std;

bool myStrcmp(string str, int range) {
	if (std::all_of(str.cbegin(), str.cend(), isdigit)) {
		return true;
	}
	return false;
}

int main()
{
	unsigned int A = 0, B = 0;
	cin >> A >> B;
	string str = {};
	cin >> str;
	if ( strcmp(&str[A], "-") && str.size() == A+B+1) {
		if (myStrcmp(str.substr(0, A), A) && myStrcmp( str.substr(A + 1, A + B + 1), A + B + 1)) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;

    return 0;
}


Compiler output:
a.cc: In function 'bool myStrcmp(std::string, int)':
a.cc:9:24: error: no matching function for call to 'all_of(std::__cxx11::basic_string<char>::const_iterator, std::__cxx11::basic_string<char>::const_iterator, <unresolved overloaded function type>)'
    9 |         if (std::all_of(str.cbegin(), str.cend(), isdigit)) {
      |             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_algo.h:410:5: note: candidate: 'template<class _IIter, class _Predicate> bool std::all_of(_IIter, _IIter, _Predicate)'
  410 |     all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
      |     ^~~~~~
/usr/include/c++/14/bits/stl_algo.h:410:5: note:   template argument deduction/substitution failed:
a.cc:9:24: note:   couldn't deduce template parameter '_Predicate'
    9 |         if (std::all_of(str.cbegin(), str.cend(), isdigit)) {
      |             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:30:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Predicate> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool> std::all_of(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Predicate)'
   30 | all_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
      | ^~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:30:1: note:   candidate expects 4 arguments, 3 provided
Language: C++

#include<stdio.h>
int main(void)
{
int box[ ],A,B,S,count;
scanf("%d",&A);
scanf("%d",&B);
scanf("%d",&S);
box[ ]=S;
count=sizeof box/sizeof(int);
if(1<=A && B<=5 && box[A+1]='-' && count==A+B+1)
{
printf("yes");
}
else{
printf("no");
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: storage size of 'box' isn't known
    4 | int box[ ],A,B,S,count;
      |     ^~~
a.cc:8:6: error: expected primary-expression before ']' token
    8 | box[ ]=S;
      |      ^
Language: C++

#include <iostream>
#include <string>
#include <string.h>
#include <cctype>
#include <algorithm>
using namespace std;

bool myStrcmp(string str, int range) {
	if (all_of(str.cbegin(), str.cend(), isdigit)) {
		return true;
	}
	return false;
}

int main()
{
	unsigned int A = 0, B = 0;
	cin >> A >> B;
	string str = {};
	cin >> str;
	if ( strcmp(&str[A], "-") && str.size() == A+B+1) {
		if (myStrcmp(str.substr(0, A), A) && myStrcmp( str.substr(A + 1, A + B + 1), A + B + 1)) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;

    return 0;
}


Compiler output:
a.cc: In function 'bool myStrcmp(std::string, int)':
a.cc:9:19: error: no matching function for call to 'all_of(std::__cxx11::basic_string<char>::const_iterator, std::__cxx11::basic_string<char>::const_iterator, <unresolved overloaded function type>)'
    9 |         if (all_of(str.cbegin(), str.cend(), isdigit)) {
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_algo.h:410:5: note: candidate: 'template<class _IIter, class _Predicate> bool std::all_of(_IIter, _IIter, _Predicate)'
  410 |     all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
      |     ^~~~~~
/usr/include/c++/14/bits/stl_algo.h:410:5: note:   template argument deduction/substitution failed:
a.cc:9:19: note:   couldn't deduce template parameter '_Predicate'
    9 |         if (all_of(str.cbegin(), str.cend(), isdigit)) {
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:30:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Predicate> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool> std::all_of(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Predicate)'
   30 | all_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred);
      | ^~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:30:1: note:   candidate expects 4 arguments, 3 provided
Language: C

#include <stdio.h>

int main(){
  int a,b,c,d,e,f;
  char ch;
  c =scanf("%d%d",&a,&b);
  d = scanf("%d%c%d",&e,&ch,&f);
 if(c ==0||d ==0||(d !=(a+b)) printf("No");
{

  int count1,count2;
  while(e>0){
    e = e/10;
    count1 +=1;
  }
  while(f>0){
    f =f/10;
    count2 += 1;
  }
  
  if(a ==count1 &&b ==count2){
    printf("Yes");
  }else{
    printf("No");
  }
}
}

Compiler output:
main.c: In function 'main':
main.c:8:30: error: expected ')' before 'printf'
    8 |  if(c ==0||d ==0||(d !=(a+b)) printf("No");
      |    ~                         ^~~~~~~
      |                              )
main.c:27:1: error: expected expression before '}' token
   27 | }
      | ^
Language: C++

#include<iostream>
#include<string.h>
using namespace std;
int a,b,m;
char str[1000];
int main(){
	while(scanf("%d%d",&a,&b)!=EOF){
		scanf("%s",str);
		while(str[i]!='-'){
			i++;
		}
		if((strlen(str)==a+b+1)&&i==a){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}
}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:27: error: 'i' was not declared in this scope
    9 |                 while(str[i]!='-'){
      |                           ^
a.cc:12:42: error: 'i' was not declared in this scope
   12 |                 if((strlen(str)==a+b+1)&&i==a){
      |                                          ^
Language: C++

#include<stdio.h>
int main(void)
{
int A,B,S,box[],count;
scanf("%d",&A);
scanf("%d",%B);
scanf("%d",%S);
box[]=S;
count=sizeof box/sizeof(int);
if(1<=A && B<=5 && box[A+1]='-' && count=A+B+1)
{
printf("yes");
}
else{
printf("no");
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:11: error: storage size of 'box' isn't known
    4 | int A,B,S,box[],count;
      |           ^~~
a.cc:6:12: error: expected primary-expression before '%' token
    6 | scanf("%d",%B);
      |            ^
a.cc:7:12: error: expected primary-expression before '%' token
    7 | scanf("%d",%S);
      |            ^
a.cc:8:5: error: expected primary-expression before ']' token
    8 | box[]=S;
      |     ^
a.cc:10:33: error: lvalue required as left operand of assignment
   10 | if(1<=A && B<=5 && box[A+1]='-' && count=A+B+1)
      |                             ~~~~^~~~~~~~
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		String s = sc.next();
               boolean flg = true;
		for(int i = 0; i < a; i++){
                     if( "-".equals(s[i] )) flg = false;
               }
               if ( !("-".equals(s[i] ))) flg =false;
		for(int i = a+1; i < b; i++){
                     if( "-".equals(s[i] )) flg =false;
               }
              if (flg)                System.out.print("yes");
             else  System.out.print("no");
	}
}


Compiler output:
Main.java:10: error: array required, but String found
                     if( "-".equals(s[i] )) flg = false;
                                     ^
Main.java:12: error: cannot find symbol
               if ( !("-".equals(s[i] ))) flg =false;
                                   ^
  symbol:   variable i
  location: class Main
Main.java:12: error: array required, but String found
               if ( !("-".equals(s[i] ))) flg =false;
                                  ^
Main.java:14: error: array required, but String found
                     if( "-".equals(s[i] )) flg =false;
                                     ^
4 errors
Language: C++

#include <stdio.h>
int main(int argc, char *argv[])
{
	int n,m;
	while(scanf("%d%d",&n,&m)!=EOF)
	{
		char num[15];
		getchar();
		gets(num);
		int count=0;
		for(int i=0;i<n+m+1;i++)
		{
			if(i==n)
			{
				if(num[n]=='-')
					count++;
			}
			else if(num[i]>='0'&&num[i]<='9')
			{
				count++;
			}
		}
		if(count==n+m+1)
			printf("Yes\n");
		else
			printf("No\n");
	}
	return 0;
}


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

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		String s = sc.next();
               boolean flg = true;
		for(int i = 0; i < a; i++){
                     if(s[i].equals("-")) flg == false;
               }
               if ( !(s[a+1].equals("-"))) flg == false;
		for(int i = a+1; i < b; i++){
                     if( s[i].equals("-")) flg == false;
               }
              if (flg)                System.out.print("yes");
             else  System.out.print("no");
	}
}


Compiler output:
Main.java:10: error: not a statement
                     if(s[i].equals("-")) flg == false;
                                              ^
Main.java:12: error: not a statement
               if ( !(s[a+1].equals("-"))) flg == false;
                                               ^
Main.java:14: error: not a statement
                     if( s[i].equals("-")) flg == false;
                                               ^
3 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		String s = sc.next();
               boolean flg = true;
		for(int i = 0; i < a; i++){
                     if( "-".equals(s[i] )) flg == false;
               }
               if ( !("-".equals(s[i] ))) flg == false;
		for(int i = a+1; i < b; i++){
                     if( "-".equals(s[i] )) flg == false;
               }
              if (flg)                System.out.print("yes");
             else  System.out.print("no");
	}
}

Compiler output:
Main.java:10: error: not a statement
                     if( "-".equals(s[i] )) flg == false;
                                                ^
Main.java:12: error: not a statement
               if ( !("-".equals(s[i] ))) flg == false;
                                              ^
Main.java:14: error: not a statement
                     if( "-".equals(s[i] )) flg == false;
                                                ^
3 errors
Language: C++

#include <bits/stdc++.h>

 using namespace std;
 char str[1<<4];
 int main(){
 	int A , B;
   scanf("%d%d",&A,&B);
   scanf("%s",str+1);
   if(strlen(str+1) != A+B + 1){
    printf("No");
     return 0;
   }
   for(int i = 1 ; i <= A+B+1; ++i){
   		if(i <= A and (str[i] > '9' or str[i] < '0') ){
         	printf("No");
          return 0;
        }else if(i == A+1 and str[i] ! '-'){
        	printf("No");
          return 0;
        }else if(i > A+1 and (str[i] > '9' or str[i] < '0')){
        	printf("No");
          	return 0;
        }
   }
   printf("Yes");
 }
   

Compiler output:
a.cc: In function 'int main()':
a.cc:17:37: error: expected ')' before '!' token
   17 |         }else if(i == A+1 and str[i] ! '-'){
      |                 ~                   ^~
      |                                     )
Language: C++

#include <GLUT/glut.h>
#include <string>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cfloat>
#include <algorithm>
#include <vector>
#include <iostream>
#define PI 3.141592
using namespace std;

int main (){
    int x,y;
    char num[11] = "0123456789";
    char hypn[2] = "-";
    cin >> x >> y;

    char s[x+y+2];

    for (int i=0;i<x+y+1;i++){
        cin >> s[i];
    }

    // for (int i=0;i<x+y+1;i++){
    //     cout <<  s[i];
    // }cout << "\n";
int w,z=0;
w = 0;
    for(int i = 0;i<x+y+1;i++){
        if(i == x){
            if(s[i] == hypn[0]){
                z++;
            }
        }
        for(int j=0;j<10;j++){

            if(s[i] == num[j]){
                w++;
            }
        }
    }
    //cout << w <<" "<< z << "\n";
    if(w == x+y && z == 1){
        cout << "Yes\n";
    }else{
        cout << "No\n";
    }
}


Compiler output:
a.cc:1:10: fatal error: GLUT/glut.h: No such file or directory
    1 | #include <GLUT/glut.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<cstdio>
#include<string>

using namespace std;

int main() {
	int a,b;
	string s;
	cin >> a >> b >> s;
	for(int i=0;i<a;i++){
	if(s[i]>='0' && s[i]<='9'){
		i++;
	}
	else{
		cout << "No" << endl;
		return 0;
	}
  }
	if(s[a] == '-'){
		for(int j=a+1;j<a+b;j++){
		if(s[j]>='0'&& s[j]<='9'){
			j++;
		}
		else{
			cout << "No" << endl;
			return 0;
		}
	  }
		cout << "Yes" << endl;
		return 0;
	}
	else{
		cout << "No" << endl;
		return 0;
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope
    9 |         cin >> a >> b >> s;
      |         ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<string>
  +++ |+#include <iostream>
    3 | 
a.cc:15:17: error: 'cout' was not declared in this scope
   15 |                 cout << "No" << endl;
      |                 ^~~~
a.cc:15:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:33: error: 'endl' was not declared in this scope
   15 |                 cout << "No" << endl;
      |                                 ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include<string>
  +++ |+#include <ostream>
    3 | 
a.cc:25:25: error: 'cout' was not declared in this scope
   25 |                         cout << "No" << endl;
      |                         ^~~~
a.cc:25:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:41: error: 'endl' was not declared in this scope
   25 |                         cout << "No" << endl;
      |                                         ^~~~
a.cc:25:41: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:29:17: error: 'cout' was not declared in this scope
   29 |                 cout << "Yes" << endl;
      |                 ^~~~
a.cc:29:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:29:34: error: 'endl' was not declared in this scope
   29 |                 cout << "Yes" << endl;
      |                                  ^~~~
a.cc:29:34: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:33:17: error: 'cout' was not declared in this scope
   33 |                 cout << "No" << endl;
      |                 ^~~~
a.cc:33:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:33:33: error: 'endl' was not declared in this scope
   33 |                 cout << "No" << endl;
      |                                 ^~~~
a.cc:33:33: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <stdio.h>
#include <math.h>
#include <iostream>
using namespace std;


int main()
{
	int nA,nB;
	cin >> nA >> nB;
	char strS[20];
	memset(strS, NULL, sizeof(strS));
	cin >> strS;
	char szTmpValA[20];
	memset(szTmpValA, NULL, sizeof(szTmpValA));
	strncpy(szTmpValA, strS, nA);
	char szTmpValB[20];
	memset(szTmpValB, NULL, sizeof(szTmpValB));
	strncpy(szTmpValB, &strS[nA+2], nB);

	int nTotalLen = nA + nB + 1;
	if (strlen(strS) != nTotalLen)
	{
		cout << "No";
		return 0;
	}

	bool bErr = false;
	for (int i = 0; i < nTotalLen; i++)
	{
	
		if (i != nA)
		{
			if (0 == isdigit(strS[i]))
			{
				bErr = true;
				break;
			}
		}
		else
		{
			if ('-' != strS[i])
			{
				bErr = true;
				break;
			}
		}
	}

	if (bErr)
		cout << "No";
	else
		cout << "Yes";
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'memset' was not declared in this scope
   12 |         memset(strS, NULL, sizeof(strS));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <iostream>
  +++ |+#include <cstring>
    4 | using namespace std;
a.cc:16:9: error: 'strncpy' was not declared in this scope
   16 |         strncpy(szTmpValA, strS, nA);
      |         ^~~~~~~
a.cc:16:9: note: 'strncpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:22:13: error: 'strlen' was not declared in this scope
   22 |         if (strlen(strS) != nTotalLen)
      |             ^~~~~~
a.cc:22:13: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

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

int main()
{
	unsigned int A = 0, B = 0;
	cin >> A >> B;
	string str = NULL;
	cin >> str;
	if (strcmp(&str[A], "-")
		&& str.size() == A+B+1) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 'strcmp' was not declared in this scope
   11 |         if (strcmp(&str[A], "-")
      |             ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

#include <iostream>
#include <cstdio>
#include <map>
#include <algorithm>
#include <set>
#include <vector>
#include <queue>
#include <assert.h>

using namespace std;

typedef long long ll;

int A, B;
char S[15];
int main() {
  scanf("%d %d", &A, &B);
  scanf("%s", S);
  int N = strlen(S);
  bool valid = N == A + B + 1;
  for (int i = 0; valid && i < N; i++) {
    if (i == A) {
      valid = valid && (S[i] == '-');
    } else {
      valid = valid && S[i] >= '0' && S[i] <= '9';
    }
  }
  if (valid) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: 'strlen' was not declared in this scope
   19 |   int N = strlen(S);
      |           ^~~~~~
a.cc:9:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include <assert.h>
  +++ |+#include <cstring>
    9 |
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: expected ')' before ';' token
    8 | for(int i=0;i<a+b+1;i++;){
      |    ~                   ^
      |                        )
a.cc:8:25: error: expected primary-expression before ')' token
    8 | for(int i=0;i<a+b+1;i++;){
      |                         ^
a.cc:15:21: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   15 | cout<<f ? "Yes":"No"<<endl;
      |                 ~~~~^~~~~~
Language: C++

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


Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:1: error: expected primary-expression before 'int'
    4 | int a,b;cin>>a>>b;
      | ^~~
a.cc:4:1: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:4:9: error: 'cin' does not name a type
    4 | int a,b;cin>>a>>b;
      |         ^~~
a.cc:6:1: error: 'cin' does not name a type
    6 | cin>>s;
      | ^~~
a.cc:8:1: error: expected unqualified-id before 'for'
    8 | for(int i=0;i<a+b+1;i++;){
      | ^~~
a.cc:8:13: error: 'i' does not name a type
    8 | for(int i=0;i<a+b+1;i++;){
      |             ^
a.cc:8:21: error: 'i' does not name a type
    8 | for(int i=0;i<a+b+1;i++;){
      |                     ^
a.cc:8:25: error: expected unqualified-id before ')' token
    8 | for(int i=0;i<a+b+1;i++;){
      |                         ^
a.cc:15:1: error: 'cout' does not name a type
   15 | cout<<f ? "Yes":"No"<<endl;
      | ^~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

include <stdio.h>
using namespace std;
int A, B;
char S[12];
bool correct = true;
int main() {
  scanf("%d %d", &A, &B);
  scanf("%s", S);
  int i = 0;
  while (i < A) {
    if (S[i] == '-') {
      correct = false;
    }
    i++;
  }
  if (S[i] != '-') {
    correct = false;
  }
  i++;
  while (i < A+B) {
    if (S[i] == '-') {
      correct = false;
    }
    i++;
  }
  if (correct) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <stdio.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'scanf' was not declared in this scope
    7 |   scanf("%d %d", &A, &B);
      |   ^~~~~
a.cc:27:5: error: 'printf' was not declared in this scope
   27 |     printf("Yes\n");
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | include <stdio.h>
a.cc:29:5: error: 'printf' was not declared in this scope
   29 |     printf("No\n");
      |     ^~~~~~
a.cc:29:5: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

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

using namespace std;


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

    int A,B;
    string S;
    scanf("%d %d",&A,&B);
    cin>>S;

    bool isOk=true;
    for(int i=0;i<A;i++){
        if(S[i]=='-'){
            isOk=false;
        }
    }
    if(S[A]!='-'){
        isOk=false;
    }
    for(int i=A+1;i<A+B+1;i++){
        if(S[i]=='-') {
            isOk = false;
        }
    }

    if(isOk){
        printf("Yes\n");
    }else{
        printf("No\n");
    }

    return 0;
}
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <functional>

using namespace std;


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

    int A,B;
    string S;
    scanf("%d %d",&A,&B);
    cin>>S;

    bool isOk=true;
    for(int i=0;i<A;i++){
        if(S[i]=='-'){
            isOk=false;
        }
    }
    if(S[A]!='-'){
        isOk=false;
    }
    for(int i=A+1;i<A+B+1;i++){
        if(S[i]=='-') {
            isOk = false;
        }
    }

    if(isOk){
        printf("Yes\n");
    }else{
        printf("No\n");
    }

    return 0;
}


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

#include <stdio.h>
int a,b;
char s[11];
int main(){
scanf("%d%d",&a,&b);
scanf("%s",&s);
for(int k=0;k<a;k++){
if(0<=(int)s[k]&&(int)s[k]<=9){}else{printf("No");return 0;}
}
for(int k=a;k<a+b+1;k++){
if(0<=(int)s[k]&&(int)s[k]<=9){}else{printf("No");return 0;}
}
if(s[a]!="-"){printf("No");return 0;}
printf("Yes");
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 | if(s[a]!="-"){printf("No");return 0;}
      |    ~~~~^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int N = 1610;

#define PI acos(-1)
typedef long long ll;
typedef pair<int, int> pii;
#define INF 0x3f3f3f3f
int mod = 1000000007;
char s[N];
int main()
{
	//freopen("in.txt", "r", stdin);
	int a, b;
	while (~scanf("%d%d", &a, &b))
	{
		getchar();
		gets(s);
		bool f = true;
		if (s[a+1] != '-')
			f = false;

		int l = a + b + 1;

		for (int i = 0; i < l; i++)
			if (i != a+1 && !isdigit(s[i]))
			{
				f = false;
			}
		if (strlen(s) != a+1+b)
			f = false;
		puts(f?"Yes":"No");


	}
   	return 0;
}

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

#include<stdio.h>
int main(void){
char number[A+B+1];
scanf("%s",number);
int i,A,B;
scanf("%d",&A);
scanf("%d",&B);
for(i=0;i<=A-1;i++){
if(number[i]=='-') {
printf("No");
return 0;
}
}
if(number[A]!='-') {
printf("No");
return 0;
}
for(i=A+1;i<=A+B;i++){
if(number[A+B]=='-'){
printf("No");
return 0;
}
printf("Yes");
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:13: error: 'A' undeclared (first use in this function)
    3 | char number[A+B+1];
      |             ^
main.c:3:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:3:15: error: 'B' undeclared (first use in this function)
    3 | char number[A+B+1];
      |               ^
main.c:25:1: error: expected declaration or statement at end of input
   25 | }
      | ^
Language: C++

#include <stdio.h>
int a,b;
char s[11];
int main(){
scanf("%d%d",&a,&b);
scanf("%c",&s);
for(int k=0;k<a;k++){
if(0<=(int)s[k]&&(int)s[k]<=9){}else{printf("No");return 0;}
}
for(int k=a;k<a+b+1;k++){
if(0<=(int)s[k]&&(int)s[k]<=9){}else{printf("No");return 0;}
}
if(s[a]!="-"){printf("No");return 0;}
printf("Yes");
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 | if(s[a]!="-"){printf("No");return 0;}
      |    ~~~~^~~~~
Language: C

#include<stdio.h>
int main(void){
char number[A+B+1];
scanf("%s",number);
int i;
for(i=0;i<=A-1;i++){
if(number[i]=='-') {
printf("No");
return 0;
}
}
if(number[A]!='-') {
printf("No");
return 0;
}
for(i=A+1;i<=A+B;i++){
if(number[A+B]=='-'){
printf("No");
return 0;
}
printf("Yes");
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:13: error: 'A' undeclared (first use in this function)
    3 | char number[A+B+1];
      |             ^
main.c:3:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:3:15: error: 'B' undeclared (first use in this function)
    3 | char number[A+B+1];
      |               ^
main.c:23:1: error: expected declaration or statement at end of input
   23 | }
      | ^
Language: C++

# coding: utf-8
# Your code here!
A,B=[int(i) for i in input().split()]
S=input()
flag = 1
L = A+B+1
if len(S)== L:
    for i in range(L):
        if (i != A and S[i] == '-'):
            flag = 0
        if (i == A and S[i] != '-'):
            flag = 0
else:
    flag = 0

if flag == 1:
    print('Yes')
else:
    print('No')

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding: utf-8
      |   ^~~~~~
a.cc:2:3: error: invalid preprocessing directive #Your
    2 | # Your code here!
      |   ^~~~
a.cc:17:11: warning: multi-character character constant [-Wmultichar]
   17 |     print('Yes')
      |           ^~~~~
a.cc:19:11: warning: multi-character character constant [-Wmultichar]
   19 |     print('No')
      |           ^~~~
a.cc:3:1: error: 'A' does not name a type
    3 | A,B=[int(i) for i in input().split()]
      | ^
Language: C

#include<stdio.h>
int main(void){
char number[A+B+1];
int i;
for(i=0;i<=A-1;i++){
if(number[i]=='-') {
printf("No");
return 0;
}
}
if(number[A]!='-') {
printf("No");
return 0;
}
for(i=A+1;i<=A+B;i++){
if(number[A+B]=='-'){
printf("No");
return 0;
}
printf("Yes");
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:13: error: 'A' undeclared (first use in this function)
    3 | char number[A+B+1];
      |             ^
main.c:3:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:3:15: error: 'B' undeclared (first use in this function)
    3 | char number[A+B+1];
      |               ^
main.c:22:1: error: expected declaration or statement at end of input
   22 | }
      | ^
Language: C++

#include<stdio.h>
int main()
{
	int a, b; char arr[20] = { 0 };
	while (~scanf("%d%d", &a, &b))
	{
		getchar();
		gets(arr);
		int f = 1;
		for (int i = 0; i < a + b + 1; i++)
		{
			if (i != a)
			{
				if (!(arr[i] >= '0'&&arr[i] <= '9'))
				{
					f = 0;
					break;
				}
			}
			else if (arr[i] != '-')
			{
				f = 0; break;
			}
		}
		if (f)printf("Yes\n");
		else printf("No\n");
	}
}

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

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


string str1;


int main(int argc, char const *argv[])
{
	int a,b; cin>>a>>b;
	cin>>str1;
	int len=str1.length();
	for(int i=0 ;i<len; i++){
		if(str1[a]=='-')
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;

		break;
	}




Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:23:10: error: expected '}' at end of input
   23 |         }
      |          ^
a.cc:12:1: note: to match this '{'
   12 | {
      | ^
Language: C

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

int descending_compare(const void *a, const void *b){
    if (*(int*)a > *(int*)b){
        return -1;
    }else if (*(int*)a == *(int*)b){
        return 0;
    }else{
        return 1;
    }
}

int ascending_compare(const void *a, const void *b){
    if (*(int*)a < *(int*)b){
        return -1;
    }else if (*(int*)a == *(int*)b){
        return 0;
    }else{
        return 1;
    }
}


int lower_bound(int *a, int n, int key){
    int left, mid, right;
    left = 0, right = n;
    mid = (left + right)/2;
    while ((left+1 != mid || mid+1 != right) && mid != left){
        if (key > a[mid]){
            left = mid;
        }else{
            right = mid+1;
        }
        mid = (left + right)/2;
    }
    if (a[left] >= key)return left;
    if (a[mid] >= key)return mid;
    if (a[right] >= key)return right;
    return n;
}

int main(void){
    int a, b;
    char s[15];
    int flag = 0;
    scanf("%d %d", &a, &b);
    scanf(" %s", s);
    if (s[3] == '-'){
        flag = 1;
    }
    if (strlen(s) != a+b+1){
        flag = 0;
    }
    for (i = 0; i < a; i++){
        if (s[i] < '0' || s[i] > '9'){
            flag = 0;
        }
    }

    for (i = a+1; i < strlen(s); i++){
        if (s[i] < '0' || s[i] > '9'){
            flag = 0;
        }
    }

    if (flag == 1){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
}


Compiler output:
main.c: In function 'main':
main.c:57:10: error: 'i' undeclared (first use in this function)
   57 |     for (i = 0; i < a; i++){
      |          ^
main.c:57:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <cstdio>
#include <math.h>
#include <strings.h>
#include <stdlib.h>
#include <limits.h>
#include <iostream>

using namespace std;

int main(void) {
	int a, b;
	char s[10];
	cin >> a;
	cin >> b;
	cin >> s;
	if (strlen(s) != a+b+1) {
		cout << "No" << endl;
		return 0;
	}
	for (int i=0;i<strlen(s);i++) {
		if (a > 0) {
			if (s[i] == '-') {
				cout << "No" << endl;
				return 0;
			}
			a--;
		}
		else if (a == 0) {
			if (s[i] != '-') {
				cout << "No" << endl;
				return 0;
			}
			a--;
		}
		else {
			if (s[i] == '-') {
				return 0;
			}
		}
	}
	cout << "Yes" << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: 'strlen' was not declared in this scope
   16 |         if (strlen(s) != a+b+1) {
      |             ^~~~~~
a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <iostream>
  +++ |+#include <cstring>
    7 | 
a.cc:20:24: error: 'strlen' was not declared in this scope
   20 |         for (int i=0;i<strlen(s);i++) {
      |                        ^~~~~~
a.cc:20:24: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C

#include <stdio.h>

int main {
    int A, B;
    char S[128];

    scanf("%d %d", &A, %B);
    scanf("%s", S[128]);

    int i = 0;

    for (int i=0; i<100; i++) {
        if (S[i]=='-') {
            if (A==i) {
                printf("Yes");
                break;
            }
            else {
                printf("No");
                break;
            }
        }
    }
}


Compiler output:
main.c:3:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    3 | int main {
      |          ^
Language: C++

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

int A, B;
string S;
bool ans = true;

void solve() {
  for (int i = 0; i < A; ++i) {
    if (i == A + 1){
      if (S[i] != '-'){
        ans = false;
      }
    }else{
      for (int j = 0; j < 10; ++j){
        if (S[i] != j){
          ans = false;
        }
      }
    }
  }
  if (ans){
    cout << Yes << endl;
  }else{
    cout << No << endl;
  }
}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:23:13: error: 'Yes' was not declared in this scope
   23 |     cout << Yes << endl;
      |             ^~~
a.cc:25:13: error: 'No' was not declared in this scope
   25 |     cout << No << endl;
      |             ^~
Language: C++

#include <bits/stdc++.h>

#define REP(i,n) for(int i = 0; i < (n); ++i)
#define REP1(i,n) for(int i = 1; i <= (n); ++i)
#define RREP(i, n) for(int i = (n) - 1; i >= 0; --i)
#define ALL(a) begin(a), end(a)
#define MP(a,b) make_pair((a), (b))
#define ROUNDUP(a,b) ((a) / (b) + ((a) % (b) == 0 ? 0 : 1))
#define X first
#define Y second
#define DEBUG(a) cout << #a << ": " << a << "\n"
// #define DEBUG(a) {}

using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;

constexpr int MOD = 1e9 + 7;
constexpr int INF = 1e9 + 1;
constexpr ll LLINF = 4 * 1e18 + 1;
// constexpr int INF = 2147483647; // 2 * 1e9
// constexpr ll LLINF = 9223372036854775807; // 9 * 1e18

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

template<typename T>
T debug(T x) {
	DEBUG(x);
	return x;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int a, b;
        string s;
        cin>>a>>b>>s;
        REP(i,s.size()){
            if((i==a&&s[i]!='-' )||(i!=a&&(s[i]<'0' || s[i]>'9' ){cout<<"No";return 0;}
        }
        cout<<"Yes\n";
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:66: error: expected ')' before '{' token
   41 |             if((i==a&&s[i]!='-' )||(i!=a&&(s[i]<'0' || s[i]>'9' ){cout<<"No";return 0;}
      |                                    ~                             ^
      |                                                                  )
a.cc:41:88: error: expected ')' before '}' token
   41 |             if((i==a&&s[i]!='-' )||(i!=a&&(s[i]<'0' || s[i]>'9' ){cout<<"No";return 0;}
      |               ~                                                                        ^
      |                                                                                        )
   42 |         }
      |         ~                                                                               
a.cc:42:9: error: expected primary-expression before '}' token
   42 |         }
      |         ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main(void){
  int n, m;
  cin >> n >> m;
  string in;
  cin >> in;
  if(in.size() == n + m + 1 && in[n] != '-'){
    puts("No");
    return 0;
  }
  for(int i = 0; i < in.size(); ++i){
    if(i == A)continue;
    if(!isdigit(in[i])){
      puts("No");
      return 0;
    }
  }
  if(in.size() != n + m + 1)
    puts("No");
  else puts("Yes");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: 'A' was not declared in this scope
   15 |     if(i == A)continue;
      |             ^
Language: C++

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

int main()
{
    int a, b;
    cin>>a>>b;
    string s;
    cin>>s;
    if(s[a] != '-')
    {
        cout<<"No\n";
        return 0;
    }
    for(int i = 0; i < (int)s.length(); i++)
    {
        if(i == a)
            continue;
        if(c > '9' || c < '0')
        {
            cout<<"No\n";
            return 0;
        }
    }
    cout<<"Yes\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:12: error: 'c' was not declared in this scope
   19 |         if(c > '9' || c < '0')
      |            ^
Language: C++

/*input
4 3 3
2 3 1 1
*/

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

#define fill(a,val) memset(a, (val), sizeof a)
#define pb push_back
#define lli long long int
#define endl "\n"
#define unique(x) x.erase(unique(x.begin(),x.end()), x.end())
#define      rep(i, n)         for(int i = 0; i < (n); ++i)
#define      FOR(i, a, n)     for(int i = a; i < (n); ++i)
#define      repD(i, a, n)     for(int i = a; i >= (n); --i)

int main(void)
{
  int a,b ; cin>>a>>b;
  string s; cin>>s;
  bool p=true;
  for(int i=0; i<a; ++i){
    if(!(s[i]>='0' and s[i]<='9')){
        p=flase;
    }
  }
  if(arr[a]!='-') p=false;
  for(int i=0; i<b; ++i){
    if(!(s[a+1+i]>='0' and s[a+i+1]<='9')){
        p=flase;
    }
  }
  if(p) cout<<"Yes";
  else cout<<"No";
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:11: error: 'flase' was not declared in this scope; did you mean 'fclose'?
   25 |         p=flase;
      |           ^~~~~
      |           fclose
a.cc:28:6: error: 'arr' was not declared in this scope
   28 |   if(arr[a]!='-') p=false;
      |      ^~~
a.cc:31:11: error: 'flase' was not declared in this scope; did you mean 'fclose'?
   31 |         p=flase;
      |           ^~~~~
      |           fclose
Language: C++

#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
using namespace std;
typedef pair<int, int> P;
typedef long long LL;

#define _CRT_SECURE_NO_WARNINGS
int a,b;
int main() {
	char s[100];
  scanf("%d %d %s",&a,&b,s);
	for(int i=0;i<a+b+1){
		if(i<a+1){
          if(s[i]<'0' || '9'<s[i] ){
	
			printf("No");
            return 0;
          }
        }else if(i==a+1){
          if(s[i]!='-'){
            printf("No");
            return 0;
          }
        }else{
          if(s[i]<'0' || '9'<s[i] ){
	
			printf("No");
            return 0;
          }
        }
    }
  printf("Yes");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:28: error: expected ';' before ')' token
   17 |         for(int i=0;i<a+b+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";
    return 0;
  }
  for(int x = 0;x<s.size();x++){
    if(s[x]=='-'&&x!=a){
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}


Compiler output:
a.cc:3:20: error: expected ';' before 'int'
    3 | using namespace std
      |                    ^
      |                    ;
    4 | 
    5 | int main(){
      | ~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vvi vector<vi>
#define vs vector<string>
#define pb push_back
#define P pair<int,int>
#define vp vector<P>
#define PP pair<int,P>
#define vpp vector<PP>
#define fi first
#define se second
#define INF (1<<30)
#define MOD 1000000007
#define REP(i,n) for(int i=0;i<n;i++)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define all(x) (x).begin(),(x).end()
int main(){
    int a,b;
    cin>>a>>b;
    string st;
    cin>>st;
    bool f=true;
    REP(i,a){
        if('0'<=st[i]&&st[i]<='9'){
            continue;
        }
        f=false;
    }
    if(st[i]!='-'){
        f=false;
    }
    REP(i,b){
        if('0'<=st[a+i+1]&&st[a+i+1]<='9'){
            continue;
        }
        f=false;
    }
    if(f){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:11: error: 'i' was not declared in this scope
   31 |     if(st[i]!='-'){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#include < cstdio >
int N, C[500], S[500], F[500];
int main() {
    scanf("%d", &N);
    for (int i = 0; i < N - 1; i++) scanf("%d%d%d", &C[i], &S[i], &F[i]);
    for (int i = 0; i < N; i++) {
        int t = 0;
        for (int j = i; j < N - 1; j++) {
            if (t < S[j])
                t = S[j];
            else if (t % F[j] == 0);
            else t = t + F[j] - t % F[j];
            t += C[j];
        }
        printf("%d\n ", t);
    }
}


Compiler output:
a.cc:3:10: fatal error:  cstdio : No such file or directory
    3 | #include < cstdio >
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

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

long long main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(20) << fixed;
  long long N;
  cin >> N;
  vector<long long> timeToNextSt(N);
  vector<long long> firstTrain(N);
  vector<long long> cycle(N);
  for(long long i = 0; i < N-1; i++){
    cin >> timeToNextSt[i] >> firstTrain[i] >> cycle[i];
  }

  for(long long i = 0; i < N; i++){
    if(i == N-1){
      cout << 0 <<endl;
      return 0;
    }
    long long ans = 0;
    ans += firstTrain[i] + timeToNextSt[i];
    for(long long j = i + 1; j < N -1; j++){
      if(ans <= firstTrain[j]){
        ans = firstTrain[j];
      } else{
        ans += ans % cycle[j];
      }
      ans += timeToNextSt[j];
    }
    cout << ans <<endl;
  }
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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

int dp[505][150000];

int main() {
    int N; cin >> N;
    vector<int> C(N);
    vector<int> S(N);
    vector<int> F(N);

    rep(i, N-1){
        cin >> C[i+1] >> S[i+1] >> F[i+1];
    }

    for (int i = 1; i <= N; i++){
        int t = 0;
        for (int j = i; j < N; j++){
            if(t <= S[j]){
                t = S[j] + C[j];
            } else {
                int x = t % F[j];
                t += x + C[j];
            }
        }
        cout << t << endl;
    }

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

int dp[505][150000];

int main() {
    int N; cin >> N;
    vector<int> C(N);
    vector<int> S(N);
    vector<int> F(N);

    rep(i, N-1){
        cin >> C[i+1] >> S[i+1] >> F[i+1];
    }

    for (int i = 1; i <= N; i++){
        int t = 0;
        for (int j = i; j < N; j++){
            if(t <= S[j]){
                t = S[j] + C[j];
            } else {
                int x = t % F[j];
                t += x + C[j];
            }
        }
        cout << t << endl;
    }

    return 0;
}

Compiler output:
a.cc:33:2: error: stray '#' in program
   33 | }#include <bits/stdc++.h>
      |  ^
a.cc:33:3: error: 'include' does not name a type
   33 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:39:5: error: redefinition of 'int dp [505][150000]'
   39 | int dp[505][150000];
      |     ^~
a.cc:7:5: note: 'int dp [505][150000]' previously declared here
    7 | int dp[505][150000];
      |     ^~
a.cc:41:5: error: redefinition of 'int main()'
   41 | int main() {
      |     ^~~~
a.cc:9:5: note: 'int main()' previously defined here
    9 | int main() {
      |     ^~~~
Language: C++

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

int main() {
  ll n; cin >> n;
  vector <ll> c(n-1), s(n-1), f(n-1);
  rep(i, n-1) cin >> c.at(i) >> s.at(i) >> f.at(i);
  rep(i, n) {
    ll res = 0;
    for (ll j = i; j < n-1; j++) {
      if (res <= s.at(j)) res = s.at(j) + c.at(j);
      else if ((res-s.at(j))%f.at(j) == 0) res += c.at(j);
      else res = s.at(j) + ((res-s.at(j))/f.at(j)+1)*f.at(j) + c.at(j)
    }
    cout << res << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:71: error: expected ';' before '}' token
   17 |       else res = s.at(j) + ((res-s.at(j))/f.at(j)+1)*f.at(j) + c.at(j)
      |                                                                       ^
      |                                                                       ;
   18 |     }
      |     ~
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = (l); i < (r); i++)
#define ALL(x) (x).begin(), (x).end()     //昇順
#define RALL(x) (x).rbegin(), (x).rend()  // 降順
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
const long long mod = 1e9 + 7;
typedef long long ll;
typedef priority_queue<int> PQ;
typedef vector<long long> VL; // VL a(n);
typedef vector<bool> VB;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<VS> VSS;
typedef vector<VC> VCC;
typedef vector<VL> VLL; // VII a(n,VI(m)) n * m
typedef pair<ll, ll> PL;
typedef map<ll, ll> MP; // MP a;
typedef vector<pair<ll, ll>> PS;

template <class T, class U>
bool chmax(T &a, U b) {
  if (a <= b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T, class U>
bool chmin(T &a, U b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) { os << v[i] << (i < v.size() - 1 ? ", " : ""); }
  os << "}";
  return os;
}

// g++ -std=c++11 prac.cpp
// operator << (cout,a);
// chmin(min,a)

int main() {
  ll n,k,m,x=0,y=0,z = 0,h=0,w=0,ans=0,sum = 0, Max = -1, Min = 3e9+1;
  string t;
  bool ok=true; 
  cin >> n;
  VL c(n),s(n),f(n);
  rep(i,n-1){
    cin >> c[i] >> s[i] >> f[i];
  }
  rep(i,n-1){
    ans = 0;
    ans = s[i]+ c[i];
    for(int j=i+1; j<n-1; j++){
      if(ans < s[j]){
        ans = s[j] + c[j];
        continue;
      }
      else if((ans - s[j]) % f[j] == 0){
        ans += c[j];
        continue;
      }
      else{
        x = (ans - s[j]) % f[j]
        ans += x;
        ans += c[j];
      }
    }
    pri(ans);
  }
  pri(0);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:75:32: error: expected ';' before 'ans'
   75 |         x = (ans - s[j]) % f[j]
      |                                ^
      |                                ;
   76 |         ans += x;
      |         ~~~