criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import static java.lang.System.out;
import java.util.*;
import java.io.*;
public class Coinchangingproblem
{
    public static void Coinchangingproblem(String[] args) throws Exception
    {
        //out.println("hi");
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader scan = new BufferedReader(isr);
        StringTokenizer cut = new StringTokenizer(scan.readLine());
        
        int a = Integer.parseInt(cut.nextToken());
        int b = Integer.parseInt(cut.nextToken());
        
        int[] one = new int[b];
        int[] two = new int[a + 1];
        //ArrayList<Integer> coin = new ArrayList<Integer>();
        
        cut = new StringTokenizer(scan.readLine());
        int temp;
        int count = 0;
        for (int z = 0; z < b; z++)
        {
            temp = Integer.parseInt(cut.nextToken());
            //out.println("temp is" + temp);
            
                one[count] = temp;
                //out.println("placed coin " + one[count] + " into pool..");
                count++;
            
            }
        
        boolean go = true;
        
        int answer = 99999;
        two[0] = 0;
        //out.println("Two[0] is: 0");
        for (int z = 1; z < a + 1; z++)
        {
            answer = 99999;
            //out.println("Resetting, Z is now " + z);
            for (int y = 0; y < b; y++)
            {
                //out.println("Checking coin " + one[y]);
                if (one[y] <= z && two[z-one[y]] < answer)
                {                   
                    //out.println("Value for two[" + z + "] changing to " + two[z-one[y]]);
                    answer = two[z-one[y]];
                }
                //else out.println("nothing happened");
            }
            two[z] = answer + 1;
            //out.println("Two[" + z + "] is: " + two[z]);
        }
        out.println(two[a]);
    }
}

Compiler output:
Main.java:6: error: class Coinchangingproblem is public, should be declared in a file named Coinchangingproblem.java
public class Coinchangingproblem
       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import static java.lang.System.out;
import java.util.*;
import java.io.*;
public class Coinchangingproblem
{
    public static void Coinchangingproblem(String[] args) throws Exception
    {
        out.println("hi");
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader scan = new BufferedReader(isr);
        StringTokenizer cut = new StringTokenizer(scan.readLine());
        
        int a = Integer.parseInt(cut.nextToken());
        int b = Integer.parseInt(cut.nextToken());
        
        int[] one = new int[b];
        int[] two = new int[a + 1];
        //ArrayList<Integer> coin = new ArrayList<Integer>();
        
        cut = new StringTokenizer(scan.readLine());
        int temp;
        int count = 0;
        for (int z = 0; z < b; z++)
        {
            temp = Integer.parseInt(cut.nextToken());
            //out.println("temp is" + temp);
            
                one[count] = temp;
                //out.println("placed coin " + one[count] + " into pool..");
                count++;
            
            }
        
        boolean go = true;
        
        int answer = 99999;
        two[0] = 0;
        //out.println("Two[0] is: 0");
        for (int z = 1; z < a + 1; z++)
        {
            answer = 99999;
            //out.println("Resetting, Z is now " + z);
            for (int y = 0; y < b; y++)
            {
                //out.println("Checking coin " + one[y]);
                if (one[y] <= z && two[z-one[y]] < answer)
                {                   
                    //out.println("Value for two[" + z + "] changing to " + two[z-one[y]]);
                    answer = two[z-one[y]];
                }
                //else out.println("nothing happened");
            }
            two[z] = answer + 1;
            //out.println("Two[" + z + "] is: " + two[z]);
        }
        out.println(two[a]);
    }
}

Compiler output:
Main.java:6: error: class Coinchangingproblem is public, should be declared in a file named Coinchangingproblem.java
public class Coinchangingproblem
       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import static java.lang.System.out;
import java.util.*;
import java.io.*;
public class Coinchangingproblem
{
    public static void main(String[] args) throws Exception
    {
        out.println("hi");
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader scan = new BufferedReader(isr);
        StringTokenizer cut = new StringTokenizer(scan.readLine());
        
        int a = Integer.parseInt(cut.nextToken());
        int b = Integer.parseInt(cut.nextToken());
        
        int[] one = new int[b];
        int[] two = new int[a + 1];
        //ArrayList<Integer> coin = new ArrayList<Integer>();
        
        cut = new StringTokenizer(scan.readLine());
        int temp;
        int count = 0;
        for (int z = 0; z < b; z++)
        {
            temp = Integer.parseInt(cut.nextToken());
            //out.println("temp is" + temp);
            
                one[count] = temp;
                //out.println("placed coin " + one[count] + " into pool..");
                count++;
            
            }
        
        boolean go = true;
        
        int answer = 99999;
        two[0] = 0;
        //out.println("Two[0] is: 0");
        for (int z = 1; z < a + 1; z++)
        {
            answer = 99999;
            //out.println("Resetting, Z is now " + z);
            for (int y = 0; y < b; y++)
            {
                //out.println("Checking coin " + one[y]);
                if (one[y] <= z && two[z-one[y]] < answer)
                {                   
                    //out.println("Value for two[" + z + "] changing to " + two[z-one[y]]);
                    answer = two[z-one[y]];
                }
                //else out.println("nothing happened");
            }
            two[z] = answer + 1;
            //out.println("Two[" + z + "] is: " + two[z]);
        }
        out.println(two[a]);
    }
}

