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

import java.io.PrintWriter;
import java.util.*;

public class DP {

    Scanner sc = new Scanner(System.in);
    int h = sc.nextInt();
    int n = sc.nextInt();
    int[] power = new int[n];
    int[] cost = new int[n];
    int[][] arr = new int[n][2];

    int[] dp = new int[h+10001];

    PrintWriter out = new PrintWriter(System.out);


    public static void main(String[] args) {
        new DP().run();
    }

    void run() {
        for (int i=0; i<n; i++) {
            int pow = sc.nextInt();
            int cost = sc.nextInt();
            arr[i][0] = pow;
            arr[i][1] = cost;
//            Pair pair = new Pair(pow, cost);
        }
//        Arrays.sort(arr, (a, b) -> Integer.compare(a[0], b[0]));

//        for (int i=0; i<n; i++) {
//            System.out.print(arr[i][0]+" ");
//            System.out.println(arr[i][1]);
//        }




        for (int i=1; i<h+1; i++) {
            int idx = i+10000;
            dp[idx] = Integer.MAX_VALUE;
            for (int j=0; j<n; j++) {
                dp[idx] = Math.min(dp[idx], dp[idx-arr[j][0]]+arr[j][1]);
            }
        }

//        for (int i=0; i<n+1; i++) {
//            for (int j=0; j<h; j++) {
//                System.out.print(dp[i][j]+" ");
//            }
//            System.out.println(dp[i][h]);
//        }


        out.println(dp[h+10000]);
        out.flush();
    }

    void solve(int i, int m) {
    }

    class Pair {
        int power;
        int cost;
        public Pair(int p, int c) {
            this.power = p;
            this.cost = c;
        }

        public int compareTo(Pair p) {
            if (this.cost < p.cost) return -1;
            if (this.cost > p.cost) return -1;
            return 0;
        }
    }
}


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

import java.io.PrintWriter;
import java.util.*;

public class DP {

    Scanner sc = new Scanner(System.in);
    int h = sc.nextInt();
    int n = sc.nextInt();
    int[] power = new int[n];
    int[] cost = new int[n];
    int[][] arr = new int[n][2];

    int[][] dp = new int[n+1][h+1];

    PrintWriter out = new PrintWriter(System.out);


    public static void main(String[] args) {
        new DP().run();
    }

    void run() {
        for (int i=0; i<n; i++) {
            int pow = sc.nextInt();
            int cost = sc.nextInt();
            arr[i][0] = pow;
            arr[i][1] = cost;
//            Pair pair = new Pair(pow, cost);
        }
        Arrays.sort(arr, (a, b) -> Integer.compare(a[0], b[0]));

        for (int i=0; i<n; i++) {
//            System.out.print(arr[i][0]+" ");
//            System.out.println(arr[i][1]);
        }

//        for (int i=0; i<n+1; i++) {
//            for (int j=0; j<h+1; j++) {
//                dp[i][j] = Integer.MAX_VALUE;
//            }
//        }a

        for (int i=1; i<n+1; i++) {
            for (int j=1; j<h+1; j++) {
                int p = arr[0][0];
                int c = arr[0][1];
                dp[i][j] = (j+p-1)/p*c;
            }
        }

//        for (int i=1; i<h+1; i++) {
//            int p = arr[0][0];
//            int c = arr[0][1];
//            dp[1][i] = (i+p-1)/p*c;
//        }

        for (int i=2; i<n+1; i++) {
            for (int j=1; j<h+1; j++) {
                int power = arr[i-1][0];
                int cost = arr[i-1][1];
                if (j-power>=0) {
                    dp[i][j] = Math.min(dp[i-1][j], dp[i][j-power]+cost);
                }
            }
        }

        for (int i=0; i<n+1; i++) {
            for (int j=0; j<h; j++) {
//                System.out.print(dp[i][j]+" ");
            }
//            System.out.println(dp[i][h]);
        }


        out.println(dp[n][h]);
        out.flush();
    }

    void solve(int i, int m) {
    }

    class Pair {
        int power;
        int cost;
        public Pair(int p, int c) {
            this.power = p;
            this.cost = c;
        }

        public int compareTo(Pair p) {
            if (this.cost < p.cost) return -1;
            if (this.cost > p.cost) return -1;
            return 0;
        }
    }
}


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

#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pl;
const int N = 1e5;
int dp[N];
int h, n;
pl spell[N];

