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

int N, M;
int coin[20];
int dp[50000];
int rec(int n) {
    
    if (dp[n] > 0) return dp[n];
    
    if (n < 0) {
        return 10000;
    }
    else if (n == 0) {
        return 0;
    }
    
    int ret = INF;
    REP(i, M) {
        ret = min(ret, rec(n - coin[i])+1);
    }
    return dp[n] = ret;
}

int main(int argc, const char * argv[]) {
//    std::vector<int> a{0,0,1,2,2,3,4,4};
//    std::vector<int> b{1,3,2,0,3,4,0,1};
//    std::vector<int> c{3,4,5,4,5,3,7,6};
//    CollectingTokens z;
//    cout << z.maxTokens(5, 8, a, b, c);
    //    vector <int> ret = c.digits(3);
    //    for (int i = 0; i < ret.size(); i++) cout << ret[i] << endl;
    
    memset(dp, -1, sizeof(dp));
    cin >> N >> M;
    REP(i, M) cin >> coin[i];
    cout << rec(N) << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int rec(int)':
a.cc:15:15: error: 'INF' was not declared in this scope
   15 |     int ret = INF;
      |               ^~~
a.cc:16:9: error: 'i' was not declared in this scope
   16 |     REP(i, M) {
      |         ^
a.cc:16:5: error: 'REP' was not declared in this scope
   16 |     REP(i, M) {
      |     ^~~
a.cc: In function 'int main(int, const char**)':
a.cc:31:5: error: 'memset' was not declared in this scope
   31 |     memset(dp, -1, sizeof(dp));
      |     ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | int N, M;
a.cc:32:5: error: 'cin' was not declared in this scope; did you mean 'coin'?
   32 |     cin >> N >> M;
      |     ^~~
      |     coin
a.cc:33:9: error: 'i' was not declared in this scope
   33 |     REP(i, M) cin >> coin[i];
      |         ^
a.cc:33:5: error: 'REP' was not declared in this scope
   33 |     REP(i, M) cin >> coin[i];
      |     ^~~
a.cc:34:5: error: 'cout' was not declared in this scope
   34 |     cout << rec(N) << endl;
      |     ^~~~
a.cc:34:23: error: 'endl' was not declared in this scope
   34 |     cout << rec(N) << endl;
      |                       ^~~~
Language: C++


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

const int MAX_N=50000;
const int MAX_M=20;
int d[MAX_M];
int dp[MAX_M+1][MAX_N+1];
int n,m;

void solve(){
	for(int i=0;i<=m;i++){
		for(int j=0;j<=n;j++){
                        if(i=0){
                             dp[i][j]=0;
                               }
			if(j<d[i]){
				dp[i+1][j]=dp[i][j];
			}
			else{
				dp[i+1][j]=max(dp[i][j],dp[i][j-d[i]]+1);
			}
		}

	}
}
int main(){
	scanf("%d %d",&n,&m);
	for(int i=0;i<m;i++){
		scanf("%d ",&d[i]);
	}
	memset(dp,INF,sizeof(dp));
	solve();
	printf("%d\n",dp[m][n]);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:19: error: 'INF' was not declared in this scope
   34 |         memset(dp,INF,sizeof(dp));
      |                   ^~~
Language: C++

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

const int MAX_N=50000;
const int MAX_M=20;

int d[MAX_M];
int dp[MAX_M+1][MAX_N+1];
int n,m;

void solve(){
	for(int i=0;i<=m;i++){
		for(int j=0;j<=n;j++){
                      if(j==0){
                            dp[i][j]=0;
                              }
                       else if(i!=0){
                             if(j<d[i-1]){
				dp[i][j]=dp[i-1][j];
			}
			else{
				dp[i][j]=min(dp[i-1][j],dp[i][j-d[i-1]]+1);
			}
		}

	}
}
int main(){
	scanf("%d%d",&n,&m);
	for(int i=0;i<m;i++){
		scanf("%d",&d[i]);
	}
        memset (dp,10000,sizeof(dp));

	solve();

	printf("%d\n",dp[m][n]);
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:30:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   30 | int main(){
      |         ^~
a.cc:30:9: note: remove parentheses to default-initialize a variable
   30 | int main(){
      |         ^~
      |         --
a.cc:30:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:30:11: error: a function-definition is not allowed here before '{' token
   30 | int main(){
      |           ^
a.cc:41:2: error: expected '}' at end of input
   41 | }
      |  ^
a.cc:13:13: note: to match this '{'
   13 | void solve(){
      |             ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	int dp[1000000];
	int n,m,c[100];

	memset(dp,-1,sizeof(dp));

	cin>>n>>m;

	for(int i=1;i<=m;i++){
		cin>>c[i];
	}

	for(int i=1;i<=m;i++){
		dp[c[i]]=1;
	}

	for(int i=1;i<=20;i++){
		for(int j=1;j<=n;j++){
			if(dp[j]!=-1){
				for(int k=1;k<=m;k++){
					if(dp[j+c[k]]==-1){
						dp[j+c[k]] = dp[j] + 1;
					}
				}
			}
		}
	}

	cout<<dp[n]<<endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'memset' was not declared in this scope
    8 |         memset(dp,-1,sizeof(dp));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

using namespace std

int main(){
    int n,m,c[20],dp[50001],i=0;
    cin >> n >> m;
    for(i;i<m;i++){
        cin >> c[i];
    }
    sort(c,m);
    for(i=0;i<=n;i++){
        dp[i] = 100000;
    }
    dp[0]=0;
    for(i=0;i<m;i++){
        dp[c[i]]=1;
    }
    for(i=1;i<n+1;i++){
        for(j=0;j<m;j++){
            if(c[j]>i) break;
            dp[i]=max(dp[i],dp[i-c[j]]);
        }
    }
    cout<< dp[n] << endl;
}

Compiler output:
a.cc:1:20: error: expected ';' before 'int'
    1 | using namespace std
      |                    ^
      |                    ;
    2 | 
    3 | int main(){
      | ~~~                 
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     cin >> n >> m;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std
a.cc:9:5: error: 'sort' was not declared in this scope; did you mean 'short'?
    9 |     sort(c,m);
      |     ^~~~
      |     short
a.cc:18:13: error: 'j' was not declared in this scope
   18 |         for(j=0;j<m;j++){
      |             ^
a.cc:20:19: error: 'max' was not declared in this scope
   20 |             dp[i]=max(dp[i],dp[i-c[j]]);
      |                   ^~~
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout<< dp[n] << endl;
      |     ^~~~
a.cc:23:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:21: error: 'endl' was not declared in this scope
   23 |     cout<< dp[n] << endl;
      |                     ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std
Language: C++

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

int main(){
    int n,m,c[20],dp[50001],i=0;
    cin >> n >> m;
    for(i;i<m;i++){
        cin >> c[i];
    }
    sort(c,m);
    for(i=0;i<=n;i++){
        dp[i] = 100000;
    }
    dp[0]=0;
    for(i=0;i<m;i++){
        dp[c[i]]=1;
    }
    for(i=1;i<n+1;i++){
        for(j=0;j<m;j++){
            if(c[j]>i) break;
            dp[i]=max(dp[i],dp[i-c[j]]);
        }
    }
    cout<< dp[n] << endl;
}

Compiler output:
a.cc:3:20: error: expected ';' before 'int'
    3 | using namespace std
      |                    ^
      |                    ;
    4 | 
    5 | int main(){
      | ~~~                 
a.cc: In function 'int main()':
a.cc:11:9: error: no matching function for call to 'sort(int [20], int&)'
   11 |     sort(c,m);
      |     ~~~~^~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   template argument deduction/substitution failed:
a.cc:11:9: note:   deduced conflicting types for parameter '_RAIter' ('int*' and 'int')
   11 |     sort(c,m);
      |     ~~~~^~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
a.cc:20:13: error: 'j' was not declared in this scope
   20 |         for(j=0;j<m;j++){
      |             ^
Language: C++

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

int main(){
    int n,m,c[20],dp[50001],i=0,j=0;
    cin >> n >> m;
    for(i;i<m;i++){
        cin >> c[i];
    }
    sort(c,c+m);
    for(i=0;i<=n;i++){
        dp[i] = 100000;
    }
    dp[0]=0;
    for(i=0;i<m;i++){
        dp[c[i]]=1;
    }
    for(i=1;i<n+1;i++){
        for(j=0;j<m;j++){
            if(c[j]>i) break;
            dp[i]=max(dp[i],dp[i-c[j]]);
        }
    }
    cout<< dp[n] << endl;
}

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

getTheNumberOfCoin()
    for j = 0 to n
        T[j] = INF
    T[0] = 0

    for i = 0 to m+1
        for j = C[i] to n
            T[j] = min(T[j], T[j - C[i]] + 1)

    return T[n]

Compiler output:
a.cc:2:5: error: expected constructor, destructor, or type conversion before 'for'
    2 |     for j = 0 to n
      |     ^~~
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int n,m;
	int i,j;
	cin >> n >> m;
	int coins[m];
	for(int i=0;i<m;i++)
	{
		cin >> coins[i];	
	}
	sort(coins, coins+m);
	int dp[n+1][m+1];
	for(i=0;i<=n;i++)
		for(j=0;j<=m;j++)
			dp[i][j]=INF;

	for(i=0;i<=n;i++)
	{
		dp[i][1]=i;
	}


	for(i=2;i<=m;i++)
	{
		for(j=1;j<=n;j++)
		{
			if(j-coins[i-1] >= 0)
			dp[j][i] = min(dp[j][i-1], dp[j-coins[i-1]][i]+1);
			else
				dp[j][i] = dp[j][i-1];
		}
	}
	/*for(i=0;i<=n;i++)
	{
		for(j=0;j<=m;j++)
		{
			cout << dp[i][j] << " ";
		}
		cout << endl;
	}*/
	cout << dp[n][m] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:34: error: 'INF' was not declared in this scope
   20 |                         dp[i][j]=INF;
      |                                  ^~~
Language: C++

#include <iostream>
#define INF 99;
using namespace std;
int dp[23][50003],sum,num,ws[23];
int main(){
      cin >> sum >> num;
      for (int i = 0;i<num;i++)
            cin >> ws[i];
      for (int i = 0;i <= num ; i ++ ){
            for (int j = 1;  j  <= sum ; j ++ )
                  dp[i][j] = INF;
      }
       for (int i = 1;i <= num ; i++ ){
            for (int j = 0; j <= sum ; j++ ){
                  if(j >= ws[i-1])
                        dp[i][j] = min(dp[i-1][j],dp[i-1][j - ws[i-1]]+ 1);
                  else
                        dp[i][j] = dp[i-1][j];
            }
      }
      cout << dp[num][sum] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: reference to 'ws' is ambiguous
    8 |             cin >> ws[i];
      |                    ^~
In file included from /usr/include/c++/14/istream:1109,
                 from /usr/include/c++/14/iostream:42,
                 from a.cc:1:
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:4:27: note:                 'int ws [23]'
    4 | int dp[23][50003],sum,num,ws[23];
      |                           ^~
a.cc:15:27: error: reference to 'ws' is ambiguous
   15 |                   if(j >= ws[i-1])
      |                           ^~
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:4:27: note:                 'int ws [23]'
    4 | int dp[23][50003],sum,num,ws[23];
      |                           ^~
a.cc:16:63: error: reference to 'ws' is ambiguous
   16 |                         dp[i][j] = min(dp[i-1][j],dp[i-1][j - ws[i-1]]+ 1);
      |                                                               ^~
/usr/include/c++/14/bits/istream.tcc:1073:5: note: candidates are: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::ws(basic_istream<_CharT, _Traits>&)'
 1073 |     ws(basic_istream<_CharT, _Traits>& __in)
      |     ^~
a.cc:4:27: note:                 'int ws [23]'
    4 | int dp[23][50003],sum,num,ws[23];
      |                           ^~
Language: C++

#include <iostream>
#include <algorithm>

int n;
int m;
int ms[20];
int INF = 1000000000;
int dp[50000];

int pay ( int remained )
{
	if ( remained == 0 )
		return 0;
	if ( remained < 0 )
		return INF;
	if ( dp[remained] != -1 )
		return dp[remained];

	int result = INF;
	for ( int i = 0; i < m; ++i )
	{
		result = min( result, pay( remained - ms[ i ] ) + 1 );
	}
	return dp[ remained ] = result;	
}

int main()
{
	std::cin >> n >> m;
	for ( int i = 0; i < m; ++i )
		std::cin >> ms[ i ];
	for ( int i = 0; i < 50000; ++i )
		dp[ i ] = -1;

	std::cout << pay( n )  << std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int pay(int)':
a.cc:22:26: error: 'min' was not declared in this scope; did you mean 'std::min'?
   22 |                 result = min( result, pay( remained - ms[ i ] ) + 1 );
      |                          ^~~
      |                          std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: C++

#include <iostream>
#include <algorithm>

int n;
int m;
int ms[50];
int INF = 1000000000;
int dp[50010];

int pay ( int remained )
{
	if ( remained == 0 )
		return 0;
	if ( remained < 0 )
		return INF;
	if ( dp[remained] != -1 )
		return dp[remained];

	int result = INF;
	for ( int i = 0; i < m; ++i )
	{
		result = std::min( result, pay( remained - ms[ i ] ) + 1 );
	}
	return dp[ remained ] = result;	
}

int main()
{
	memset( dp, -1, sizeof( dp ) );
	std::cin >> n >> m;
	for ( int i = 0; i < m; ++i )
		std::cin >> ms[ i ];

	std::cout << pay( n )  << std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:9: error: 'memset' was not declared in this scope
   29 |         memset( dp, -1, sizeof( dp ) );
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 |
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <string>
#include <tuple>
#include <functional>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <map>
//#include "toollib.h"
#pragma warning (disable:4018)
#define INT 2147483647

using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	vector<int> c(m);
	vector<vector<int>> dp(m, vector<int>(n + 1, INT_MAX));
	for (int i = 0; i < m; i++) cin >> c[i];
	sort(c.begin(), c.end());
	for (int i = 0; i < m; i++) dp[i][0] = 0;
	for (int j = 1; j <= n; j++) dp[0][j] = j;
	for (int i = 1; i < m; i++) {
		for (int j = 1; j <= n; j++) {
			if (j - c[i] >= 0) dp[i][j] = min(dp[i][j - c[i]] + 1, dp[i - 1][j]);
			else dp[i][j] = dp[i - 1][j];
		}
	}
	cout << dp[m - 1][n] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:54: error: 'INT_MAX' was not declared in this scope
   22 |         vector<vector<int>> dp(m, vector<int>(n + 1, INT_MAX));
      |                                                      ^~~~~~~
a.cc:12:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   11 | #include <map>
  +++ |+#include <climits>
   12 | //#include "toollib.h"
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <string>
#include <tuple>
#include <functional>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <map>
//#include "toollib.h"
#pragma warning (disable:4018)
#define INT 2147483647

using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	vector<int> c(m);
	vector<vector<int>> dp(m, vector<int>(n + 1, INT_MAX));
	for (int i = 0; i < m; i++) cin >> c[i];
	sort(c.begin(), c.end());
	for (int i = 0; i < m; i++) dp[i][0] = 0;
	for (int j = 1; j <= n; j++) dp[0][j] = j;
	for (int i = 1; i < m; i++) {
		for (int j = 1; j <= n; j++) {
			if (j - c[i] >= 0) dp[i][j] = min(dp[i][j - c[i]] + 1, dp[i - 1][j]);
			else dp[i][j] = dp[i - 1][j];
		}
	}
	cout << dp[m - 1][n] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:54: error: 'INT_MAX' was not declared in this scope
   22 |         vector<vector<int>> dp(m, vector<int>(n + 1, INT_MAX));
      |                                                      ^~~~~~~
a.cc:12:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   11 | #include <map>
  +++ |+#include <climits>
   12 | //#include "toollib.h"
Language: C++

#include<iostream>
#include<algorithm>
 
using namespace std;
 
int main(){
    int n,m;
    cin >> n >> m;
    int num[m]
    int res[100000];
    for(int i = 0;i < m;i++){
    cin >> num[i];
    res[num[i]] = 1;
    }
    bool flag=true;
    while(flag){
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
        if(res[i] > 0 ){
            if(res[i+num[j]] == 0) res[i+num[j]] = res[i]+1;
            else{res[i+num[j]] = min(res[i+num[j]],res[i]+1);
            if(i+num[j] == n) flag = false;
            }
        }
        }
    }
    }
     
    cout << res[n]<< endl;
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: expected initializer before 'int'
   10 |     int res[100000];
      |     ^~~
a.cc:12:12: error: 'num' was not declared in this scope; did you mean 'enum'?
   12 |     cin >> num[i];
      |            ^~~
      |            enum
a.cc:13:5: error: 'res' was not declared in this scope
   13 |     res[num[i]] = 1;
      |     ^~~
a.cc:19:12: error: 'res' was not declared in this scope
   19 |         if(res[i] > 0 ){
      |            ^~~
a.cc:20:22: error: 'num' was not declared in this scope; did you mean 'enum'?
   20 |             if(res[i+num[j]] == 0) res[i+num[j]] = res[i]+1;
      |                      ^~~
      |                      enum
a.cc:29:13: error: 'res' was not declared in this scope
   29 |     cout << res[n]<< endl;
      |             ^~~
Language: C++

#include <iostream>
#include <algorithm>

int main() {
    int N, M;
    std::cin >> N >> M;

    std::vector<int> kind(M);
    for (int i = 0; i < M; ++i) std::cin >> kind[i];
    std::sort(race.begin(), race.end());

    std::vector<int> dp(N+1, N); dp[0] = 0;
    for (int i = 0; i < M; ++i)
        for (int j = kind[i]; j <= N; ++j)
            dp[j] = min(dp[j], dp[j - kind[j]] + 1);

    std::cout << dp[N] << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'vector' is not a member of 'std'
    8 |     std::vector<int> kind(M);
      |          ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <algorithm>
  +++ |+#include <vector>
    3 | 
a.cc:8:17: error: expected primary-expression before 'int'
    8 |     std::vector<int> kind(M);
      |                 ^~~
a.cc:9:45: error: 'kind' was not declared in this scope
    9 |     for (int i = 0; i < M; ++i) std::cin >> kind[i];
      |                                             ^~~~
a.cc:10:15: error: 'race' was not declared in this scope
   10 |     std::sort(race.begin(), race.end());
      |               ^~~~
a.cc:12:10: error: 'vector' is not a member of 'std'
   12 |     std::vector<int> dp(N+1, N); dp[0] = 0;
      |          ^~~~~~
a.cc:12:10: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:12:17: error: expected primary-expression before 'int'
   12 |     std::vector<int> dp(N+1, N); dp[0] = 0;
      |                 ^~~
a.cc:12:34: error: 'dp' was not declared in this scope
   12 |     std::vector<int> dp(N+1, N); dp[0] = 0;
      |                                  ^~
a.cc:14:22: error: 'kind' was not declared in this scope
   14 |         for (int j = kind[i]; j <= N; ++j)
      |                      ^~~~
a.cc:15:21: error: 'min' was not declared in this scope; did you mean 'std::min'?
   15 |             dp[j] = min(dp[j], dp[j - kind[j]] + 1);
      |                     ^~~
      |                     std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: C++

#include <bits/stdc++.h>

#define INF 1 << 30

typedef long long ll;

int main()
{
  int n, m; cin >> n >> m;
  vector<int> c(m);
  vector<int> T(n+1,INF);
  T[0] = 0;
  REP(i,m) cin >> c[i];
  REP(i,m) FOR(j,c[i],n)
    T[j] = min(T[j],T[j-c[i]]+1);
  cout << T[n] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |   int n, m; cin >> n >> m;
      |             ^~~
      |             std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:3: error: 'vector' was not declared in this scope
   10 |   vector<int> c(m);
      |   ^~~~~~
a.cc:10:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:10:10: error: expected primary-expression before 'int'
   10 |   vector<int> c(m);
      |          ^~~
a.cc:11:10: error: expected primary-expression before 'int'
   11 |   vector<int> T(n+1,INF);
      |          ^~~
a.cc:12:3: error: 'T' was not declared in this scope
   12 |   T[0] = 0;
      |   ^
a.cc:13:7: error: 'i' was not declared in this scope
   13 |   REP(i,m) cin >> c[i];
      |       ^
a.cc:13:3: error: 'REP' was not declared in this scope
   13 |   REP(i,m) cin >> c[i];
      |   ^~~
a.cc:16:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |   cout << T[n] << 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:16:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |   cout << T[n] << endl;
      |                   ^~~~
      |                   std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>

#define INF 1 << 30

using namespace std;

int main()
{
  int n, m; cin >> n >> m;
  vector<int> c(m);
  vector<int> T(n+1,INF);
  T[0] = 0;
  REP(i,m) cin >> c[i];
  REP(i,m) FOR(j,c[i],n)
    T[j] = min(T[j],T[j-c[i]]+1);
  cout << T[n] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: 'i' was not declared in this scope
   13 |   REP(i,m) cin >> c[i];
      |       ^
a.cc:13:3: error: 'REP' was not declared in this scope
   13 |   REP(i,m) cin >> c[i];
      |   ^~~
Language: C++

#include <bits/stdc++.h>

#define REP(i,n) for(int i=0;i<n;i++)
#define INF 1 << 30

using namespace std;

int main()
{
  int n, m; cin >> n >> m;
  vector<int> c(m);
  vector<int> T(n+1,INF);
  T[0] = 0;
  REP(i,m) cin >> c[i];
  REP(i,m) FOR(j,c[i],n)
    T[j] = min(T[j],T[j-c[i]]+1);
  cout << T[n] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: 'j' was not declared in this scope
   15 |   REP(i,m) FOR(j,c[i],n)
      |                ^
a.cc:15:12: error: 'FOR' was not declared in this scope
   15 |   REP(i,m) FOR(j,c[i],n)
      |            ^~~
Language: C++

#include <algorithm>
#include <iostream>

using namespace std;

const int INF (1<<28);
const int MAX_M = 20;
const int MAX_N = 50000;

int COINS[MAX_M+1];
int CNTS[MAX_M+1][MAX_N+1];

int main() {
  int n, m; cin >> n >> m;

  for (int i = 1; i <= m; i++)
    cin >> COINS[i];

  memset(CNTS, 0, sizeof(CNTS));

  for (int i = 0; i <= n; i++) CNTS[0][i] = INF;

  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      if (j - COINS[i] < 0)
        CNTS[i][j] = CNTS[i-1][j];
      else
        CNTS[i][j] = min(CNTS[i][j-COINS[i]] + 1, CNTS[i-1][j]);
    }
  }

  cout << CNTS[m][n] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: 'memset' was not declared in this scope
   19 |   memset(CNTS, 0, sizeof(CNTS));
      |   ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <iostream>
  +++ |+#include <cstring>
    3 |
Language: C++

#include<iostream>
using namespace std;

int dp[50000] = { 0 };
int n,m,c[20];

solve(int money){
 if(money==0)return 0;
 if(dp[money] != 0) return dp[money];
 int min = 1 << 30,ans; 
 for(int i=0; i < m;i++){
  ans = solve(money-c[i])+1;
  if(ans > min) ans = min;
 }
 dp[money] = ans;
 return dp[money];
}

int main(){
 cin >> n;
 cin >> m;
 for(int i = 0;i < m;i++){
  cin >> c[i];
 }
 cout << solve(n);
}

Compiler output:
a.cc:7:1: error: ISO C++ forbids declaration of 'solve' with no type [-fpermissive]
    7 | solve(int money){
      | ^~~~~
Language: C++

#include <iostream>

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

const int INF = 1e9;

using namespace std;

int m, n;
int c[21];

int dp[100005][21];

int dfs(int i, int sum) {
    if (i == m) {
        if (n == sum)
            return 0;
        else
            return INF;
    }
    if (dp[i][sum] != -1) return dp[i][sum];
    int ret;
    ret = dfs(i + 1, sum);
    if (sum + c[i] <= n) ret = min(ret, dfs(i, sum + c[i]) + 1);

    return dp[i][sum] = ret;
}

int main() {
    memset(dp, -1, sizeof(dp));
    cin >> n >> m;
    rep(i, m) cin >> c[i];
    cout << dfs(0, 0) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: 'memset' was not declared in this scope
   30 |     memset(dp, -1, sizeof(dp));
      |     ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 |
Language: C++

n, m = [int(el) for el in input().split(' ')]
c = [int(el) for el in input().split(' ')]

t = [0] + [float('inf') for _ in range(n)]

for i in range(m):
    for j in range(c[i], n+1):
        t[j] = min(t[j], t[j-c[i]] + 1)
        print(t)

print(t[n])

Compiler output:
a.cc:4:18: warning: multi-character character constant [-Wmultichar]
    4 | t = [0] + [float('inf') for _ in range(n)]
      |                  ^~~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n, m = [int(el) for el in input().split(' ')]
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
	cin.tie(0); ios::sync_with_stdio(false);
	int n, m; cin >> n >> m;
	vector<long long> dp(n + 10001, INT_MAX);
	vector<int> c(m, 0);
	for (int i = 0; i < m;i++) {
		cin >> c[i];
	}
	for (int i = 1; i <= n + 10000;i++) {
		for (auto val : c) {
			if (i - val < 0) continue;
			if (dp[i - val] == INT_MAX) {
				dp[i] = 1; continue;
			}
			dp[i] = min(dp[i], dp[i - val] + 1);
		}
	}
	cout << dp[n] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:41: error: 'INT_MAX' was not declared in this scope
    8 |         vector<long long> dp(n + 10001, INT_MAX);
      |                                         ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <algorithm>
  +++ |+#include <climits>
    4 | using namespace std;
Language: C++

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

using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;

#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)

#define vint(v, n) vector<int> v(n); REP(i,n) cin >> v[i];
#define vvint(v, w, n) vector<int> v(n); vector<int> w(n); REP(i,n) cin >> v[i] >> w[i];
#define vlint(v, n) vector<ll int> v(n); REP(i,n) cin >> v[i];
#define vdouble(v, n) vector<double> v(n); REP(i,n) cin >> v[i];
#define vvdoube(v, n1, n2) vector<vector<double> > v(n1, vector<double>(n2, 0)); REP(i,n1) REP(j,n1) cin >> v[i][j];
#define string(x) string x; cin >> x;
#define vstring(v, n) vector<string> v(n); REP(i,n){string a; std::cin >> a; v.push_back(a); }

#define all(v) (v).begin(), (v).end()
#define rall(v) (v).begin(), (v).end(), std::greater<int>()
#define len(v) (v).length()

static const string abet("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
static const long long int MOD = 1000000007;
static const double PI=3.1415926535897932;
static const int INF = 0x3f3f3f3f;
static const int INFTY = (1 << 29);
static const long long LINFTY = (1LL << 32);

static const int dy4[]={0, 0, 1, -1};
static const int dx4[]={1, -1, 0, 0};
static const int dx8[] = {1, 1, 1, 0, 0, -1, -1, -1};
static const int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1};

int coin_optimize(int N, vector<int> c) {

  vector<int> dp(N+1, INF); dp[0]=0;

  REP(i, m) REPS(j, c[i], N+1) dp[j] = min(dp[j], dp[j-c[i]]+1);

  return dp[N];
}


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

  int N, W;
  cin >> N >> W;
  vint(c, N);

  cout << coin_optimize(N, c) << endl;

}

Compiler output:
a.cc: In function 'int coin_optimize(int, std::vector<int>)':
a.cc:44:10: error: 'm' was not declared in this scope
   44 |   REP(i, m) REPS(j, c[i], N+1) dp[j] = min(dp[j], dp[j-c[i]]+1);
      |          ^
a.cc:10:46: note: in definition of macro 'REPS'
   10 | #define REPS(i, a, n) for (int i = (a); i < (n); ++i)
      |                                              ^
a.cc:44:3: note: in expansion of macro 'REP'
   44 |   REP(i, m) REPS(j, c[i], N+1) dp[j] = min(dp[j], dp[j-c[i]]+1);
      |   ^~~
Language: C++

#include<iostream>
#define INF 999999999

using namespace std;

const int MAX_N = 50000;
const int MAX_M = 20;

int dp[MAX_M+1][MAX_N+1];
int c[MAX_N];

int main()
{
	int n,m;
	cin >> n >> m;
	for(int i=0;i<m;i++){
		cin >> c[i];
	}
	sort(c,c+m);
	for(int i=0;i<=m;i++){
		dp[i][0] = 0;
	}
	for(int j=0;j<=n;j++){
		dp[0][j] = INF;
	}
	for(int i=1;i<=m;i++){
		for(int j=1;j<=n;j++){
			if(j>=c[i-1]){
				dp[i][j] = min(dp[i-1][j],dp[i-1][j-c[i-1]] + 1);
			}else{
				dp[i][j] = dp[i-1][j];
			}
		}
	}
	cout << dp[m][n] << "\n";
}

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

#include <iostream>
#include <iostream>
using namespace std;
int main(){
	int n=0,m=0,c=0,a[500001]={};
	while (cin >> n >> m;){
	for (int i=1; i<=n; i++){
		a[i]=i;
	}
	for (int i=0; i<m; i++){
		cin >> c;
		a[c]=1;
	}
	for (int i=1; i<=n; i++){
		for (int j=1; j<n/2+2; j++){
			if (a[i]>a[j]+a[i-j]) a[i]=a[j]+a[i-j];
		}
	}
	cout << a[n] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:29: error: expected ')' before ';' token
    6 |         while (cin >> n >> m;){
      |               ~             ^
      |                             )
a.cc:6:30: error: expected primary-expression before ')' token
    6 |         while (cin >> n >> m;){
      |                              ^
Language: C++

import java.util.Scanner;
class Main {
	public static void main(String[] args){
	  Scanner s=new Scanner(System.in);
	  int n=s.nextInt();
	  int m=s.nextInt();
	  int R[]=new int[m];
	  int count=0;
	  for(int i=0;i<m;i++){
		  R[i]=s.nextInt();
	  }
	  for(int i=m-1;i>=0;i--){
		  while(n>=R[i]){
	    		n-=R[i];
	    		count++;
	    	}
		 
	  }	  
	  System.out.println(count); 
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:15: error: expected ':' before 'static'
    3 |         public static void main(String[] args){
      |               ^~~~~~~
      |               :
a.cc:3:33: error: 'String' has not been declared
    3 |         public static void main(String[] args){
      |                                 ^~~~~~
a.cc:3:42: error: expected ',' or '...' before 'args'
    3 |         public static void main(String[] args){
      |                                          ^~~~
a.cc:21:2: error: expected ';' after class definition
   21 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:4:11: error: 'Scanner' was not declared in this scope
    4 |           Scanner s=new Scanner(System.in);
      |           ^~~~~~~
a.cc:5:17: error: 's' was not declared in this scope
    5 |           int n=s.nextInt();
      |                 ^
a.cc:7:19: error: initializer fails to determine size of 'R'
    7 |           int R[]=new int[m];
      |                   ^~~~~~~~~~
a.cc:7:19: error: array must be initialized with a brace-enclosed initializer
a.cc:19:11: error: 'System' was not declared in this scope
   19 |           System.out.println(count);
      |           ^~~~~~
Language: C++

#include <iostream>
#include <stdio>

using namespace std;

int main(){
	int n, m, c[20];
	//input
	scanf(" %d %d", &n, &m);
	for(int i=0; i<m; ++i) scanf(" %d", &c[i]);	
	
	//solve
	
	//dp[i]:=i?????????????????????????????????????????????????°??????°
	int dp[50001] = {0};
	//???????????§????????°??§?????????
	for(int i=1; i<=50000; ++i) dp[i] = 100000;
	
	for(int i=0; i<=50000; ++i){
		for(int j=0; j<m; ++j){
			if(i+c[j]<=n){
				dp[i+c[j]] = min(dp[i+c[j]],dp[i]+1);	
			}
		}	
	}
	
	printf("%d\n", dp[n]);
}

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

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

int main(){
	int n, m, c[20];
	//input
	scanf(" %d %d", &n, &m);
	for(int i=0; i<m; ++i) scanf(" %d", &c[i]);	
	
	//solve
	
	//dp[i]:=i?????????????????????????????????????????????????°??????°
	int dp[50001] = {0};
	//???????????§????????°??§?????????
	for(int i=1; i<=50000; ++i) dp[i] = 100000;
	
	for(int i=0; i<=50000; ++i){
		for(int j=0; j<m; ++j){
			if(i+c[j]<=n){
				dp[i+c[j]] = min(dp[i+c[j]],dp[i]+1);	
			}
		}	
	}
	
	printf("%d\n", dp[n]);
}

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

#include <stdio.h>
#include <iostream>


int main(){
	int n, m, c[20];
	//input
	std:: scanf(" %d %d", &n, &m);
	for(int i=0; i<m; ++i) {
std:: scanf(" %d", &c[i]);	
	}
	//solve
	
	//dp[i]:=i?????????????????????????????????????????????????°??????°
	int dp[50001] = {0};
	//???????????§????????°??§?????????
	for(int i=1; i<=50000; ++i) dp[i] = 100000;
	
	for(int i=0; i<=50000; ++i){
		for(int j=0; j<m; ++j){
			if(i+c[j]<=n){
				dp[i+c[j]] = min(dp[i+c[j]],dp[i]+1);	
			}
		}	
	}
	
	std::printf("%d\n", dp[n]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:46: error: 'min' was not declared in this scope; did you mean 'std::min'?
   22 |                                 dp[i+c[j]] = min(dp[i+c[j]],dp[i]+1);
      |                                              ^~~
      |                                              std::min
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
Language: C++

#include <stdio.h>
#include <iostream>


int main(){
	int n, m, c[20];
	//input
std:: scanf(" %d %d", &n, &m);
	for(int i=0; i<m; ++i) {
std:: scanf(" %d", &c[i]);	
	}
	//solve
	
	//dp[i]:=i?????????????????????????????????????????????????°??????°
	int dp[50001] = {0};
	//???????????§????????°??§?????????
	for(int i=1; i<=50000; ++i) dp[i] = 100000;
	
	for(int i=0; i<=50000; ++i){
		for(int j=0; j<m; ++j){
			if(i+c[j]<=n){
				dp[i+c[j]] = min(dp[i+c[j]],dp[i]+1);	
			}
		}	
	}
	
	std:: printf("%d\n", dp[n]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:46: error: 'min' was not declared in this scope; did you mean 'std::min'?
   22 |                                 dp[i+c[j]] = min(dp[i+c[j]],dp[i]+1);
      |                                              ^~~
      |                                              std::min
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
Language: C++

#include<iostream>
using namespace std;

const int inf = 555555;

int main(){

  int n,m;

  cin >> n >> m;

  int coin[m];

  for(int i=0; i<m; i++){
    cin >> coin[i];
  }

  int dp[m+1][n+1];

  for(int i=0; i<n+1; i++){
    dp[0][i] = inf;
  }

  for(int i=1; i<m+1; i++){
    for(int j=0; j<n+1; j++){
      if(j < coin[i-1]){
        dp[i][j] = dp[i-1][j];
      }
      else{
        if(dp[i][j-coin[i-1]] == inf){
          dp[i][j] = 1;
        }else{
          dp[i][j] = min(dp[i-1][j] ,dp[i][j-coin[i-1]] + 1);#include<iostream>
using namespace std;

const int inf = 555555;

int main(){

  int n,m;

  cin >> n >> m;

  int coin[m];

  for(int i=0; i<m; i++){
    cin >> coin[i];
  }

  int dp[m+1][n+1];

  for(int i=0; i<n+1; i++){
    dp[0][i] = inf;
  }

  for(int i=1; i<m+1; i++){
    for(int j=0; j<n+1; j++){
      if(j < coin[i-1]){
        dp[i][j] = dp[i-1][j];
      }
      else{
        if(dp[i][j-coin[i-1]] == inf){
          dp[i][j] = 1;
        }else{
          dp[i][j] = min(dp[i-1][j] ,dp[i][j-coin[i-1]] + 1);
        }
      }
    }
  }

  cout << dp[m][n] << endl;

  return 0;
}

        }
      }
    }
  }

  cout << dp[m][n] << endl;

  return 0;
}

Compiler output:
a.cc:33:62: error: stray '#' in program
   33 |           dp[i][j] = min(dp[i-1][j] ,dp[i][j-coin[i-1]] + 1);#include<iostream>
      |                                                              ^
a.cc: In function 'int main()':
a.cc:33:63: error: 'include' was not declared in this scope
   33 |           dp[i][j] = min(dp[i-1][j] ,dp[i][j-coin[i-1]] + 1);#include<iostream>
      |                                                               ^~~~~~~
a.cc:33:79: error: expected primary-expression before '>' token
   33 |           dp[i][j] = min(dp[i-1][j] ,dp[i][j-coin[i-1]] + 1);#include<iostream>
      |                                                                               ^
a.cc:34:1: error: expected primary-expression before 'using'
   34 | using namespace std;
      | ^~~~~
a.cc:38:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   38 | int main(){
      |         ^~
a.cc:38:9: note: remove parentheses to default-initialize a variable
   38 | int main(){
      |         ^~
      |         --
a.cc:38:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:38:11: error: a function-definition is not allowed here before '{' token
   38 | int main(){
      |           ^
Language: C++

#include <stdio.h>
#include <cstdio>
#include <algorithm>
#include <cstring>

int N, M;
int C[21];
int dp[21][30000];

int calc(int, int);

int main(void){
	scanf("%d %d", &N, &M);

	for(int i = 0;i < M;++i){
		scanf("%d", &C[i]);
	}

	memset(dp, -1, sizeof(dp));

	printf("%d\n", calc(M, N));
}

int calc(int i, int j){
	if(dp[i][j] >= 0){
		return dp[i][j];
	}

	if(i == 1) return j;

	int t = 50001;

	for(int k = 0;k <= j/C[i-1];++k){
		t = min(t, calc(i-1, j-(k*C[i-1])) + k);
	}

	dp[i][j] = t;

	return t;
}


Compiler output:
a.cc: In function 'int calc(int, int)':
a.cc:34:21: error: 'min' was not declared in this scope; did you mean 'std::min'?
   34 |                 t = min(t, calc(i-1, j-(k*C[i-1])) + k);
      |                     ^~~
      |                     std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: C++

# include <bits/stdc++.h>

# define F first
# define S second
# define mp make_pair
// everything go according to my plan
# define pb push_back
# define sz(a) (int)(a.size())
# define vec vector
// shimkenttin kyzdary, dzyn, dzyn, dzyn...
# define y1    Y_U_NO_y1
# define left  Y_U_NO_left
# define right Y_U_NO_right

using namespace std;

typedef pair <int, int> pii;
typedef long long ll;
typedef long double ld;

const int Mod = (int)1e9 + 7;
const int MX = 1073741822;
const ll MXLL = 4e18;
const int Sz = 1110111;
// a pinch of soul
inline void Read_rap () {
  ios_base :: sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}
inline void randomizer3000 () {
  unsigned int seed;
  asm ("rdtsc" : "=A"(seed));
  srand (seed);
}
void files (string problem) {
  if (fopen ((problem + ".in").c_str(),"r")) {
    freopen ((problem + ".in").c_str(),"r",stdin);
    freopen ((problem + ".out").c_str(),"w",stdout);
  }
}
void localInput (string in = "s") {
  if (fopen (in.c_str(), "r"))
    freopen (in.c_str(), "r", stdin);
  else
    cerr << "Input file not found" << endl;
}
const int N = 5e4 + 1;

int dp[N];

int n, m; 

int main()
{
	localinput();
	Read_rap();             
  cin >> n >> m;            
  fill (dp + 1, dp + n + 1, MX);
          
  for (int i = 1; i <= m; i++) {
  	int x; cin >> x;
  	for (int j = 0; j + x <= n; j++)
  		dp[j + x] = min (dp[j + x], dp[j] + 1);
  }        
  cout << dp[n];


  cout << endl;

  return 0;
}










// Coded by Z..



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

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

using namespace std;

int solve(int n, int s, vector<int> d){
	vector<int> dp(n+1, INT_MAX); //Generate a Vector, of Size n+1, and Filled with INT_MAX
	dp[0] = 0; //Initialize dp[0] to 0
	for(int i = 0; i < s; i++){ //Iterate from 0 -> s
		for(int j = 0; (j + d[i]) <= n; j++){ //Iterate from 
			if(dp[j] != INT_MAX){
				dp[j+d[i]] = min(dp[j+d[i]], dp[j]+1);
			}
		}
    }
	return dp[n];
}

int main(){
	int n, m;
	cin >> n >> m;
	vector<int> x(m);
	for(int i = 0; i < m; i++){
		cin >> x[i];
	} //Finished Resolving Inputs
	cout << solve(n, m, x) << endl; //Perform Solve Function
}


Compiler output:
a.cc: In function 'int solve(int, int, std::vector<int>)':
a.cc:8:29: error: 'INT_MAX' was not declared in this scope
    8 |         vector<int> dp(n+1, INT_MAX); //Generate a Vector, of Size n+1, and Filled with INT_MAX
      |                             ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include<algorithm>
  +++ |+#include <climits>
    4 |