Compiler output:
Main.java:6: error: class Coinchangingproblem is public, should be declared in a file named Coinchangingproblem.java
public class Coinchangingproblem
       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import static java.lang.System.out;
import java.util.*;
import java.io.*;
public class Coinchangingproblem
{
    public static void main(String[] args) throws Exception
    {
        out.println("hi");
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader scan = new BufferedReader(isr);
        StringTokenizer cut = new StringTokenizer(scan.readLine());
        
        int a = Integer.parseInt(cut.nextToken());
        int b = Integer.parseInt(cut.nextToken());
        
        int[] one = new int[b];
        int[] two = new int[a + 1];
        //ArrayList<Integer> coin = new ArrayList<Integer>();
        
        cut = new StringTokenizer(scan.readLine());
        int temp;
        int count = 0;
        for (int z = 0; z < b; z++)
        {
            temp = Integer.parseInt(cut.nextToken());
            //out.println("temp is" + temp);
            
            one[count] = temp;
            //out.println("placed coin " + one[count] + " into pool..");
            count++;
            
        }
        
        boolean go = true;
        
        int answer = 99999;
        two[0] = 0;
        //out.println("Two[0] is: 0");
        for (int z = 1; z < a + 1; z++)
        {
            answer = 99999;
            //out.println("Resetting, Z is now " + z);
            for (int y = 0; y < b; y++)
            {
                //out.println("Checking coin " + one[y]);
                if (one[y] <= z && two[z-one[y]] < answer)
                {                   
                    //out.println("Value for two[" + z + "] changing to " + two[z-one[y]]);
                    answer = two[z-one[y]];
                }
                //else out.println("nothing happened");
            }
            two[z] = answer + 1;
            //out.println("Two[" + z + "] is: " + two[z]);
        }
        out.println(two[a]);
    }
}

Compiler output:
Main.java:6: error: class Coinchangingproblem is public, should be declared in a file named Coinchangingproblem.java
public class Coinchangingproblem
       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import static java.lang.System.out;
import java.util.*;
import java.io.*;
public class Coinchangingproblem
{
    public static void main(String[] args) throws Exception
    {
        //out.println("hi");
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader scan = new BufferedReader(isr);
        StringTokenizer cut = new StringTokenizer(scan.readLine());
        
        int a = Integer.parseInt(cut.nextToken());
        int b = Integer.parseInt(cut.nextToken());
        
        int[] one = new int[b];
        int[] two = new int[a + 1];
        //ArrayList<Integer> coin = new ArrayList<Integer>();
        
        cut = new StringTokenizer(scan.readLine());
        int temp;
        int count = 0;
        for (int z = 0; z < b; z++)
        {
            temp = Integer.parseInt(cut.nextToken());
            //out.println("temp is" + temp);
            
            one[count] = temp;
            //out.println("placed coin " + one[count] + " into pool..");
            count++;
            
        }
        
        boolean go = true;
        
        int answer = 99999;
        two[0] = 0;
        //out.println("Two[0] is: 0");
        for (int z = 1; z < a + 1; z++)
        {
            answer = 99999;
            //out.println("Resetting, Z is now " + z);
            for (int y = 0; y < b; y++)
            {
                //out.println("Checking coin " + one[y]);
                if (one[y] <= z && two[z-one[y]] < answer)
                {                   
                    //out.println("Value for two[" + z + "] changing to " + two[z-one[y]]);
                    answer = two[z-one[y]];
                }
                //else out.println("nothing happened");
            }
            two[z] = answer + 1;
            //out.println("Two[" + z + "] is: " + two[z]);
        }
        out.println(two[a]);
    }
}

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