int main() {
	for(int i=0;i<N-10;i++)dp[i] = N;
	cin>>h>>n;
    for(int i=0;i<n;i++) {
    	scanf("%d%d", &spell[i].first, &spell[i].second);
    }
    dp[0] = 0;
  	for(int i=1;i<=20000;i++) {
        for(int j=0;j<n;j++) {
        	if(i - spell[j].first < 0)continue;
            dp[i] = min(dp[i], dp[i-spell[j].first] + spell[j].second);
        }
    }
    int ans = dp[h];
    for(int i=h+1;i<=20000;i++)
        ans = min(ans, dp[i];
  
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:29: error: expected ')' before ';' token
   24 |         ans = min(ans, dp[i];
      |                  ~          ^
      |                             )
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
using P = pair<int,int>;
const int INF = 1001001001;
int main()
{
    int h,n;
    cin >> h >> n;
    vector<int> dp(h+1,INF);
    dp[h] = 0;
    rep(i,n){
        int a,b;
        cin >> a >> b;
        for(int j = h;j>=0;--j){//このdpは配るしかできない
        //なぜなら、体力をa削ることでオーバーキルしても良いから（dp[j] がdp[0]に遷移するかどうかはわかるが、dp[0]に遷移するようなjがいくつあるか、それがなにかがわからない
            dp[max(j-a,0)] = min(dp[j]+b,dp[max(j-a,0)]);
        }
    }
    cout << dp[0] << endl;

    return 0;
（

Compiler output:
a.cc: In function 'int main()':
a.cc:24:1: error: '\U0000ff08' was not declared in this scope
   24 | （
      | ^~
a.cc:24:3: error: expected '}' at end of input
   24 | （
      |   ^
a.cc:8:1: note: to match this '{'
    8 | {
      | ^
Language: C++

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

int h,n;
int A[10101],B[101010];
ll dp[20100];

void solve()
{
	int i,j,k,l,r,x,y; 
	cin>>h>>n;
	
	for(i=0; i<20001; ++i) 
	   dp[i]=1LL<<60;
	
	dp[0]=0;
	
	for(i=0; i<n; i++)
	{
		cin>>x>>y;    //Ai, Bi 
		for(j=0; j<h; j++) 
		   dp[j+x]=min(dp[j+x],dp[j]+y);
	}
	
	ll mi=1LL<<60;
	
	for(i=H; i<=20000; i++)
	   mi=min(mi,dp[i]);
	
	cout<<mi<<endl;
}

int main()
{
	int i;
	ios::sync_with_stdio(false),cin.tie(0);
	
	solve();
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:28:15: error: 'H' was not declared in this scope
   28 |         for(i=H; i<=20000; i++)
      |               ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);


int g[15][15];
const int INF = 1001001001;
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,-1,0,1 };

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

//素因数分解
vector<pair<ll, int>>factorize(ll n) {
	vector<pair<ll, int>>res;
	for (ll i = 2;i * i <= n;++i) {
		if (n % i)continue;
		res.emplace_back(i, 0);
		while (n % i == 0) {
			n /= i;
			res.back().second++;
		}
	}
	if (n != 1)res.emplace_back(n, 1);
	return res;
}

int dp[1010][101010];

int main() {
	int h, n;
	cin >> h >> n;
	int amax = 0;
	vector<int>A(n), B(n);
	for (int i = 1;i <= n;++i) {
		cin >> A[i] >> B[i];
		amax = max(amax, A[i]);
	}
	dp[0][0] = 0;
	for (int i = 1;i <= n;++i) {
		for (j = 1;j <= h + amax;++j) {
			if (j >= A[i])dp[i + 1][j] = min(dp[i][j], dp[i][j - A[i]] + B[i]);
			else dp[i + 1][j] = dp[i][j];
		}
	}
	int ans = 1e8;
	for (int i = h;i <= h + amax;++i) {
		ans = min(ans, dp[n][i]);
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:22: error: 'j' was not declared in this scope
   51 |                 for (j = 1;j <= h + amax;++j) {
      |                      ^
Language: C++

#include <iostream>
#include <functional>
#include <algorithm>
#include <math.h>
#include <iomanip>
#include <vector>
#define ll long long
#define ALLv(a)  (a).begin(),(a).end()
#define ALL(a,n)  (a),(a)+n
#define vi vector<long long>
#define vd vector<long double>
#define vs vector<string>

#define INF 1010000000000000017LL
#define MOD 1000000007LL
#define EPS 1e-12
#define PI 3.14159265358979323846
//REPEAT
//------------------------------------------
#define FOR(i,m,n) for(int (i)=(m);(i)<(n); i++)
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define WREP(i,in,j,jn) REP(i,in)REP(j,jn)
using namespace std;
//-------------------------------------------

int main(void){
	ll H,N;cin>>H>>N;
	vi a(H+1),m(H+1);
	REP(i,N)cin>>a[i]>>m[i];
	
	int dp[H+1];dp[0]=0;
	memset(dp,-1, sizeof(dp)/sizeof(dp[0]));
	
	
	ll tmpmp;
	REPS(h,H){
		if(a[0]>=h)tmpmp=m[0];
		else tmpmp=dp[h-a[0]]+m[0];
		FOR(n,1,N){
			if(a[n]>=h)
				if(tmpmp>m[n])tmpmp=m[n];
			else
				if(tmpmp>dp[h-a[n]]+m[n])
					tmpmp=dp[h-a[n]]+m[n];
		}
		dp[h]=tmpmp;
	}
	cout<<dp[H]<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:9: error: 'memset' was not declared in this scope
   35 |         memset(dp,-1, sizeof(dp)/sizeof(dp[0]));
      |         ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <iomanip>
  +++ |+#include <cstring>
    6 | #include <vector>
Language: C++

#include <iostream>
#include <functional>
#include <algorithm>
#include <math.h>
#include <iomanip>
#include <vector>
#define ll long long
#define ALLv(a)  (a).begin(),(a).end()
#define ALL(a,n)  (a),(a)+n
#define vi vector<long long>
#define vd vector<long double>
#define vs vector<string>

#define INF 1010000000000000017LL
#define MOD 1000000007LL
#define EPS 1e-12
#define PI 3.14159265358979323846
//REPEAT
//------------------------------------------
#define FOR(i,m,n) for(int (i)=(m);(i)<(n); i++)
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define WREP(i,in,j,jn) REP(i,in)REP(j,jn)
using namespace std;
//-------------------------------------------

int main(void){
	ll H,N;cin>>H>>N;
	vi a(H+1),m(H+1);
	REP(i,N)cin>>a[i]>>m[i];
	
	int dp[H+1];dp[0]=0;
	memset(dp,-1, sizeof(dp)/sizeof(dp[0]));
	
	
	ll tmpmp;
	REPS(h,N){
		if(a[h]>=H)tmpmp=m[h];
		else tmpmp=dp[h-a[h]]+m[h];
		FOR(n,1,N){
			if(a[n]>=h)
				if(tmpmp>m[n])tmpmp=m[n];
			else
				if(tmpmp>dp[h-a[n]]+m[n])tmpmp=m[n];
		}
		dp[h]=tmpmp;
	}
	cout<<dp[H]<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:9: error: 'memset' was not declared in this scope
   35 |         memset(dp,-1, sizeof(dp)/sizeof(dp[0]));
      |         ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <iomanip>
  +++ |+#include <cstring>
    6 | #include <vector>
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int INF= 1e9+5;

int main(){
  int H,n;
  cin>>H>>n;
  vector<int>dp(H+1,INF)
  dp[0] = 0;
  while(n--){
  	int value,cost;
    cin>>value>>cost;
    for(int i = 0;i<=H;i++){
      int j = min(H,i+value);
      dp[j]=min(dp[j], dp[i]+cost);
    }
  }
      cout<<dp[H];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'dp'
    9 |   dp[0] = 0;
      |   ^~
Language: C++

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

int main(){
  int H,n;
  cin>>H>>n;
  vector<int>dp(H+1,INF)
  dp[0] = 0;
  while(n--){
  	int value,cost;
    cin>>value>>cost;
    for(int i = 0;i<=H;i++){
      int j = min(H,i+value);
      dp[j]=min(dp[j], dp[i]+cost);
    }
  }
      cout<<dp[H];
}

Compiler output:
a.cc:3:11: error: expected unqualified-id before '=' token
    3 | const int = le9+5;
      |           ^
a.cc: In function 'int main()':
a.cc:8:21: error: 'INF' was not declared in this scope
    8 |   vector<int>dp(H+1,INF)
      |                     ^~~
a.cc:9:3: error: expected ',' or ';' before 'dp'
    9 |   dp[0] = 0;
      |   ^~
Language: C++

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

using namespace std;

int maxi[10010];

int main(int argc, char** argv)
{
  int h, n; cin >> h >> n;
  vector<pair<int, int>> v;
  for (int i = 0; i < n; i++) {
    int a, b; cin >> a >> b;
    v.emplace_back(a, b);
  }

  for (int i = 0; i < 10010; i++) maxi[i] = 1000000000;

  maxi[h] = 0;
  for (int k = h; k > 0; k--) {
  	for (auto p : v) {
      int t = max(0, k - p.first);
      maxi[t] = min(maxi[t], maxi[k] + p.second);
    }
  }
  
  cout << maxi[0] << endl;
  
  return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
const int INF=1e9+5;

int main(){
  int n,h;
  cin>>n>>h;
  vector<int>dp(h+1,INF);
  dp[0]=0;
  while(n--){
    int weight,value;
    cin>>value>>weight;
    for(int i=0;i<=h;i++){
      int j=min(h,i+value);
      dp[j]=min(dp[j],dp[i]+cost);
    }
  }
  cout<<dp[h];
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:29: error: 'cost' was not declared in this scope; did you mean 'cosl'?
   15 |       dp[j]=min(dp[j],dp[i]+cost);
      |                             ^~~~
      |                             cosl
Language: C++

// Author : Mohamed Sameh
#include <bits/stdc++.h>
typedef long long ll ;
#define pb push_back
#define f first
#define s second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define SZ(a) (int)a.size()
#define Flush fflush(stdout);
using namespace std ;
int h , n ;
const int M = 1e3 ;
int a[M][2];
ll dp[M][10001];
ll solve(int idx = 0 , int rem = h )
{
    if (rem <= 0 )return 0 ;
    if (idx >= n )return 1e12;
    //cout << idx <<" " << rem <<"\n";
    ll &ret = dp[idx][rem];
    if (~ret)return ret ;
    ret = solve(idx + 1 , rem );
    ret = min (ret , a[idx][1] + solve(idx , rem - a[idx][0]);
    return ret;
}
int main()
{
    memset(dp , -1 ,sizeof dp);
    scanf ("%d%d" , &h , &n );
    for (int i =0 ; i < n ;i++)
    {
        scanf ("%d%d" , a[i] , a[i]+1);
    }
    printf ("%lld\n" , solve());

}


Compiler output:
a.cc: In function 'll solve(int, int)':
a.cc:24:62: error: expected ')' before ';' token
   24 |     ret = min (ret , a[idx][1] + solve(idx , rem - a[idx][0]);
      |               ~                                              ^
      |                                                              )
Language: C++

#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <deque>
#include <random>
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep_1(i,n) for(int i=1;i<n;i++)
using namespace std;

int main(){
    int h,n,i,j;
    cin>>h>>n;
    std::vector< std::pair<int,int> > ab(n);
    rep(i,n){
        cin>>ab[i].first>>ab[i].second;
    }
    int maxa=0;
    rep(i,n){
        maxa=max(maxa,ab[i].first);
    }
    std::vector<int> dp(h+maxa,-1);
    dp[0]=0;
    rep_1(i,h+maxa){
        rep(j,n){
            if(dp[i]==-1){
                if(i-ab[j].first>-1){
                    if(dp[i-ab[j].first]!=-1){
                        dp[i]=dp[i-ab[j].first]+ab[j].second;
                    }
                }
            }else{
                if(i-ab[j].first>-1){
                    if(dp[i-ab[j].first]!=-1){
                        dp[i]=min(dp[i], dp[i-ab[j].first]+ab[j].second);
                    }
                }
            }
        }
    }

    int ans=INT_MAX;
    rep(i,maxa){
        if(dp[i+h]!=-1){
            ans=min(ans, dp[i+h]);
        }
    }
    cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:13: error: 'INT_MAX' was not declared in this scope
   59 |     int ans=INT_MAX;
      |             ^~~~~~~
a.cc:23:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   22 | #include <random>
  +++ |+#include <climits>
   23 | typedef long long ll;
Language: C++


    return a;
}


void oneCase () {
    int h, n;
    cin >> h >> n;
    vector<pair<int, int>> s(n);
    for (auto& p : s) {
        cin >> p.first;
        cin >> p.second;
    }
    vector<int> res(h + 1, 0);
    for (int hp = 1; hp <= h; ++hp) {
        auto best = INT32_MAX;
        for (auto [spell, cost]: s) {
            if (spell >= hp) {
                best = min(best, cost);
            } else {
                best = min(best, cost + res[hp - spell]);
            }
        }
        res[hp] = best;
    }
    cout << res.back() << "\n";

}




int main() {
    int t = 1;
//    cin >> t;
    while (t > 0) {
        oneCase();
        --t;
    }

    return 0;
}

Compiler output:
a.cc:2:5: error: expected unqualified-id before 'return'
    2 |     return a;
      |     ^~~~~~
a.cc:3:1: error: expected declaration before '}' token
    3 | }
      | ^
a.cc: In function 'void oneCase()':
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     cin >> h >> n;
      |     ^~~
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<pair<int, int>> s(n);
      |     ^~~~~~
a.cc:9:12: error: 'pair' was not declared in this scope
    9 |     vector<pair<int, int>> s(n);
      |            ^~~~
a.cc:9:17: error: expected primary-expression before 'int'
    9 |     vector<pair<int, int>> s(n);
      |                 ^~~
a.cc:10:20: error: 's' was not declared in this scope
   10 |     for (auto& p : s) {
      |                    ^
a.cc:14:12: error: expected primary-expression before 'int'
   14 |     vector<int> res(h + 1, 0);
      |            ^~~
a.cc:16:21: error: 'INT32_MAX' was not declared in this scope
   16 |         auto best = INT32_MAX;
      |                     ^~~~~~~~~
a.cc:1:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
  +++ |+#include <cstdint>
    1 | 
a.cc:17:34: error: 's' was not declared in this scope
   17 |         for (auto [spell, cost]: s) {
      |                                  ^
a.cc:19:24: error: 'min' was not declared in this scope
   19 |                 best = min(best, cost);
      |                        ^~~
a.cc:21:41: error: 'res' was not declared in this scope
   21 |                 best = min(best, cost + res[hp - spell]);
      |                                         ^~~
a.cc:21:24: error: 'min' was not declared in this scope
   21 |                 best = min(best, cost + res[hp - spell]);
      |                        ^~~
a.cc:24:9: error: 'res' was not declared in this scope
   24 |         res[hp] = best;
      |         ^~~
a.cc:26:5: error: 'cout' was not declared in this scope
   26 |     cout << res.back() << "\n";
      |     ^~~~
a.cc:26:13: error: 'res' was not declared in this scope
   26 |     cout << res.back() << "\n";
      |             ^~~
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
#include <numeric>
#include <algorithm>
#include <utility>


using std::cout;
using std::cin;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;


ll gcd(ll a, ll b) {
    while (b != 0) {
        auto tmp = a;
        a = b;
        b = tmp % a;
    }
    return a;
}


void oneCase () {
    int h, n;
    cin >> h >> n;
    vector<pair<int, int>> s(n);
    for (auto& p : s) {
        cin >> p.first;
        cin >> p.second;
    }
    vector<int> res(h + 1, 0);
    for (int hp = 1; hp <= h; ++hp) {
        auto best = INT32_MAX;
        for (auto [spell, cost]: s) {
            if (spell >= hp) {
                best = min(best, cost);
            } else {
                best = min(best, cost + res[hp - spell]);
            }
        }
        res[hp] = best;
    }
    cout << res.back() << "\n";

}




int main() {
    int t = 1;
//    cin >> t;
    while (t > 0) {
        oneCase();
        --t;
    }

    return 0;
}

Compiler output:
a.cc: In function 'void oneCase()':
a.cc:41:21: error: 'INT32_MAX' was not declared in this scope
   41 |         auto best = INT32_MAX;
      |                     ^~~~~~~~~
a.cc:12:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
   11 | #include <utility>
  +++ |+#include <cstdint>
   12 |
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
void chmin(int& a, int b){
    a = min(a, b);
}
 
int main(){
    int H, N;
    cin >> H >> N;
    vector<int> A(N), B(N);
    for(int i=0; i<N; i++) cin >> A[i] >> B[i];
 
    vector<int> dp(100000, 1e9);
    dp[0] = 0;
    for(int h=0; h<H; h++) for(int i=0; i<N; i++){
        chmin(dp[min(h+A[i], H)], dp[h] + B[i]);
    }
    cout << dp[H] << endl;
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: expected '}' at end of input
   20 |     return 0;
      |              ^
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: C++

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

typedef long long ll;
#define pa pair<int, int> 
#define pal pair<long long, long long>
#define pad pair<double, double>
#define pb push_back
#define mp make_pair
#define VIN(v) for(int64_t i=0;i<(v).size();i++){cin >> (v).at(i);}

typedef vector<bool> bvec;
typedef vector<int> ivec;
typedef vector<long long> lvec;
typedef vector<double> dvec;
typedef vector<pa> pvec;

typedef vector< vector<bool> > bmat;
typedef vector< vector<int> > imat;
typedef vector<string> svec;
typedef vector< vector<string> > smat;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int  h, n;
    cin >> h >> n;
    ivec a(n), b(n);
    for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
    int dp[10001];
    dp[0] = 0;
    for (int i = 1; i < h+1; i++){
        dp[i] = 1e8+1;
        for (int j = 0; j < n; j++) dp[i] = fmin(dp[i], dp[fmax(0, i-a[j])] + b[j]);
    }
    //cout << *min_element(dp.begin()+h, dp.end()) << endl;
    cout << dp[h] << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:59: error: invalid types 'int [10001][__gnu_cxx::__promote<double>::__type {aka double}]' for array subscript
   33 |         for (int j = 0; j < n; j++) dp[i] = fmin(dp[i], dp[fmax(0, i-a[j])] + b[j]);
      |                                                           ^
Language: C++

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

typedef long long 			ll;
typedef unsigned long long 	ull;

const int N = 1e3 + 20;

ll a[N], b[N], dp[4 * N];

int main() {
	ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
	ll n, h;
	cin >> h >> n;
	for (int i = 1; i <= n; i++)
		cin >> a[i] >> b[i];
	memset(dp, 0x3f, sizeof(dp));
	dp[h] = 0;
	ll res = 1e9;
	for (int i = 1; i <= n; i++) {
		for (int j = h; j >= 0; j++)
			dp[max(j - a[i], 0] = min(dp[max(j - a[i], 0)], dp[j] + b[i]);
		res = min(res, dp[0]);
	}
	cout << res << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:43: error: expected ')' before ']' token
   22 |                         dp[max(j - a[i], 0] = min(dp[max(j - a[i], 0)], dp[j] + b[i]);
      |                               ~           ^
      |                                           )
a.cc:22:57: error: no matching function for call to 'max(ll, int)'
   22 |                         dp[max(j - a[i], 0] = min(dp[max(j - a[i], 0)], dp[j] + b[i]);
      |                                                      ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:22:57: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   22 |                         dp[max(j - a[i], 0] = min(dp[max(j - a[i], 0)], dp[j] + b[i]);
      |                                                      ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:22:57: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   22 |                         dp[max(j - a[i], 0] = min(dp[max(j - a[i], 0)], dp[j] + b[i]);
      |                                                      ~~~^~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <math.h>
#include <algorithm>
using namespace std;

typedef long long ll;
const int maxn = 200200;
int dp[maxn];
void solve()
{
    int h,n;
    cin >> h >> n;
    memset(dp,200200,maxn);
    dp[0] = 0;
    for (int i = 0; i < n; i++){
        int x,y;
        cin >> x >> y;
        for (int j = 0; j < h; j++){
            dp[min(j + x,h)] = min(dp[min(j + x,h)], dp[j] + y);
        }
    }
    cout << dp[h] << endl;
}

// 7 3 3 1 1

int main()
{
    int t;
    solve();
    return (0);
}





Compiler output:
a.cc: In function 'void solve()':
a.cc:16:5: error: 'memset' was not declared in this scope
   16 |     memset(dp,200200,maxn);
      |     ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <algorithm>
  +++ |+#include <cstring>
    7 | using namespace std;
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <math.h>
#include <algorithm>
using namespace std;

typedef long long ll;
const int maxn = 200200;
int dp[maxn],a[maxn],b[maxn];
void solve()
{
    int h,n;
    cin >> h >> n;
    memset(dp,200200,maxn);
    dp[0] = 0;
    for (int i = 0; i < n; i++){
        cin >> a[i] >> b[i];
        for (int j = 0; j < h; j++){
            dp[min(j + a[i],h)] = min(dp[min(j + a[i],h)], dp[j] + b[i]);
        }
    }
    cout << dp[h] << endl;
}

// 7 3 3 1 1

int main()
{
    int t;
    solve();
    return (0);
}





Compiler output:
a.cc: In function 'void solve()':
a.cc:16:5: error: 'memset' was not declared in this scope
   16 |     memset(dp,200200,maxn);
      |     ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <algorithm>
  +++ |+#include <cstring>
    7 | using namespace std;
Language: C++

#include <bits/stdc++.h>

using namespace std;
int A[1000], B[1000];

int dp[10001];

int solve(int);

int main() {
  int H, N;
  cin >> H >> N;
  for (int i = 0; i < N; i++) cin >> A[i] >> B[i];

  memset(dp, -1, sizeof(dp));
  cout << solve(H) << endl;

  return 0;
}

int solve(int H) {
  if (dp[H] >= 0) {
    return dp[H];
  }

  int res;
  if (H <= 0) {
    res = 0;
  } else {
    res = solve(H - A[0]) + B[0];
    for (int i = 1; i < N; i++) {
      res = min(res, solve(H - A[i]) + B[i]);
    }
  }
  return dp[H] = res;
}

Compiler output:
a.cc: In function 'int solve(int)':
a.cc:31:25: error: 'N' was not declared in this scope
   31 |     for (int i = 1; i < N; i++) {
      |                         ^
Language: C++

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

int main(){
    int H = 0,N = 0;
    cin >> H >> N;
    
    vector<int> AT(N,0);
    vector<int> MP(N,0);

    for(int i=0;i<N;i++)cin >> AT[i] >>MP[i];
    int maxat = *max_element(AT.begin(),AT.end());



    vector<int> HE(H+2*maxat,1000000000);
    HE.at(0) = 0
    for(int i = 0; i <= H+maxat; i++){                      
        for(int j = 0;j<N;j++){
            if(i+AT.at(j) >= H+2*maxat)continue;
                HE.at(i+AT.at(j)) = min(HE.at(i)+MP.at(j),HE.at(i+AT.at(j)));
        }
    }
    int minmp = *min_element(HE.begin() + H, HE.end());
    cout << minmp << endl;  //出力の最後は改行する必要があります


}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: expected ';' before 'for'
   17 |     HE.at(0) = 0
      |                 ^
      |                 ;
   18 |     for(int i = 0; i <= H+maxat; i++){
      |     ~~~          
a.cc:18:20: error: 'i' was not declared in this scope
   18 |     for(int i = 0; i <= H+maxat; i++){
      |                    ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main(void){
  int h, n;
  cin >> h >> n;
  int a[n], b[n];
  for(int i=0; i<n; i++)
    cin >> a[i] >> b[i];
  int minMP[h];
  minMP[0] = 0;
  int max_damage = 0;
  for(int i=0; n; i++)
    max_damage = max(max_damage, a[i]);
  for(int i=1; h+max_damage-1; i++){
    for (int j=0; n; j++){
      if(i<a[j]){
        minMP[i] = 1000000000;
      }else{
      	minMP[i] = min(minMP[i], minMP[i-a[j]]+b[j])
      }
    }
  }
  int answer = 1000000000;
  for(int i=h; h+max_damage-1; i++)
    answer = min(answer, minMP[i]);
  cout << answer;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:53: error: expected ';' before '}' token
   20 |         minMP[i] = min(minMP[i], minMP[i-a[j]]+b[j])
      |                                                     ^
      |                                                     ;
   21 |       }
      |       ~
Language: C++

#include<iostream>
#include<cmath.h>
using namespace std;
int main(void){
  int h, n;
  cin >> h >> n;
  int a[n], b[n];
  for(int i=0; i<n; i++)
    cin >> a[i] >> b[i];
  int minMP[h];
  minMP[0] = 0;
  int max_damage = 0;
  for(int i=0; n; i++)
    max_damage = max(max_damage, a[i]);
  for(int i=1; h+max_damage-1; i++){
    for (int j=0; n; j++){
      if(i<a[j]){
        minMP[i] = 1000000000;
      }else{
      	minMP[i] = min(minMP[i], minMP[i-a[j]]+b[j])
      }
    }
  }
  int answer = 1000000000;
  for(int i=h; h+max_damage-1; i++)
    answer = min(answer, minMP[i]);
  cout << answer;
}

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

#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define fi first
#define se second
#define pb push_back
#define mk make_pair
using namespace std;
typedef long long ll;
const ll INF = 1e18;
const ll MOD = 1e9+7;

ll fastpowMOD(ll a, ll p,ll MOD);
ll fastpowMOD(ll a, ll p,ll MOD){ if(p==0) return 1; a %= MOD; ll z = fastpowMOD(a,p/2,MOD); z = (z*z)%MOD; if(p%2) z = (z*a)%MOD; return z; }

ll lcm(ll a,ll b){
	return (a*b)/__gcd(a,b);
}



int main(){
	fastio;
	ll h,n;
	cin>>h>>n;
	vector<ll> a(n,0),b(n,0);
	ll sum = 0;
	
	for(ll i=0;i<n;i++){
		cin>>a[i]>>b[i];
		sum += a[i];
	
	}
	
	
	
	if(sum<h){
		sum = max(h,sum);
	}
	sum = min(sum,20000);
	vector<ll> dp(sum+1,INF);
	dp[0] = 0;
	
	for(ll i=1;i<=n;i++){
		for(ll j=0;j<=sum;j++){
			if(j>=a[i-1]){
				dp[j] = min(dp[j],dp[j-a[i-1]]+b[i-1]);
			}
		}
	}
	ll ans = INT_MAX;
	for(ll i=h;i<=sum;i++){
		ans = min(ans,dp[i]);
	}
	cout<<ans<<"\n";
	
}


















Compiler output:
a.cc: In function 'int main()':
a.cc:39:18: error: no matching function for call to 'min(ll&, int)'
   39 |         sum = min(sum,20000);
      |               ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:39:18: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   39 |         sum = min(sum,20000);
      |               ~~~^~~~~~~~~~~
/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:
/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:39:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   39 |         sum = min(sum,20000);
      |               ~~~^~~~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
using namespace std;

bool sortbysec(const pair<int,int> &a,
              const pair<int,int> &b)
{
    return (a.second < b.second);
}

int main()
{
    vector<pair<int,int>> vec;
    multimap<int,int> mp;
    map<int,int>::iterator it,it1;
    int a,b,x,h,n,count1=0,k=0;
    cin>>h>>n;
    for(int i=0; i<n; i++)
    {
        cin>>a>>b;
        vec.push_back(make_pair(a,b));

    }
    sort(vec.begin(),vec.end());
    reverse(vec.begin(),vec.end());
    vector<pair<int,int>> vec1(vec.begin(),vec.end());
     sort(vec1.begin(), vec1.end(), sortbysec);

    for(int i=0; i<n; i++)
    {
        x=vec[i].first-vec[i].second;
        mp.insert(make_pair(x,i));

    }
    for(it=mp.begin(); it!=mp.end(); it++)
    {
        it1=it;
    }
    int i=n;
    for(it=it1; i>0; it--)
    {

        i--;
    }
    i=n;
    for(it=it1; i>0; it--)
    {

        int j=it->second;


         if(vec[j].first<=h)
        {
            if(h%vec[j].first==0)
            {
                count1=(h/vec[j].first)*vec[j].second;
                break;
            }
            else
            {
                double d,e;
                d=floor((h*1.0)/vec[j].first);
                int x=(int)(d);

                if(x!=0){
                count1=count1+x*vec[j].second;
                h=h-x*vec[j].first;

                }
            }
        }

        i--;
        if(i==1)
        {
           count1=count1+vec1[0].second;
           break;
        }
    }
    cout<<count1<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:64:19: error: 'floor' was not declared in this scope
   64 |                 d=floor((h*1.0)/vec[j].first);
      |                   ^~~~~
Language: C++

#include<iostream>
#include<vector>
#include<map>
//#include<pair>
#include<algorithm>
using namespace std;
bool sortbysec(const pair<int,int> &a,
              const pair<int,int> &b)
{
    return (a.second < b.second);
}

int main()
{
    vector<pair<int,int>> vec;
    multimap<int,int> mp;
    map<int,int>::iterator it,it1;
    int a,b,x,h,n,count=0,count1=0,k=0;
    cin>>h>>n;
    for(int i=0; i<n; i++)
    {
        cin>>a>>b;
        vec.push_back(make_pair(a,b));

    }
    sort(vec.begin(),vec.end());
    reverse(vec.begin(),vec.end());
    vector<pair<int,int>> vec1(vec.begin(),vec.end());
     sort(vec1.begin(), vec1.end(), sortbysec);

    for(int i=0; i<n; i++)
    {
        x=vec[i].first-vec[i].second;
        mp.insert(make_pair(x,i));

    }
    for(it=mp.begin(); it!=mp.end(); it++)
    {
        it1=it;
    }
    int i=n;
    for(it=it1; i>0; it--)
    {

        i--;
    }
    i=n;
    for(it=it1; i>0; it--)
    {

        int j=it->second;


         if(vec[j].first<=h)
        {
            if(h%vec[j].first==0)
            {
                count1=(h/vec[j].first)*vec[j].second;
                break;
            }
            else
            {
                double d,e;
                d=floor((h*1.0)/vec[j].first);
                int x=(int)(d);

                if(x!=0){
                        k=x*vec[j].second;
                count1=count1+k;
                h=h-x*vec[j].first;

                }
            }
        }

        i--;
        if(i==1&&!(h<=0))
        {
           count1=count1+vec1[0].second;
           break;
        }
    }
    cout<<count1<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:64:19: error: 'floor' was not declared in this scope
   64 |                 d=floor((h*1.0)/vec[j].first);
      |                   ^~~~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int counter(int h, *int a, *int b, int current){
  if( (h-h%a[current])/a[current]*b[current] >  ){
  	return counter(h- , a, b, current+1)+b[current+1];
  }else{
    if()
  	return counter(h- , a, b, current)+b[current];
  }
}
int main(void){
  int h,n,count;
  count = 0;
  cin >> h;
  cin >> n;
  int a[n], b[n];
  float div[n];
  for(int i=0; i<n; i++){
    div[n] = b[n]/a[n];
  }
  sort(div, div+n);
}
  

Compiler output:
a.cc:4:20: error: expected identifier before '*' token
    4 | int counter(int h, *int a, *int b, int current){
      |                    ^
a.cc:4:21: error: expected ',' or '...' before 'int'
    4 | int counter(int h, *int a, *int b, int current){
      |                     ^~~
a.cc: In function 'int counter(int, int*)':
a.cc:5:12: error: 'a' was not declared in this scope
    5 |   if( (h-h%a[current])/a[current]*b[current] >  ){
      |            ^
a.cc:5:14: error: 'current' was not declared in this scope
    5 |   if( (h-h%a[current])/a[current]*b[current] >  ){
      |              ^~~~~~~
a.cc:5:35: error: 'b' was not declared in this scope
    5 |   if( (h-h%a[current])/a[current]*b[current] >  ){
      |                                   ^
a.cc:5:49: error: expected primary-expression before ')' token
    5 |   if( (h-h%a[current])/a[current]*b[current] >  ){
      |                                                 ^
a.cc:6:27: error: expected primary-expression before ',' token
    6 |         return counter(h- , a, b, current+1)+b[current+1];
      |                           ^
a.cc:8:8: error: expected primary-expression before ')' token
    8 |     if()
      |        ^
a.cc:9:27: error: expected primary-expression before ',' token
    9 |         return counter(h- , a, b, current)+b[current];
      |                           ^
Language: C

#include<stdio.h>
int main()
{
  int H,N;
  int i;
  scanf("%d %d",&H,&N);
  int A[N],B[N];
  double C[N];
  for(i=0;i<N;i++){
  scanf("%d %d",&A[i],&B[i]);
    C[N]=A[i]/B[N];
  }
  double max=C[N];
  for(i=1;i<N;i++){
    if(max<C[i]){
      max=C[i];
  }}
  i=0;
  while(H>i*max){
    i++;
  }
  printf("%d",i)
    
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:22:17: error: expected ';' before 'return'
   22 |   printf("%d",i)
      |                 ^
      |                 ;
   23 | 
   24 |   return 0;
      |   ~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
int main() {
  int H, n;
  cin >> H >> n;
  vector<int> dp(H + 1, INF); // dp[H]
  // dp[x] - minimum total cost to get value x
  dp[0] = 0;
  while(n--) {
    int value, cost;
    cin >> value >> cost;
    for(int i = 0; i <= H; i++) { // O(N*H)
      // dp[i] -> dp[i+value]
      int j = min(H, i + value);
      dp[j] = min(dp[j], dp[i] + cost);
    }
    cout << dp[H] << endl;
}

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

#include<bits/stdc++.h>
using namespace std;
 
int d[1123];
int c[1123];
 
int memo[11234];
 
int max_ans = 1e8 + 55;
int h, n;
 
int solve(int h){
	if(h <= 0) return 0;
    int & ret = memo[h];
  	if(ret != -1) return ret;
    ret =  c[0] + solve(h - d[0] );
    for(int i = 1; i < n; i++){
    	ret = min(ret, c[i] + solve(h - d[i]) );
    }
  	return ret;
}
 
int main(){
  scanf("%d %d", &h, &n);
  for(int i = 0; i < n; i++){
  	scanf("%d %d", d + i, c + i);
  }
  memset(memo, -1, sizeof memo);
  printf("%d\n", solve(h));
}
#include<bits/stdc++.h>
using namespace std;

int d[1123];
int c[1123]

int memo[11234];

int max_ans = 1e8 + 55;
int h, n;

int solve(int h){
	if(h <= 0) return 0;
    int & ret = memo[h];
  	if(ret != -1) return ret;
    ret =  c[0] + solve(h - d[0] );
    for(int i = 1; i < n; i++){
    	ret = min(ret, c[i] + solve(h - d[i]) );
    }
  	return ret;
}

int main(){
  scanf("%d %d", &h, &n);
  for(int i = 0; i < n; i++){
  	scanf("%d %d", d + i, c + i);
  }
  memset(memo, -1, sizeof memo);
  printf("%d\n", solve(h));
}


Compiler output:
a.cc:34:5: error: redefinition of 'int d [1123]'
   34 | int d[1123];
      |     ^
a.cc:4:5: note: 'int d [1123]' previously declared here
    4 | int d[1123];
      |     ^
a.cc:37:1: error: expected initializer before 'int'
   37 | int memo[11234];
      | ^~~
a.cc:39:5: error: redefinition of 'int max_ans'
   39 | int max_ans = 1e8 + 55;
      |     ^~~~~~~
a.cc:9:5: note: 'int max_ans' previously defined here
    9 | int max_ans = 1e8 + 55;
      |     ^~~~~~~
a.cc:40:5: error: redefinition of 'int h'
   40 | int h, n;
      |     ^
a.cc:10:5: note: 'int h' previously declared here
   10 | int h, n;
      |     ^
a.cc:40:8: error: redefinition of 'int n'
   40 | int h, n;
      |        ^
a.cc:10:8: note: 'int n' previously declared here
   10 | int h, n;
      |        ^
a.cc:42:5: error: redefinition of 'int solve(int)'
   42 | int solve(int h){
      |     ^~~~~
a.cc:12:5: note: 'int solve(int)' previously defined here
   12 | int solve(int h){
      |     ^~~~~
a.cc:53:5: error: redefinition of 'int main()'
   53 | int main(){
      |     ^~~~
a.cc:23:5: note: 'int main()' previously defined here
   23 | int main(){
      |     ^~~~
Language: C++

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

int d[1123];
int c[1123]

int memo[11234];

int max_ans = 1e8 + 55;
int h, n;

int solve(int h){
	if(h <= 0) return 0;
    int & ret = memo[h];
  	if(ret != -1) return ret;
    ret =  c[0] + solve(h - d[0] );
    for(int i = 1; i < n; i++){
    	ret = min(ret, c[i] + solve(h - d[i]) );
    }
  	return ret;
}

int main(){
  scanf("%d %d", &h, &n);
  for(int i = 0; i < n; i++){
  	scanf("%d %d", d + i, c + i);
  }
  memset(memo, -1, sizeof memo);
  printf("%d\n", solve(h));
}

Compiler output:
a.cc:7:1: error: expected initializer before 'int'
    7 | int memo[11234];
      | ^~~
a.cc: In function 'int solve(int)':
a.cc:14:17: error: 'memo' was not declared in this scope
   14 |     int & ret = memo[h];
      |                 ^~~~
a.cc:16:12: error: 'c' was not declared in this scope
   16 |     ret =  c[0] + solve(h - d[0] );
      |            ^
a.cc: In function 'int main()':
a.cc:26:31: error: 'c' was not declared in this scope
   26 |         scanf("%d %d", d + i, c + i);
      |                               ^
a.cc:28:10: error: 'memo' was not declared in this scope
   28 |   memset(memo, -1, sizeof memo);
      |          ^~~~
Language: C++

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

int d[1123];
int c[1123]

int memo[11234];

int max_ans = 1e8 + 55;
int h, n;

int solve(int h){
	if(h <= 0) return 0;
    int & ret = memo[h];
  	if(ret != -1) return ret;
    ret =  c[0] + solve(h - d[0] );
    for(int i = 1; i < n; i++){
    	ret = min(ret, c[i] + solve(h - d[i]) );
    }
  	return ret;
}

int main(){
  scanf("%d %d", &h, &n);
  for(int i = 0; i < n; i++){
  	scanf("%d %d", d + i, c + i);
  }
  memset(memo, -1, sizeof memo);
  printf("%d\n", solve(h));
}

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

#include<stdio.h>

int d[1123];
int c[1123]

int memo[11234];

int max_ans = 1e8 + 55;
int h, n;

int solve(int h){
	if(h <= 0) return 0;
    int & ret = memo[h];
  	if(ret != -1) return ret;
    ret =  c[0] + solve(h - d[0] );
    for(int i = 1; i < n; i++){
    	ret = min(ret, c[i] + solve(h - d[i]) );
    }
  	return ret;
}

int main(){
  scanf("%d %d", &h, &n);
  for(int i = 0; i < n; i++){
  	scanf("%d %d", d + i, c + i);
  }
  memset(memo, -1, sizeof memo);
  printf("%d\n", solve(h));
}

Compiler output:
a.cc:6:1: error: expected initializer before 'int'
    6 | int memo[11234];
      | ^~~
a.cc: In function 'int solve(int)':
a.cc:13:17: error: 'memo' was not declared in this scope
   13 |     int & ret = memo[h];
      |                 ^~~~
a.cc:15:12: error: 'c' was not declared in this scope
   15 |     ret =  c[0] + solve(h - d[0] );
      |            ^
a.cc:17:15: error: 'min' was not declared in this scope
   17 |         ret = min(ret, c[i] + solve(h - d[i]) );
      |               ^~~
a.cc: In function 'int main()':
a.cc:25:31: error: 'c' was not declared in this scope
   25 |         scanf("%d %d", d + i, c + i);
      |                               ^
a.cc:27:10: error: 'memo' was not declared in this scope
   27 |   memset(memo, -1, sizeof memo);
      |          ^~~~
a.cc:27:3: error: 'memset' was not declared in this scope
   27 |   memset(memo, -1, sizeof memo);
      |   ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<stdio.h>
  +++ |+#include <cstring>
    2 |
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define Max 10001;
struct p{
	int health;
	int point;
};
int main() {
int h,n;
cin>>h>>n;
p spell[n];
int m=1000000;
for(int i=0;i<n;i++){
	cin>>spell[i].health>>spell[i].point;
	m=min(spell[i].health,m);
}
int len=h+1;
	int health[len];
	health[0]=0;
	for(int i=1;i<m;i++)
	health[i]=1000000;
	cout<<m<<h;
	for(int i=m;i<=h;i++){
	//	cout<<"yo";
		int final=Max;
		for(int j=0;j<n;j++){
			int x=spell[i].health;
			int temp;
			if((i-x)>-1){
				temp=health[i-x];
			}
			else
			temp=Max;
			int cand=spell[j].point+temp;
			final=min(final,cand);
		}
		health[i]=final;
		
	}
cout<<health[i];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:14: error: 'i' was not declared in this scope
   40 | cout<<health[i];
      |              ^