#include<stdio.h>
int main(void){
	int n; //n円を支払う
	int m; //m種類のコイン
	scanf("%d",&n);   scanf("%d",&m);
	int coin[m]; //コインの金額
	int i,j;
	int dp[50001];
	int min;
	for(i=0;i<m;i++){
		scanf("%d",&coin[i]);
	}
	for(i=0;i<n+1;i++){
    	dp[i]=i;  　　　//求めたい金額につき１円コイン＊金額分の枚数最低かかる
    }
    for(i =1;i<m;i++){		//1以外のコインについて
    	for(j=c[i];j<n+1;j++){  //そのコインより後ろはそのコインで払える
    		min = dp[j - c[i]]+1;　　//dp[510-500]+1 500円玉に両替
			if( min < dp[j] ){
				dp[j] = min;
			}
		}
	}
	printf("%d\n",dp[n]);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:14:19: error: stray '\343' in program
   14 |         dp[i]=i;  <U+3000><U+3000><U+3000>//<U+6C42><U+3081><U+305F><U+3044><U+91D1><U+984D><U+306B><U+3064><U+304D><U+FF11><U+5186><U+30B3><U+30A4><U+30F3><U+FF0A><U+91D1><U+984D><U+5206><U+306E><U+679A><U+6570><U+6700><U+4F4E><U+304B><U+304B><U+308B>
      |                   ^~~~~~~~
main.c:14:21: error: stray '\343' in program
   14 |         dp[i]=i;  <U+3000><U+3000><U+3000>//<U+6C42><U+3081><U+305F><U+3044><U+91D1><U+984D><U+306B><U+3064><U+304D><U+FF11><U+5186><U+30B3><U+30A4><U+30F3><U+FF0A><U+91D1><U+984D><U+5206><U+306E><U+679A><U+6570><U+6700><U+4F4E><U+304B><U+304B><U+308B>
      |                           ^~~~~~~~
main.c:14:23: error: stray '\343' in program
   14 |         dp[i]=i;  <U+3000><U+3000><U+3000>//<U+6C42><U+3081><U+305F><U+3044><U+91D1><U+984D><U+306B><U+3064><U+304D><U+FF11><U+5186><U+30B3><U+30A4><U+30F3><U+FF0A><U+91D1><U+984D><U+5206><U+306E><U+679A><U+6570><U+6700><U+4F4E><U+304B><U+304B><U+308B>
      |                                   ^~~~~~~~
main.c:17:15: error: 'c' undeclared (first use in this function)
   17 |         for(j=c[i];j<n+1;j++){  //そのコインより後ろはそのコインで払える
      |               ^
main.c:17:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:38: error: stray '\343' in program
   18 |                 min = dp[j - c[i]]+1;<U+3000><U+3000>//dp[510-500]+1 500<U+5186><U+7389><U+306B><U+4E21><U+66FF>
      |                                      ^~~~~~~~
main.c:18:40: error: stray '\343' in program
   18 |                 min = dp[j - c[i]]+1;<U+3000><U+3000>//dp[510-500]+1 500<U+5186><U+7389><U+306B><U+4E21><U+66FF>
      |                                              ^~~~~~~~
Language: C

// コイン問題
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<stack>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<cassert>

#include<vector>
#include<queue>
#include<set>

using namespace std;

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

// コインの額面を保持する配列
// ( １を開始とする配列 )
int C[MAX_N + 1];
// コインの枚数を保持する配列
int T[MAX_M + 1][MAX_N + 1];

// n : 支払額, m : コインの種類
int n, m;

int CoinProblem();

int main(void)
{

    // 配列の初期化
    for(int i = 0; i < MAX_M + 1; i++)
    {
        for(int j = 0; j < MAX_N + 1; j++)
        {
            if( j == 0 )
            {
                // 支払額がゼロの時は, コインは不要
                T[i][j] = 0;
            }
            else
            {
                // 初期値の設定
                T[i][j] = INF;
            }
        }
    }

    cin >> n >> m;

    for(int i = 1; i <= m; i++)
    {
        // 要素数：１からコインの要素を入れていく
        cin >> C[i];
    }

    // 動的計画法からコイン問題を解く
    CoinProblem();

    printf("%d\n", T[m][n]);

    return 0;
}

// コイン問題を解く関数
int CoinProblem()
{

    for(int j = 0; j <= n; j++)
    {
        for(int i = 1; i <= m; i++)
        {
            int num = j - C[i];

            if( num >= 0 )
            {
                // i番目のコインを使う時
                T[i][j] = T[i][num] + 1;
            }
            else
            {
                // i番目のコインを使わない時
                T[i][j] = T[i - 1][j];
            }

            // コインの枚数が少ない方を設定する
            T[i][j] = min(T[i - 1][j], T[i][j]);
        }
    }

    return 0;

}



Compiler output:
main.c:2:9: fatal error: cstdio: No such file or directory
    2 | #include<cstdio>
      |         ^~~~~~~~
compilation terminated.
Language: C

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define INF 1 << 30
#define EPS 1e-10
#define MAX_N 50000
#define MAX_M 20

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

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

int main(){
  scanf("%d%d", &n, &m);
  rep(i, m) scanf("%d", d+i);

  rep(i, MAX_M+1) rep(j, MAX_N+1) dp[i][j] = INF;
  dp[0][0] = 0;
  rep(i, m){
    rep(j, n+1){
      dp[i+1][j] = min(dp[i][j], dp[i+1][j-d[i]] + 1);
    }
  }

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

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>

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

using namespace std;

int main() {
  int n,m;
  cin>>n>>m;
  vector<int> v(m);
  REP(i,m)cin>>v[i];
  vector<vector<int>> dp(m+1,vector<int>(n+10001,100000000));
  dp[0][0] = 0;
  REP(i,m){
    REP(j,n+1){
      dp[i+1][j] = min(dp[i+1][j], dp[i][j]);
      dp[i][j+v[i]] = min(dp[i][j+v[i]], dp[i][j]+1);
    }
  }
  cout << dp[m][n] << endl;
  return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<stdlib.h>
#pragma warning (disable:4996)

int c[20];
int memo[50000][20] = { 0 };

int min_coin(int amount, int coinnum);

int main() {
	int n, m, i;
	scanf("%d %d", &n, &m);
	for (i = 0; i < m; i++) scanf("%d", &c[i]);
	printf("%d\n", min_coin(n, m - 1));
	return 0;
}

int min_coin(int amount, int coinnum) {
	if (memo[amount][coinnum] == 0) {
		if (amount < 0 || coinnum < 0) return 50001;
		else if (amount == c[coinnum]) return 1;
		else return memo[amount][coinnum] = min(min_coin(amount, coinnum - 1), min_coin(amount - c[coinnum], coinnum) + 1);
	}
	return memo[amount][coinnum];
}

Compiler output:
main.c: In function 'min_coin':
main.c:22:53: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   22 |                 else return memo[amount][coinnum] = min(min_coin(amount, coinnum - 1), min_coin(amount - c[coinnum], coinnum) + 1);
      |                                                     ^~~
      |                                                     main
Language: C

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

int c[20];
int memo[50000][20] = { 0 };

int min_coin(int amount, int coinnum);

int main() {
	int n, m, i;
	scanf("%d %d", &n, &m);
	for (i = 0; i < m; i++) scanf("%d", &c[i]);
	printf("%d\n", min_coin(n, m - 1));
	return 0;
}

int min_coin(int amount, int coinnum) {
	if (memo[amount][coinnum] == 0) {
		if (amount < 0 || coinnum < 0) return 50001;
		else if (amount == c[coinnum]) return 1;
		else {
			memo[amount][coinnum] = min(min_coin(amount, coinnum - 1), min_coin(amount - c[coinnum], coinnum) + 1);
			return memo[amount][coinnum];
		}
	}
	else return memo[amount][coinnum];
}

Compiler output:
main.c: In function 'min_coin':
main.c:22:49: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   22 |                         memo[amount][coinnum] = min(min_coin(amount, coinnum - 1), min_coin(amount - c[coinnum], coinnum) + 1);
      |                                                 ^~~
      |                                                 main
Language: C

/*************************************************************************
    > File Name: Coin_Changing_Problem.cpp
    > Author: Frade
    > Mail: frade@vip.sina.com.cn 
    > Created Time: 2017年05月02日 星期二 16?09分33秒
 ************************************************************************/

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

int Getint()
{
    char c = getchar();
    bool flag = false;
    int ans = 0;
    while(c != '-' && (c <'0' || c > '9'))c = getchar();
    if(c == '-')flag = true,c = getchar();
    while(c >= '0' && c <= '9')ans = ans*10 + c - '0',c = getchar();
    return (flag == true) ? -ans : ans;
}

const int maxn = 50000;

int w[maxn],f[maxn];

int main()
{
	for(int j = 1;j < maxn; j++)f[j] = -999999;

	int W = Getint();
	int N = Getint();
	for(int i = 1;i <= N; i++)w[i] = Getint();

	f[0] = 0;

	for(int i = 1;i <= N; i++)
	{
		for(int j = w[i];j <= W; j++)
		{
			if(f[j] <= 0)f[j] = max(f[j],f[j-w[i]]+1);
			else f[j] = min(f[j],f[j-w[i]]+1);
		}
	}
	printf("%d\n",f[W]);
    return 0;
}

Compiler output:
main.c:8:10: fatal error: iostream: No such file or directory
    8 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include "dpcoin.h"
#include <stdio.h>
#include <stdlib.h>
#define INFINITY 99999;

int main(void) {
  int i,j,d,n,m,*C,*T;
  
  if (scanf("%d %d",&n,&m) < 2) exit(1);
  C = malloc(m*sizeof(int));
  for (i=0;i<m;i++) {
    if (scanf("%d",&d) < 1) exit(1);
    C[i] = d;
  }
  
  T = malloc((n+1)*sizeof(int));
  for (i=0;i<=n;i++) T[i] = INFINITY;
  T[0] = 0;
  for (i=0;i<m;i++) {
    for (j=C[i];j<=n;j++) {
      if (T[j] > T[j-C[i]]+1) T[j] = T[j-C[i]]+1;
    }
  }
  
  printf("%d\n",T[n]);
  
  return 0;
}

Compiler output:
main.c:1:10: fatal error: dpcoin.h: No such file or directory
    1 | #include "dpcoin.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
 
int main(
{
    int n, m, i, j;
    scanf("%d", &n);
    scanf("%d", &m);
    int a[n];
    int c[n];
    for(i = 0; i < m; i++) { 
        scanf("%d", c+i);
    }
    a[0] = 0;
    for(i = 1; i < n + 1; i++) { 
        a[i] = 50001;
        for(j = 0; j < m; j++) { 
            if (i - c[j] >= 0 ) {
                if (a[i] > (1 + a[i - c[j]])) {
                    a[i] =  1 + a[i - c[j]];
                }
            }
        }
    }
    printf("%d", a[n]);
    return 0;
}

Compiler output:
main.c:4:1: error: expected declaration specifiers or '...' before '{' token
    4 | {
      | ^
Language: C

#include<stdio.h>
#define MAX 21
#define XMAX 50001


int min(int a,int b){
 if(a<b)return a;

return b;
}



void func(int A[],int n,int m){
int X[XMAX];
int Y[XMAX];
int i,j;

for(i=1;i<=n;i++)X[i]=i;

for(i=1;i<m;i++){/*たて*/

 if(i%2==1){

    for(j=1;j<=n;j++){/*よこ*/
       if(A[i]>j)Y[j]=X[j];
       else if(j%A[i]==0)Y[j]=j/A[i];
       else if(A[i]<j)Y[j]=j/A[i]+Y[j%A[i]];

       Y[j]=min(Y[j],X[j]);
    }

 }


 else if(i%2==0){

    for(j=1;j<=n;j++){/*よこ*/
       if(A[i]>j)X[j]=Y[j];
       else if(j%A[i]==0)X[j]=j/A[i];
       else if(A[i]<j)X[j]=j/A[i]+X[j%A[i]];

       X[j]=min(Y[j],X[j]);
    }

 }



}

/*
if(m%2==1)printf("%d\n",X[n]);
else if(m%2==0)printf("%d\n",Y[n]);
*/
printf("%d\n",min(X[n],Y[x]));
return;
}

void swap(int A[],int a,int b){
int temp;
temp=A[a];
A[a]=A[b];
A[b]=temp;

return;
}


void bubblesort(int A[],int m){
int i,j;

for(i=1;i<m;i++){
 for(j=0;j<m-i;j++){
   if(A[j]>A[j+1])swap(A,j,j+1);
 }
}


return;
}







int main(){
int n,m,i;
int A[MAX];

scanf("%d %d",&n,&m);
for(i=0;i<m;i++)scanf("%d",&A[i]);


bubblesort(A,m);


func(A,n,m);

return 0;
}


Compiler output:
main.c: In function 'func':
main.c:56:26: error: 'x' undeclared (first use in this function)
   56 | printf("%d\n",min(X[n],Y[x]));
      |                          ^
main.c:56:26: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#define MAX 21
#define XMAX 50001


int min(int a,int b){
 if(a<b)return a;

return b;
}



void func(int A[],int n,int m){
int X[XMAX];
int Y[XMAX];
int i,j;

for(i=1;i<=n;i++)X[i]=i;

for(i=1;i<m;i++){/*たて*/

 if(i%2==1){

    for(j=1;j<=n;j++){/*よこ*/
       if(A[i]>j)Y[j]=X[j];
       else if(j%A[i]==0)Y[j]=j/A[i];
       else if(A[i]<j)Y[j]=j/A[i]+Y[j%A[i]];

       Y[j]=min(Y[j],X[j]);
    }

 }


 else if(i%2==0){

    for(j=1;j<=n;j++){/*よこ*/
       if(A[i]>j)X[j]=Y[j];
       else if(j%A[i]==0)X[j]=j/A[i];
       else if(A[i]<j)X[j]=j/A[i]+X[j%A[i]];

       X[j]=min(Y[j],X[j]);
    }

 }



}

/*
if(m%2==1)printf("%d\n",X[n]);
else if(m%2==0)printf("%d\n",Y[n]);
*/
i=min(X[n],Y[x]);
printf("%d\n",i);
return;
}

void swap(int A[],int a,int b){
int temp;
temp=A[a];
A[a]=A[b];
A[b]=temp;

return;
}


void bubblesort(int A[],int m){
int i,j;

for(i=1;i<m;i++){
 for(j=0;j<m-i;j++){
   if(A[j]>A[j+1])swap(A,j,j+1);
 }
}


return;
}







int main(){
int n,m,i;
int A[MAX];

scanf("%d %d",&n,&m);
for(i=0;i<m;i++)scanf("%d",&A[i]);


bubblesort(A,m);


func(A,n,m);

return 0;
}


Compiler output:
main.c: In function 'func':
main.c:56:14: error: 'x' undeclared (first use in this function)
   56 | i=min(X[n],Y[x]);
      |              ^
main.c:56:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <vector> 

using namespace std;

int main()
{
    int totalValueOfShares;  //target sum
    int size; // number of coin types
    
    cin >> totalValueOfShares >> size;
    
    vector<int> numOfShares(size);
    vector<int> values(totalValueOfShares);
    
    for(int i = 0; i < size; i ++){
        cin >> numOfShares[i];
    }
    
    values[0] = 0;
    
    int minValue = INT32_MAX;
    
   

            for (int i = 0; i < size; i ++)
            {
                if (numOfShares[i] < minValue)
                {
                    minValue = numOfShares[i];
                }
            }

            for (int i = 1; i <= totalValueOfShares; i++)
            {
                values[i] = INT32_MAX;
            }


            for (int i = minValue; i <= totalValueOfShares; i++)
            {
                for (int j = 0; j < size; j++)
                    if (numOfShares[j] <= i)
                    {
                        int sum = values[i - numOfShares[j]];
                        if (sum < INT32_MAX && sum + 1 < values[i])
                            values[i] = sum + 1;
                    }
            }
            if (values[totalValueOfShares] == INT32_MAX)
            {
                cout <<  0;
            }
            cout << values[totalValueOfShares];    
    
    

    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:20: error: 'INT32_MAX' was not declared in this scope
   22 |     int minValue = INT32_MAX;
      |                    ^~~~~~~~~
a.cc:3:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    2 | #include <vector>
  +++ |+#include <cstdint>
    3 |
Language: C++

#include <iostream>
#include <vector> 

using namespace std;

int main()
{
    int totalValueOfShares;  //target sum
    int size; // number of coin types
    
    cin >> totalValueOfShares >> size;
    
    vector<int> numOfShares(size);
    vector<int> values(totalValueOfShares);
    
    for(int i = 0; i < size; i ++){
        cin >> numOfShares[i];
    }
    
    values[0] = 0;
    
    int minValue = 0x7FFFFFFF;
    
   

            for (int i = 0; i < size; i ++)
            {
                if (numOfShares[i] < minValue)
                {
                    minValue = numOfShares[i];
                }
            }

            for (int i = 1; i <= totalValueOfShares; i++)
            {
                values[i] = 0x7FFFFFFF;
            }


            for (int i = minValue; i <= totalValueOfShares; i++)
            {
                for (int j = 0; j < size; j++)
                    if (numOfShares[j] <= i)
                    {
                        int sum = values[i - numOfShares[j]];
                        if (sum < 0x7FFFFFFF&& sum + 1 < values[i])
                            values[i] = sum + 1;
                    }
            }
            if (values[totalValueOfShares] == INT32_MAX)
            {
                cout <<  0;
            }
            cout << values[totalValueOfShares];    
    
    

    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:47: error: 'INT32_MAX' was not declared in this scope
   50 |             if (values[totalValueOfShares] == INT32_MAX)
      |                                               ^~~~~~~~~
a.cc:3:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    2 | #include <vector>
  +++ |+#include <cstdint>
    3 |
Language: C++

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

using namespace std;

unsigned short dp[20][50010];

int main(void)
{
    int N, M;
    cin >> N >> M;
    vector<int> c(M);
    for (auto &i : c) cin >> i;
    sort(c.begin(), c.end());
    for (int j = 0; j <= N; j++) dp[0][j] = j;
    int m;
    for (int i = 1; i < M; i++)
    {
        for (int j = 0; j <= N; j++)
        {
            dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - j / c[i] * c[i]] + j / c[i])
        }
    }
    cout << dp[M - 1][N] << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:27: error: no matching function for call to 'min(short unsigned int&, int)'
   22 |             dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - j / c[i] * c[i]] + j / c[i])
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:22:27: note:   deduced conflicting types for parameter 'const _Tp' ('short unsigned int' and 'int')
   22 |             dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - j / c[i] * c[i]] + j / c[i])
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:22:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'short unsigned int'
   22 |             dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - j / c[i] * c[i]] + j / c[i])
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

using namespace std;

unsigned short dp[20][50010];

int main(void)
{
    int N, M;
    cin >> N >> M;
    vector<int> c(M);
    for (auto &i : c) cin >> i;
    sort(c.begin(), c.end());
    for (int j = 0; j <= N; j++) dp[0][j] = j;
    int m;
    for (int i = 1; i < M; i++)
    {
        for (int j = 0; j <= N; j++)
        {
            dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - j / c[i] * c[i]] + j / c[i]);
        }
    }
    cout << dp[M - 1][N] << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:27: error: no matching function for call to 'min(short unsigned int&, int)'
   22 |             dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - j / c[i] * c[i]] + j / c[i]);
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:22:27: note:   deduced conflicting types for parameter 'const _Tp' ('short unsigned int' and 'int')
   22 |             dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - j / c[i] * c[i]] + j / c[i]);
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:22:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'short unsigned int'
   22 |             dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - j / c[i] * c[i]] + j / c[i]);
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

#define N	50000
#define M	20

int	m = M;
int	 d[M] = {0};
int	counts[N] = { 0 };
int compute(int k);

inline int getC(int k)
{
	if (counts[k] == 0)
		counts[k] = compute(k);
	return	counts[k];
}

int compute(int k)
{
	int mincount = INT_MAX;
	for (int i = 0; i < m; ++i)
	{
		if (k > d[i]){
			int count = 1 /*d[i]の分*/ + getC(k - d[i]);
			if (count < mincount){
				mincount = count;
			}
		}
		else if (k == d[i]){
			mincount = 1;
		}
	}
	return	mincount;
}

int main(){
	std::istream & c_in = cin;
	int n;
	c_in >> n >> m;
	for (int i = 0; i < m; i++){
		c_in >> d[i];
	}
	printf("%d\n",getC(n));
    return 0;
}

Compiler output:
a.cc: In function 'int compute(int)':
a.cc:24:24: error: 'INT_MAX' was not declared in this scope
   24 |         int mincount = INT_MAX;
      |                        ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <fstream>
  +++ |+#include <climits>
    5 | using namespace std;
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#define MAX_N 50001
#define MAX_M 21
using namespace std;
int n, m;
int value[MAX_M];

int solve() {
    int coin[MAX_N];
    memset(coin, MAX_N, sizeof(coin));
    coin[0] = 0;

    for(int r = 0; r < m; r++) {
        int val = value[r];
        for(int c = val; c <= n; c++) {
            coin[c] = min(coin[c], coin[c - val] + 1);
        }
    }
    return(coin[n]);
}

int main(void) {
    cin >> n >> m;
    for(int r = 0; r < m; r++) cin >> value[r];
    
    cout << solve() << endl;
    return(0);
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:12:5: error: 'memset' was not declared in this scope
   12 |     memset(coin, MAX_N, sizeof(coin));
      |     ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <algorithm>
  +++ |+#include <cstring>
    4 | #define MAX_N 50001
Language: C++

from functools import lru_cache
INF = 1000000000000000000000000

@lru_cache(None)
def dp(m, n):
    if n == N:
        return 0
    if n > N or m == M:
        return INF
    i = 0
    a = INF
    while c[m] * i + n <= N:
        a = min(a, dp(m + 1, n + c[m] * i) + i)
        i += 1
    return a
N, M = map(int, input().split())
c = list(map(int, input().split()))
print(dp(0, 0))

Compiler output:
a.cc:2:7: warning: integer constant is too large for its type
    2 | INF = 1000000000000000000000000
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:4:1: error: stray '@' in program
    4 | @lru_cache(None)
      | ^
a.cc:1:1: error: 'from' does not name a type
    1 | from functools import lru_cache
      | ^~~~
Language: C++

#include <iostream>

using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;
    vector<int> coins(m);
    for (int i = 0; i < m; ++i) {
        cin >> coins[i];
    }
    int count;
    for (int i = m - 1; i <= 0; --i) {
        while (n <= coins[i]) {
            n -= coins[i];
            ++count;
        }
    }
    cout << count << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<int> coins(m);
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
a.cc:9:12: error: expected primary-expression before 'int'
    9 |     vector<int> coins(m);
      |            ^~~
a.cc:11:16: error: 'coins' was not declared in this scope
   11 |         cin >> coins[i];
      |                ^~~~~
a.cc:15:21: error: 'coins' was not declared in this scope
   15 |         while (n <= coins[i]) {
      |                     ^~~~~
Language: C++

#include <iostream>
#include <stdlib.h>

using namespace std;

int comp(const void *a, const void *b)
{
	return *(int*)b - *(int*)a;
}
int comp2(const void *a, const void *b)
{
	return numofbits(*(int*)a) - numofbits(*(int*)b);
}

int numofbits(long bits)
{
	bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
	bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
	bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
	bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
	return (bits & 0x0000ffff) + (bits >> 16 & 0x0000ffff);
}

int main(){
	int n, m, c[20], sum;
	long bita[1 << 21];
	cin >> n >> m;
	for (int i = 0; i < m; i++){
		cin >> c[i];
	}
	qsort(c, m, sizeof(int), comp);
	for (long i = 0; i < 1 << 21; i++){
		bita[i] = i;
	}
	for (long i = 0; i < 1 << 21; i++){
		sum = 0;
		for (int b = 0; b < 21; b++){
			if (bita[i] >> b & 1){
				sum += c[b];
			}
		}
		if (sum == n){
			cout << numofbits(bita[i]) << endl;
			return 0;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int comp2(const void*, const void*)':
a.cc:12:16: error: 'numofbits' was not declared in this scope
   12 |         return numofbits(*(int*)a) - numofbits(*(int*)b);
      |                ^~~~~~~~~
Language: C++

#include <iostream>
#include <sstream>
#include <string>
#include <cmath>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <functional>
#include <numeric>
#include <climits>
#include <cassert>

using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;

#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i,a,b) for(int i = (a); i < (int)(b); ++i)
#define ALL(c) (c).begin(), (c).end()
#define SIZE(v) ((int)v.size())

#define pb push_back
#define mp make_pair


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

    vector<int> cs(m);
    REP(i,m) cin >> cs[i];

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

	FOR(i, 1, m+1) {
        auto c = cs[i-1];
        FOR(j, c, n+1) {
            dp[j] = min(dp[j], dp[j - c] + 1);
        }

        // for(auto e : dp) cout << e << ",";
        // cout << endl;
    }

    cout << dp[n] << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:25: error: 'INF' was not declared in this scope
   39 |     vector<int> dp(n+1, INF);
      |                         ^~~
Language: C++

#include<iostream>
#include<algorithm>
const int INF = (1 << 20);
using namespace std;
int dp[1000000];
int d[20];
int main()
{
	int n, m; cin >> n >> m;
	fill(dp, dp + m, 0);fill(dp[1], dp[n+1], INF);
	for (int i = 0; i < m; ++i) {
		cin >> d[i];
	}
	dp[0] = 0;
	for (int i = 0; i < m; ++i) {
		for (int j = d[i]; j <= n; ++j) {
			dp[j] = min(dp[j], dp[j - d[i]] + 1);
		}
	}
	cout << dp[n] << endl;
}

Compiler output:
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:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'typename __gnu_cxx::__enable_if<std::__is_scalar<_Tp>::__value, void>::__type std::__fill_a1(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = int; _Tp = int; typename __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type = void]':
/usr/include/c++/14/bits/stl_algobase.h:998:21:   required from 'void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = int; _Tp = int]'
  998 |     { std::__fill_a1(__first, __last, __value); }
      |       ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1029:20:   required from 'void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = int; _Tp = int]'
 1029 |       std::__fill_a(__first, __last, __value);
      |       ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:10:26:   required from here
   10 |         fill(dp, dp + m, 0);fill(dp[1], dp[n+1], INF);
      |                             ~~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:952:9: error: invalid type argument of unary '*' (have 'int')
  952 |         *__first = __tmp;
      |         ^~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#define INF (1 << 20);
using namespace std;
int dp[1000000];
int d[20];
int main()
{
	int n, m; cin >> n >> m;
	fill(dp, dp + m, 0);fill(dp[1], dp[n+1], INF);
	for (int i = 0; i < m; ++i) {
		cin >> d[i];
	}
	dp[0] = 0;
	for (int i = 0; i < m; ++i) {
		for (int j = d[i]; j <= n; ++j) {
			dp[j] = min(dp[j], dp[j - d[i]] + 1);
		}
	}
	cout << dp[n] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:22: error: expected ')' before ';' token
    3 | #define INF (1 << 20);
      |                      ^
a.cc:10:50: note: in expansion of macro 'INF'
   10 |         fill(dp, dp + m, 0);fill(dp[1], dp[n+1], INF);
      |                                                  ^~~
a.cc:10:33: note: to match this '('
   10 |         fill(dp, dp + m, 0);fill(dp[1], dp[n+1], INF);
      |                                 ^
a.cc:10:53: error: expected primary-expression before ')' token
   10 |         fill(dp, dp + m, 0);fill(dp[1], dp[n+1], INF);
      |                                                     ^
Language: C++

#include<iostream>
#include<algorithm>
#define INF (1 << 20)
using namespace std;
int dp[1000000];
int d[20];
int main()
{
	int n, m; cin >> n >> m;
	fill(dp, dp + m, 0);fill(dp[1], dp[n+1], INF);
	for (int i = 0; i < m; ++i) {
		cin >> d[i];
	}
	dp[0] = 0;
	for (int i = 0; i < m; ++i) {
		for (int j = d[i]; j <= n; ++j) {
			dp[j] = min(dp[j], dp[j - d[i]] + 1);
		}
	}
	cout << dp[n] << endl;
}

Compiler output:
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:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'typename __gnu_cxx::__enable_if<std::__is_scalar<_Tp>::__value, void>::__type std::__fill_a1(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = int; _Tp = int; typename __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type = void]':
/usr/include/c++/14/bits/stl_algobase.h:998:21:   required from 'void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = int; _Tp = int]'
  998 |     { std::__fill_a1(__first, __last, __value); }
      |       ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1029:20:   required from 'void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = int; _Tp = int]'
 1029 |       std::__fill_a(__first, __last, __value);
      |       ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:10:26:   required from here
   10 |         fill(dp, dp + m, 0);fill(dp[1], dp[n+1], INF);
      |                             ~~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:952:9: error: invalid type argument of unary '*' (have 'int')
  952 |         *__first = __tmp;
      |         ^~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>const int INF=(1<<22);int dp[1000000],d[20],n,m;int main(){std::cin>>n>>m;std::fill(dp,dp+n+1,INF);dp[0]=0;for(int i=0;i<m;++i)std::cin>>d[i];for(int i=0;i<m;++i)for(int j=d[i];j<=n;++j){dp[j]=std::min(dp[j],dp[j-d[i]]+1);}std::cout<<dp[n]<<std::endl;}

Compiler output:
a.cc:2:26: warning: extra tokens at end of #include directive
    2 | #include<algorithm>const int INF=(1<<22);int dp[1000000],d[20],n,m;int main(){std::cin>>n>>m;std::fill(dp,dp+n+1,INF);dp[0]=0;for(int i=0;i<m;++i)std::cin>>d[i];for(int i=0;i<m;++i)for(int j=d[i];j<=n;++j){dp[j]=std::min(dp[j],dp[j-d[i]]+1);}std::cout<<dp[n]<<std::endl;}
      |                          ^~~
a.cc:2:9: fatal error: algorithm>cons: No such file or directory
    2 | #include<algorithm>const int INF=(1<<22);int dp[1000000],d[20],n,m;int main(){std::cin>>n>>m;std::fill(dp,dp+n+1,INF);dp[0]=0;for(int i=0;i<m;++i)std::cin>>d[i];for(int i=0;i<m;++i)for(int j=d[i];j<=n;++j){dp[j]=std::min(dp[j],dp[j-d[i]]+1);}std::cout<<dp[n]<<std::endl;}
      |         ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<algorithm>const int INF=(1<<22);int dp[1000000],d[20],n,m;
int main(){std::cin>>n>>m;std::fill(dp,dp+n+1,INF);dp[0]=0;for(int i=0;i<m;++i)std::cin>>d[i];for(int i=0;i<m;++i)for(int j=d[i];j<=n;++j){dp[j]=std::min(dp[j],dp[j-d[i]]+1);}std::cout<<dp[n]<<std::endl;}

Compiler output:
a.cc:2:26: warning: extra tokens at end of #include directive
    2 | #include<algorithm>const int INF=(1<<22);int dp[1000000],d[20],n,m;
      |                          ^~~
a.cc:2:9: fatal error: algorithm>cons: No such file or directory
    2 | #include<algorithm>const int INF=(1<<22);int dp[1000000],d[20],n,m;
      |         ^~~~~~~~~~~~~~~~
compilation terminated.