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

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void) {
    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<vector<int>> data(N + 1, vector<int>(H + 1, INT_MAX));
    for (int i = 0; i<N; i++) {
        for (int j = 0; j <= H; j++) {
            if (j - A[i]<=0) {
                data[i + 1][j] = min(data[i][j], B[i]);
            }
            else {
                data[i + 1][j] = min(data[i][j], data[i + 1][j - A[i]] + B[i]);
            }
        }
    }

    cout << data[N][H] << endl;
    return 0;
}

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

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

int main() {
  long H,N;
  cin >> H >> N;
  int ans;
  vector<long> A(N);
  vector<int> B(N);
  for(int i = 0; i < N ; i++){
    cin >> A.at(i) >> B.at(i) ; //代入
    ans = min_element(B.begin(),B.end());
  }
  long same = 0;
  double max = 0; //最も効率のいい魔法　
  vector<long> maxA(N);//最も効率のいい魔法の力
  vector<long> maxB(N);//最も効率のいい魔法の体力
  for(long j = 0; j < N; j++){//vectorの代入
    maxA.at(j) = 0;
    maxB.at(j) = 0;
    for(long i = j + same; i < N; i++){//maxの選定 i=0が最大
      if(max < A.at(i) / B.at(i)){
        max = A.at(i) / B.at(i);
        maxA.at(j) = A.at(i);
        maxB.at(j) = B.at(i);
      }else if(max = A.at(i) / B.at(i)){
        if(maxA.at(j) < A.at(i)){
          maxA.at(j) = A.at(i);
          maxB.at(j) = B.at(i);
        }else{
          maxA.at(j+1) = A.at(i);
          maxB.at(j+1) = B.at(i);
          same += 1;
        }
      }
    }
    for(long i = j; i < N; i++){
      if(maxA.at(j) == A.at(i) && maxB.at(j) == B.at(i)){
        A.at(i) = 0;
        B.at(i) = 0;
      }
    }
  }
    long count = 0;
    long extra = H;
    for(int j = 0; j < N; j++){
      if(extra >= maxA.at(j)){
        count += (extra / maxA.at(j)) * maxB.at(j);
        if(H % maxA.at(j) != 0){
          extra = H % maxA.at(j);
          continue;
        }else{
          break;
        }
      }else{
        count += ans;
      }
    }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in assignment
   13 |     ans = min_element(B.begin(),B.end());
      |           ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
      |                      |
      |                      __gnu_cxx::__normal_iterator<int*, std::vector<int> >
Language: C++

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

int main() {
  long H,N;
  cin >> H >> N;
  vector<long> A(N);
  vector<int> B(N);
  for(int i = 0; i < N ; i++){
    cin >> A.at(i) >> B.at(i) ; //代入
  }
  long same = 0;
  double max = 0; //最も効率のいい魔法　
  vector<long> maxA(N);//最も効率のいい魔法の力
  vector<long> maxB(N);//最も効率のいい魔法の体力
  for(long j = 0; j < N; j++){//vectorの代入
    maxA.at(j) = 0;
    maxB.at(j) = 0;
    for(long i = j + same; i < N; i++){//maxの選定 i=0が最大
      if(max < A.at(i) / B.at(i)){
        max = A.at(i) / B.at(i);
        maxA.at(j) = A.at(i);
        maxB.at(j) = B.at(i);
      }else if(max = A.at(i) / B.at(i)){
        if(maxA.at(j) < A.at(i)){
          maxA.at(j) = A.at(i);
          maxB.at(j) = B.at(i);
        }else{
          maxA.at(j+1) = A.at(i);
          maxB.at(j+1) = B.at(i);
          same += 1;
        }
      }
    }
    for(long i = j; i < N; i++){
      if(maxA.at(j) == A.at(i) && maxB.at(j) == B.at(i)){
        A.at(i) = 0;
        B.at(i) = 0;
      }
    }
  }
    long count = 0;
    long extra = H;
    for(int j = 0; j < N; j++){
      if(extra >= maxA.at(j)){
        count += (extra / maxA.at(j)) * maxB.at(j);
        if(H % maxA.at(j) != 0){
          extra = H % maxA.at(j);
          continue;
        }else{
          break;
        }
      }else{
        int ans = min(B.begin(),B.end());
        count += ans;
      }
    }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:22: error: cannot convert 'const __gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization
   54 |         int ans = min(B.begin(),B.end());
      |                   ~~~^~~~~~~~~~~~~~~~~~~
      |                      |
      |                      const __gnu_cxx::__normal_iterator<int*, std::vector<int> >
Language: C++

#include<bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; i++)
#define repo(i, n) for(int i=1; i<=n; i++)
#define NMAX 1005
#define HMAX 10005

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

const int inf=1000000000;
int h, n;
int A[HMAX], B[HMAX];
int dp[NMAX][HMAX];

int main(){
  cin >> h >> n;
  rep(i, n){
    cin >> A[i] >> B[i];
  }
  rep(i, n){
    repo(j, h){
      dp[i][j]=inf;
    }
  }
  rep(j, h+1){
    dp[0][j]=((j+A[0]-1)/A[0])*B[0];
  }

  repo(i, n-1){
    rep(l, A[i]){
      dp[i][l]=min(dp[i-1][j],B[i]);
    }
    for(int j=A[i]+1; j<=h; j++){
      int k=0;
      while(j-k*A[i]>0){
        dp[i][j]=min(dp[i][j], dp[i-1][j-k*A[i]]+B[i]*k);
        k++;
      }
    }
  }
  /*
  rep(i, n){
    repo(j, h){
      cout << dp[i][j]  << " ";
    }
    cout << endl;
  }
  */
  cout << dp[n-1][h] << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:28: error: 'j' was not declared in this scope
   32 |       dp[i][l]=min(dp[i-1][j],B[i]);
      |                            ^
Language: C++

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

int main() {
  long H,N;
  cin >> H >> N;
  vector<long> A(N);
  vector<int> B(N);
  for(long i = 0; i < N ; i++){
    cin >> A.at(i) >> B.at(i) ; //代入
  }
  long same = 0;
  double max = 0; //最も効率のいい魔法　
  vector<long> maxA(N);//最も効率のいい魔法の力
  vector<long> maxB(N);//最も効率のいい魔法の体力
  for(long j = 0; j < N; j++){//vectorの代入
    maxA.at(j) = 0;
    maxB.at(j) = 0;
    for(long i = j + same; i < N; i++){//maxの選定 i=0が最大
      if(max < A.at(i) / B.at(i)){
        max = A.at(i) / B.at(i);
        maxA.at(j) = A.at(i);
        maxB.at(j) = B.at(i);
      }else if(max = A.at(i) / B.at(i)){
        if(maxA.at(j) < A.at(i)){
          maxA.at(j) = A.at(i);
          maxB.at(j) = B.at(i);
        }else{
          maxA.at(j+1) = A.at(i);
          maxB.at(j+1) = B.at(i);
          same += 1;
        }
      }
    }
    for(long i = j; i < N; i++){
      if(maxA.at(j) == A.at(i) && maxB.at(j) == B.at(i)){
        A.at(i) = 0;
        B.at(i) = 0;
      }
    }
  }
    long count = 0;
    long extra = H;
    for(long j = 0; j < N; j++){
      if(extra >= maxA.at(j)){
        count += (extra / maxA.at(j)) * maxB.at(j);
        if(H % maxA.at(j) != 0){
          extra = H % maxA.at(j);
          continue;
        }else{
          break;
        }
      }else{
        int ans = min(B.begin(),B.end());
        count += ans;
      }
    }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:22: error: cannot convert 'const __gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization
   54 |         int ans = min(B.begin(),B.end());
      |                   ~~~^~~~~~~~~~~~~~~~~~~
      |                      |
      |                      const __gnu_cxx::__normal_iterator<int*, std::vector<int> >
Language: C++

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

int main() {
  long H,N;
  cin >> H >> N;
  vector<long> A(N);
  vector<long> B(N);
  for(int i = 0; i < N ; i++){
    cin >> A.at(i) >> B.at(i) ;
  }
  long max = 0;
  vector<long> maxA(N);
  vector<long> maxB(N);
  for(int j = 0; j < N; j++){
    maxA.at(j) = 0;
    maxB.at(j) = 0;
    for(int i = j; i < N; i++){
      if(max < A.at(j) / B.at(j)){
        maxA.at(j) = A.at(i);
        maxB.at(j) = B.at(i);
        A.at(i) = 0;
        B.at(i) = 0;
      }
    }
  }
    long count = 0;
    long extra = H;
    for(int i = 0; i < N; i++){
      if(extra <= maxA.at(j)){
        count += (extra / maxA.at(j)) * maxB.at(j);
      }else{
        count += maxB.at(j-1);
      }
        if(H % maxA.at(j) != 0){
          extra = H % maxA.at(j);
          continue;
        }else{
          break;
        }
    }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:27: error: 'j' was not declared in this scope
   30 |       if(extra <= maxA.at(j)){
      |                           ^
a.cc:35:24: error: 'j' was not declared in this scope
   35 |         if(H % maxA.at(j) != 0){
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define inf 100000000000000000
#define ll long long int
#define pb push_back
#define f first
#define s second
#define mod 1000000007
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
void mahakal(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	freopen("error.txt","w",stderr);
	#endif
}

int main(){
	//mahakal();fast;

	ll h,n;
	cin>>h>>n;
	ll a[n+1],b[n+1];
	for(ll i=0;i<n;i++){
		cin>>a[i]>>b[i];
	}
	ll dp[h+1];
	ll inf=1e9;dp[0]=0;
	for(ll i=1;i<=h;i++){
		dp[i]=inf;ll temp;
		for(ll j=0;j<n ;j++){
			if(i-a[j]<0) temp=0;
			else temp=dp[i-a[j]];
			dp[i]=min(b[j]+temp , dp[i]);
		}
	}
	cout<<dp[h]<<endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:13: error: expected unqualified-id before numeric constant
    3 | #define inf 100000000000000000
      |             ^~~~~~~~~~~~~~~~~~
a.cc:28:12: note: in expansion of macro 'inf'
   28 |         ll inf=1e9;dp[0]=0;
      |            ^~~
Language: Java


import static java.lang.Math.max;
import static java.lang.Math.min;
import java.util.Scanner;


public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    final int h = scanner.nextInt();
    final int n = scanner.nextInt();
    final int[] a = new int[n];
    final int[] b = new int[n];
    int max = 0;
    
    for (int i = 0; i < n; i++) {
      a[i] = scanner.nextInt();
      b[i] = scanner.nextInt();
      max = (max, a[i]);
    }

    final int[][] dp = new int[n][h+max];

    dp[0][0] = b[0];
    for (int i = 1; i < h+max; i++) {
      dp[0][i] = b[0] * (int) Math.ceil((double) i /(double) a[0]);
    }
    for (int i = 1; i < n; i++) {
      for (int j = 0; j < h+max ; j++) {
        if(j >= a[i]) {
          dp[i][j] = min(dp[i][j-a[i]] + b[i] , dp[i-1][j]);
        } else {
          dp[i][j] = min(dp[i-1][j], b[i]);
        }
      }
    }

    int min = Integer.MAX_VALUE;
    for (int i = 0; i < n; i++) {
      min = min(min, dp[i][h]);
    }
    System.out.println(min);

  }
}


Compiler output:
Main.java:20: error: ')' expected
      max = (max, a[i]);
                ^
Main.java:20: error: not a statement
      max = (max, a[i]);
                   ^
Main.java:20: error: ';' expected
      max = (max, a[i]);
                      ^
3 errors
Language: C++

import static java.lang.Math.max;
import static java.lang.Math.min;
import java.util.Scanner;


public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    final int h = scanner.nextInt();
    final int n = scanner.nextInt();
    final int[] a = new int[n];
    final int[] b = new int[n];
    final int[][] dp = new int[n][h+1];

    for (int i = 0; i < n; i++) {
      a[i] = scanner.nextInt();
      b[i] = scanner.nextInt();
    }

    dp[0][0] = b[0];
    for (int i = 1; i <= h; i++) {
      dp[0][i] = b[0] * (int) Math.ceil((double) i /(double) a[0]);
    }
    for (int i = 1; i < n; i++) {
      for (int j = 0; j <= h ; j++) {
        if(j >= a[i]) {
          dp[i][j] = min(dp[i][j-a[i]] + b[i] , dp[i-1][j]);
        } else {
          dp[i][j] = min(dp[i-1][j], b[i]);
        }
      }
    }

    int min = Integer.MAX_VALUE;
    for (int i = 0; i < n; i++) {
      min = min(min, dp[i][h]);
    }
    System.out.println(min);

  }
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import static java.lang.Math.max;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import static java.lang.Math.min;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.Scanner;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: expected unqualified-id before 'public'
    6 | public class Main {
      | ^~~~~~
Language: C++

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

int main(){
  ll h,n; cin >> h >> n;
  vector<ll> dp(h+1);
  ll INF = 1000000000;
  fill(dp.begin(),dp.end(),INF);
  vector<pair<ll,ll>> pairs(n);
  for(ll i=0; i<n; i++){
    ll a,b;cin >> a >> b;
    pairs.at(n) = make_pair(a,b);
  }
  dp.at(0) = 0;
  for(ll i=1; i<=h; i++){
    for(ll j=0; j<n; j++){
      ll A,B;
      A = pairs.at(j).first; B = pairs.at(j).second;
      A = max(0, i-A);
      dp.at(i) = min(dp.at(i), dp.at(A) + B);
    }
  }
  cout << dp.at(h) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: no matching function for call to 'max(int, ll)'
   20 |       A = max(0, i-A);
      |           ~~~^~~~~~~~
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:20:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   20 |       A = max(0, i-A);
      |           ~~~^~~~~~~~
/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:20:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   20 |       A = max(0, i-A);
      |           ~~~^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10;
struct node{
    int a;
    int b;
}A[N];

int H, n;
int dp[10010];

int main() {
    scanf("%d%d", &H, &n);
    for (int i = 1; i <= n; i++) scanf("%d%d", &A[i].a, &A[i].b);
    for (int i = 1; i <= H; i++) dp[i] = INT_MAX;
    dp[0] = 0;
    for (int i = 0; i <= H; i++) {
        for (int j = 1; j <= n; j++) {
            if (i >= A[j].a) {
                dp[i] = min(dp[i], dp[i-A[j].a] + A[j].b);
            } else {
                dp[i] = min(dp[i], dp[0] + A[j].b);
            }
        }
    }
    cout << dp[H] << endl;
    return 0;
}

→ Ответить 

Compiler output:
a.cc:30:1: error: extended character → is not valid in an identifier
   30 | → Ответить
      | ^
a.cc:30:1: error: '\U00002192' does not name a type
   30 | → Ответить
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef vector< pair<int,int> > vii;
typedef long long ll;
int main()
{
    int H, N;
    cin>>H>>N;
    vii v(N);
    vector<ll> dp(H + 1, 1000000000);
    dp[0] = 0;
    for(int i = 0; i < N; i++)
    {
        cin>>[i].F>> v[i].S;
    }
    for(int i = 1; i <= H; i++)
    {
        for(int j = 0; j < N; j++)
        {
            dp[i] = min(dp[i], dp[max(i-v[j].F, 0)] + v[j].S);
        }
    }
    cout << dp[H] << endl;
}


Compiler output:
a.cc: In lambda function:
a.cc:16:17: error: expected '{' before '.' token
   16 |         cin>>[i].F>> v[i].S;
      |                 ^
a.cc: In function 'int main()':
a.cc:3:11: error: 'struct main()::<lambda()>' has no member named 'first'
    3 | #define F first
      |           ^~~~~
a.cc:16:18: note: in expansion of macro 'F'
   16 |         cin>>[i].F>> v[i].S;
      |                  ^
Language: C++

// AtCoder Beginner Contest 153 E.cpp

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

using namespace std;

int main()
{
	int h = 0, n = 0, answer = INT_MAX, max_power = 0, min_magic = INT_MAX;
	cin >> h >> n;
	vector<int>a(n);
	vector<int>b(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i] >> b[i];
		if (b[i] < min_magic) { //魔力最小探し
			min_magic = b[i];
			continue;
		}
		if (a[i] > max_power) { //攻撃力最大探し
			max_power = a[i];
		}
	}
	vector<int>dp(h + max_power + 1, INT_MAX); //INT_MAXで埋めた"h+max_power"なdp配列

	dp[0] = 0; dp[1] = min_magic; //先に入れる体力が0と1のとき
	for (int i = 2; i < int(dp.size()); i++) {
		for (int j = 0; j < int(a.size()); j++) {
			if (0 < i - a[j]) {                 //候補の攻撃で倒しきれないとき
				if (dp[i] > dp[i - a[j]] + b[j])
					dp[i] = dp[i - a[j]] + b[j]; //かつ値が小さくなっていたら更新
			}
			else {                //候補の攻撃で倒しきれるとき
				if (dp[i] > b[j])
					dp[i] = b[j]; //かつ値が小さくなっていたら更新
			}
		}
	}

	/*for (auto i : dp) {
		cout << i << endl;
	}
	cout << endl;*/

	for (int i = h; i < int(dp.size()); i++) { //倒しきれる中での最小を探す
		if (answer > dp[i])
			answer = dp[i];
	}

	cout << answer << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:36: error: 'INT_MAX' was not declared in this scope
   11 |         int h = 0, n = 0, answer = INT_MAX, max_power = 0, min_magic = INT_MAX;
      |                                    ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include <algorithm>
  +++ |+#include <climits>
    6 | 
a.cc:17:28: error: 'min_magic' was not declared in this scope
   17 |                 if (b[i] < min_magic) { //魔力最小探し
      |                            ^~~~~~~~~
a.cc:21:28: error: 'max_power' was not declared in this scope
   21 |                 if (a[i] > max_power) { //攻撃力最大探し
      |                            ^~~~~~~~~
a.cc:25:27: error: 'max_power' was not declared in this scope
   25 |         vector<int>dp(h + max_power + 1, INT_MAX); //INT_MAXで埋めた"h+max_power"なdp配列
      |                           ^~~~~~~~~
a.cc:27:28: error: 'min_magic' was not declared in this scope
   27 |         dp[0] = 0; dp[1] = min_magic; //先に入れる体力が0と1のとき
      |                            ^~~~~~~~~
Language: C++

// AtCoder Beginner Contest 153 E.cpp

#include <iostream>
#include <vector>
#include <limits>

using namespace std;

int main()
{
	int h = 0, n = 0, answer = INT_MAX,
		max_power = 0, min_magic = INT_MAX;
	cin >> h >> n;
	vector<int>a(n);
	vector<int>b(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i] >> b[i];
		if (b[i] < min_magic) { //魔力最小探し
			min_magic = b[i];
			continue;
		}
		if (a[i] > max_power) { //攻撃力最大探し
			max_power = a[i];
		}
	}
	vector<int>dp(h + max_power + 1, INT_MAX); //INT_MAXで埋めた"h+max_power"なdp配列

	dp[0] = 0; dp[1] = min_magic; //先に入れる体力が0と1のとき
	for (int i = 2; i < int(dp.size()); i++) {
		for (int j = 0; j < int(a.size()); j++) {
			if (0 < i - a[j]) {                 //候補の攻撃で倒しきれないとき
				if (dp[i] > dp[i - a[j]] + b[j])
					dp[i] = dp[i - a[j]] + b[j]; //かつ値が小さくなっていたら更新
			}
			else {                //候補の攻撃で倒しきれるとき
				if (dp[i] > b[j])
					dp[i] = b[j]; //かつ値が小さくなっていたら更新
			}
		}
	}

	/*for (auto i : dp) {
		cout << i << endl;
	}
	cout << endl;*/

	for (int i = h; i < int(dp.size()); i++) { //倒しきれる中での最小を探す
		if (answer > dp[i])
			answer = dp[i];
	}

	cout << answer << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:36: error: 'INT_MAX' was not declared in this scope
   11 |         int h = 0, n = 0, answer = INT_MAX,
      |                                    ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include <limits>
  +++ |+#include <climits>
    6 | 
a.cc:18:28: error: 'min_magic' was not declared in this scope
   18 |                 if (b[i] < min_magic) { //魔力最小探し
      |                            ^~~~~~~~~
a.cc:22:28: error: 'max_power' was not declared in this scope
   22 |                 if (a[i] > max_power) { //攻撃力最大探し
      |                            ^~~~~~~~~
a.cc:26:27: error: 'max_power' was not declared in this scope
   26 |         vector<int>dp(h + max_power + 1, INT_MAX); //INT_MAXで埋めた"h+max_power"なdp配列
      |                           ^~~~~~~~~
a.cc:28:28: error: 'min_magic' was not declared in this scope
   28 |         dp[0] = 0; dp[1] = min_magic; //先に入れる体力が0と1のとき
      |                            ^~~~~~~~~
Language: C++

// AtCoder Beginner Contest 153 E.cpp

#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int h = 0, n = 0, answer = _I32_MAX,
		max_power = 0, min_magic = _I32_MAX;
	cin >> h >> n;
	vector<int>a(n);
	vector<int>b(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i] >> b[i];
		if (b[i] < min_magic) { //魔力最小探し
			min_magic = b[i];
			continue;
		}
		if (a[i] > max_power) { //攻撃力最大探し
			max_power = a[i];
		}
	}
	vector<int>dp(h + max_power + 1, _I32_MAX); //INT_MAXで埋めた"h+max_power"なdp配列

	dp[0] = 0; dp[1] = min_magic; //先に入れる体力が0と1のとき
	for (int i = 2; i < int(dp.size()); i++) {
		for (int j = 0; j < int(a.size()); j++) {
			if (0 < i - a[j]) {                 //候補の攻撃で倒しきれないとき
				if (dp[i] > dp[i - a[j]] + b[j])
					dp[i] = dp[i - a[j]] + b[j]; //かつ値が小さくなっていたら更新
			}
			else {                //候補の攻撃で倒しきれるとき
				if (dp[i] > b[j])
					dp[i] = b[j]; //かつ値が小さくなっていたら更新
			}
		}
	}

	/*for (auto i : dp) {
		cout << i << endl;
	}
	cout << endl;*/

	for (int i = h; i < int(dp.size()); i++) { //倒しきれる中での最小を探す
		if (answer > dp[i])
			answer = dp[i];
	}

	cout << answer << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:36: error: '_I32_MAX' was not declared in this scope
   10 |         int h = 0, n = 0, answer = _I32_MAX,
      |                                    ^~~~~~~~
a.cc:17:28: error: 'min_magic' was not declared in this scope
   17 |                 if (b[i] < min_magic) { //魔力最小探し
      |                            ^~~~~~~~~
a.cc:21:28: error: 'max_power' was not declared in this scope
   21 |                 if (a[i] > max_power) { //攻撃力最大探し
      |                            ^~~~~~~~~
a.cc:25:27: error: 'max_power' was not declared in this scope
   25 |         vector<int>dp(h + max_power + 1, _I32_MAX); //INT_MAXで埋めた"h+max_power"なdp配列
      |                           ^~~~~~~~~
a.cc:27:28: error: 'min_magic' was not declared in this scope
   27 |         dp[0] = 0; dp[1] = min_magic; //先に入れる体力が0と1のとき
      |                            ^~~~~~~~~
Language: C++

// AtCoder Beginner Contest 153 E.cpp

#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int h = 0, n = 0, answer = INT_MAX,
		max_power = 0, min_magic = INT_MAX;
	cin >> h >> n;
	vector<int>a(n);
	vector<int>b(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i] >> b[i];
		if (b[i] < min_magic) { //魔力最小探し
			min_magic = b[i];
			continue;
		}
		if (a[i] > max_power) { //攻撃力最大探し
			max_power = a[i];
		}
	}
	vector<int>dp(h + max_power + 1, INT_MAX); //INT_MAXで埋めた"h+max_power"なdp配列

	dp[0] = 0; dp[1] = min_magic; //先に入れる体力が0と1のとき
	for (int i = 2; i < int(dp.size()); i++) {
		for (int j = 0; j < int(a.size()); j++) {
			if (0 < i - a[j]) {                 //候補の攻撃で倒しきれないとき
				if (dp[i] > dp[i - a[j]] + b[j])
					dp[i] = dp[i - a[j]] + b[j]; //かつ値が小さくなっていたら更新
			}
			else {                //候補の攻撃で倒しきれるとき
				if (dp[i] > b[j])
					dp[i] = b[j]; //かつ値が小さくなっていたら更新
			}
		}
	}

	/*for (auto i : dp) {
		cout << i << endl;
	}
	cout << endl;*/

	for (int i = h; i < int(dp.size()); i++) { //倒しきれる中での最小を探す
		if (answer > dp[i])
			answer = dp[i];
	}

	cout << answer << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:36: error: 'INT_MAX' was not declared in this scope
   10 |         int h = 0, n = 0, answer = INT_MAX,
      |                                    ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <vector>
  +++ |+#include <climits>
    5 | 
a.cc:17:28: error: 'min_magic' was not declared in this scope
   17 |                 if (b[i] < min_magic) { //魔力最小探し
      |                            ^~~~~~~~~
a.cc:21:28: error: 'max_power' was not declared in this scope
   21 |                 if (a[i] > max_power) { //攻撃力最大探し
      |                            ^~~~~~~~~
a.cc:25:27: error: 'max_power' was not declared in this scope
   25 |         vector<int>dp(h + max_power + 1, INT_MAX); //INT_MAXで埋めた"h+max_power"なdp配列
      |                           ^~~~~~~~~
a.cc:27:28: error: 'min_magic' was not declared in this scope
   27 |         dp[0] = 0; dp[1] = min_magic; //先に入れる体力が0と1のとき
      |                            ^~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#define ll long long
#define REP(i,n) for(int i=0;i<(n);i++)
using namespace std;
ll h,n;
ll a[2000],b[2000];
ll dp[1001][10001];
ll run(ll i,ll l)
{
	if(l<=0)
	{
		return 0;
	}	
	if(i==n)
	{
		if(l==0)
		{
			return 0;
		}	
		return 1e18;
	}
	if(dp[i][l]!=-1)
	{
		return dp[i][l];
	}	
	return dp[i][l]=min(run(i+1,l),b[i]+run(i,l-a[i]),b[i]+run(i+1,l-a[i]));
}
int main()
{
    cin>>h>>n;
    REP(i,n)
    {
		cin>>a[i]>>b[i];
	}	
    memset(dp,-1,sizeof(dp));
    cout<<run(0,h);
}

Compiler output:
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: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]':
a.cc:26:21:   required from here
   26 |         return dp[i][l]=min(run(i+1,l),b[i]+run(i,l-a[i]),b[i]+run(i+1,l-a[i]));
      |                         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int h,n;
    vector<pair<int,int> > ab;
    vector<int> dp;
    cin >> h >> n;
    for (int i = 0; i < n; i++)
    {
        pair<int,int> p;
        int a,b;
        cin >> a >> b;
        p = make_pair(a,b);
        ab.push_back(p);
    }
    dp.push_back(0);
    for (int i = 1; i < h+1; i++)
    {
        dp.push_back(INT_MAX);
    }
    for (int i = 1; i < h+1; i++)
    {
        for (int j = 0; j < n; j++)
        {
            int idx;
            idx = max(0,i-ab[j].first);
            dp[i] = min(dp[i], dp[idx] + ab[j].second);
        }
        
    }
    cout << dp[h] << "\n";
    
    return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
 
int main(){
 int H;
 int N;
 long long int dp[20000]={1e10};
 cin >> H >> N;
 int D[N];
 int M[N];
 for(int i=0;i<N;i++)cin >> D[i] >> M[i];
 for(int i=0;i<H+1;i++){    //モンスターのHPでのDP
     for(int j=0;j<N;j++){  //HPごとに技ごとで最小のMPをチェック
         dp[i]=min(dp[i],dp[max(0,i-D[j])]+M[j]);
     }}
     cout << dp[H] << endl;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:27: error: narrowing conversion of '1.0e+10' from 'double' to 'long long int' [-Wnarrowing]
    7 |  long long int dp[20000]={1e10};
      |                           ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
 int H;
 int N;
 long long dp[20000]={1e18};
 cin >> H >> N;
 int D[N];
 int M[N];
 for(int i=0;i<N;i++)cin >> D[i] >> M[i];
 for(int i=0;i<H+1;i++){    //モンスターのHPでのDP
     for(int j=0;j<N;j++){  //HPごとに技ごとで最小のMPをチェック
         dp[i]=min(dp[i],dp[max(0,i-D[j])]+M[j]);
     }}
     cout << dp[H] << endl;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: narrowing conversion of '1.0e+18' from 'double' to 'long long int' [-Wnarrowing]
    7 |  long long dp[20000]={1e18};
      |                       ^~~~
Language: C++

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <functional>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
using Graph=vector<vector<int>>;
using edge= struct{int to;ll cost;};


template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}

// swap(a,b);
// abs(a,b); a,bの型は問わない
// reverse(a+I,a+r); aは配列,a[i]からa[r-1]までを逆順にする.計算量はN. reverse(str.begin(),str.end());
// sortも上とあまり変わらない.
// ただし,sort(a,a+N,greater<int>());で大きい順にならべかえる.
// stack<int> a; 宣言 上に積み上げたものをとったり、一番上に積み上げる.
// a.push(x); aに要素xをつむ a.pop(); a.size(); a.empty(); これはtrue or false
// a.top;で一番上の要素を返す
// queue<int> a; a.front();
// priority_queue<int,vector<int>,greater<int>> Q1; 最も小さい奴を取り出す
// priority_queue<double,vector<double>,less<double>> Q2;最も大きい値を取り出す
// Q1.top();ができる
// count(a+l,a+r,x);
// find(a+l,a+r,x);
// 文字変換
//char a='a';
//a=a+1;
//cout<<a<<endl;

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<long long> dp(H+1, INF);
    dp[0] = 0;
    for (int i = 0; i < N; ++i) {
        for (int j = 0; j <= H; ++j) {
            chmin(dp[min(j+A[i], H)], dp[j] + B[i]);
        }
    }
    cout << dp[H] << endl;
}

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

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <functional>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
using Graph=vector<vector<int>>;
using edge= struct{int to;ll cost;};


template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}

// swap(a,b);
// abs(a,b); a,bの型は問わない
// reverse(a+I,a+r); aは配列,a[i]からa[r-1]までを逆順にする.計算量はN. reverse(str.begin(),str.end());
// sortも上とあまり変わらない.
// ただし,sort(a,a+N,greater<int>());で大きい順にならべかえる.
// stack<int> a; 宣言 上に積み上げたものをとったり、一番上に積み上げる.
// a.push(x); aに要素xをつむ a.pop(); a.size(); a.empty(); これはtrue or false
// a.top;で一番上の要素を返す
// queue<int> a; a.front();
// priority_queue<int,vector<int>,greater<int>> Q1; 最も小さい奴を取り出す
// priority_queue<double,vector<double>,less<double>> Q2;最も大きい値を取り出す
// Q1.top();ができる
// count(a+l,a+r,x);
// find(a+l,a+r,x);
// 文字変換
//char a='a';
//a=a+1;
//cout<<a<<endl;


int inf =1000000;


int main(){
  int H,N;cin>>H>>N;
  VI a(N);
  VI b(N);
  VI hp(H+1);

  REP(i,N){
    cin>>a[i]>>b[i];
  }
  REP(i,H+1){
    hp[i]=inf;
  }
  hp[0]=0;
  for(int j=0;i<H;i++){
    for(int i=0;j<N;j++){
      if(i+a[j]>=H){
        if(hp[H]>=hp[i]+b[j]){
          hp[H]=hp[i]+b[j];
        }
      }
      else{
        if(hp[i+a[j]]>=hp[i]+b[j]){
          hp[i+a[j]]=hp[i]+b[j];
        }
      }
    }
  }
  cout<<hp[H]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:77:15: error: 'i' was not declared in this scope
   77 |   for(int j=0;i<H;i++){
      |               ^
Language: C++

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

const int N = (1e3) + 3;
const int H = (1e4) + 3;
const ll OO = 1e9;
bool done[N][H];
ll memo[N][H];
ll n, h, a[N], b[N];

ll dp(int n, int h) {
  if (h == 0) return 0;
  if (n == 0) return OO;
  ll &ret = memo[n][h];
  if (done[n][h]) return ret;
  done[n][h] = 1;
  return ret = min(b[n - 1] + dp(n, max(0LL, h - a[n - 1])), dp(n - 1, h));
}

int main() { // claudio van
  ios_base::sync_with_stdio(false); cin.tie(NULL);
  cin >> h >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i] >> b[i];
  }
  memset(done, 0, sizeof done);
  cout << knapsack(n, h) << "\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:11: error: 'knapsack' was not declared in this scope
   28 |   cout << knapsack(n, h) << "\n";
      |           ^~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <bitset>
#include <stack>
#include <queue>
#include <list>
#include <iomanip>
#include <numeric>

using namespace std;
typedef long long ll;
ll mod = 1000000007;
const int INF = 1001001001;

template<class Type>
Type modpow(Type a, Type n, Type mod)
{
	Type res = 1;
	while (0 < n) {
		if (n & 1) {
			res = res * a % mod;
		}
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

template<class Type>
Type gcd(Type x, Type y)
{
	Type r;
	if (x < y) swap(x, y);

	while (0 < y) {
		r = x % y;
		x = y;
		y = r;
	}
	return x;
}

template<class Type>
Type lcm(Type x, Type y)
{
	return x * y / gcd(x, y);
}

template<class Type>
bool is_prime(Type x)
{
	if (x == 2) return true;
	if (x < 2 || x % 2 == 0) return false;

	for (Type i = 3; i <= sqrt(x); i += 2) {
		if (x % i == 0) return false;
	}
	return true;
}

template<class Type>
vector<bool> eratos(Type n)
{
	vector<bool> isPrime(n + 1, true);
	isPrime[0] = isPrime[1] = false;
	for (Type i = 2; i <= n; i++) {
		if (isPrime[i]) {
			Type j = i + i;
			while (j <= n) {
				isPrime[j] = false;
				j = j + i;
			}
		}
	}
	return isPrime;
}

bool binary_search_judge(vector<int> a, int index, int key)
{
	if (key <= a[index]) return true;
	else return false;
}

int binary_search(vector<int> a, int key)
{
	int ng = -1;
	int ok = a.size();
	while (1 < abs(ng - ok)) {
		int mid = (ng + ok) / 2;
		if (binary_search_judge(a, mid, key)) ok = mid;
		else ng = mid;
	}
	return a[ok] == key;
}

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<vector<int>> mp(n, vector<int>(h + 1, INF));
	for (int i = 0; i < n; i++) mp[i][0] = 0;

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < h; j++) {
			int nj = min(j + a[i], h);
			if (0 < i) {
				mp[i][j] = min(mp[i][j], mp[i - 1][j]);
				mp[i][nj] = min(mp[i][nj], mp[i - 1][nj]);
			}
			if (mp[i][j] != INF) mp[i][nj] = min(mp[i][nj], mp[i][j] + b[i]);
	}
	cout << mp[n - 1][h] << endl;
}

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

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

int INF = 100000;

int main() {
	int h,n;
	cin >> h >> n;
	vector<int>dp(h + 1, INF);
	dp[0] = 0;
	rep(i, n) {
		int a, b;
		cin >> a >> b;
		rep(j, h) {
			int nj = min(j + a, h);
			dp[nj] = min(dp[nj], dp[j] + b);
		}
	}
	cout << dp[h] << endl;
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

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

int INF=100000

int main() {
	int h,n;
	cin >> h >> n;
	vector<int>dp(h + 1, INF);
	dp[0] = 0;
	rep(i, n) {
		int a, b;
		cin >> a >> b;
		rep(j, h) {
			int nj = min(j + a, h);
			dp[nj] = min(dp[nj], dp[j] + b);
		}
	}
	cout << dp[h] << endl;
	cout << ans << endl;
}


Compiler output:
a.cc:11:1: error: expected ',' or ';' before 'int'
   11 | int main() {
      | ^~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <bitset>
#include <stack>
#include <queue>
#include <list>
#include <iomanip>
#include <numeric>

using namespace std;
typedef long long ll;
const int INF = 1001001001;
ll mod = 1000000007;

template<class Type>
Type modpow(Type a, Type n, Type mod)
{
	Type res = 1;
	while (0 < n) {
		if (n & 1) {
			res = res * a % mod;
		}
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

template<class Type>
Type gcd(Type x, Type y)
{
	Type r;
	if (x < y) swap(x, y);

	while (0 < y) {
		r = x % y;
		x = y;
		y = r;
	}
	return x;
}

template<class Type>
Type lcm(Type x, Type y)
{
	return x * y / gcd(x, y);
}

template<class Type>
bool is_prime(Type x)
{
	if (x == 2) return true;
	if (x < 2 || x % 2 == 0) return false;

	for (Type i = 3; i <= sqrt(x); i += 2) {
		if (x % i == 0) return false;
	}
	return true;
}

template<class Type>
vector<bool> eratos(Type n)
{
	vector<bool> isPrime(n + 1, true);
	isPrime[0] = isPrime[1] = false;
	for (Type i = 2; i <= n; i++) {
		if (isPrime[i]) {
			Type j = i + i;
			while (j <= n) {
				isPrime[j] = false;
				j = j + i;
			}
		}
	}
	return isPrime;
}

bool binary_search_judge(vector<int> a, int index, int key)
{
	if (key <= a[index]) return true;
	else return false;
}

int binary_search(vector<int> a, int key)
{
	int ng = -1;
	int ok = a.size();
	while (1 < abs(ng - ok)) {
		int mid = (ng + ok) / 2;
		if (binary_search_judge(a, mid, key)) ok = mid;
		else ng = mid;
	}
	return a[ok] == key;
}



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<vector<int>> mp(n, vector<int>(h + 1, INT_MAX));
	for (int i = 0; i < n; i++) mp[i][0] = 0;

	for (int i = 0; i < n; i++) {
		for (int j = 0; j <= h; j++) {
			int nj = min(j + a[i], h);
			if (0 < i) mp[i][nj] = min(mp[i][nj], mp[i - 1][nj]);
			if (mp[i][j] != INT_MAX) mp[i][nj] = min(mp[i][nj], mp[i][j] + b[i]);
		}
	}
	cout << mp[n - 1][h] << endl;
}

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

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define N 100009
#define inf 9999999999
int arr[N];
int dp[N][N];
int a[N],b[N];

signed main(){
	int n,m;
	cin>>n>>m;
	for(int i=1;i<=m;i++) cin>>a[i]>>b[i];
	for(int i=1;i<N;i++) dp[0][i]=inf;	
	for(int i=1;i<N;i++){
		for(int j=1;j<N;j++){
			dp[i][j]=min(dp[i-1][j],dp[i][j-a[i]]+b[i]);
		}
	}
	cout<<dp[m][n];
	return 0;
}

Compiler output:
/tmp/cc4xXJzu.o: in function `main':
a.cc:(.text+0x49): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/cc4xXJzu.o
a.cc:(.text+0x74): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/cc4xXJzu.o
a.cc:(.text+0xf8): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/cc4xXJzu.o
a.cc:(.text+0x137): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/cc4xXJzu.o
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
using namespace std;
int main()
{
    int h,n;
    cin>>h>>n;
    int a[n], b[n], cp[n];
    for (int i=0; i<n; i++){
        cin>>a[i]>>b[i];
        cp[i]=a[i]/b[i];
    }
    max=0;
    for (int i=0; i<n; i++){
        if (cp[i]>cp[max]){max=i;}
    }
    aa=a[max];
    if(h%aa==0){cout<<h/aa;}
    else{cout<<h/aa+1;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: overloaded function with no contextual type information
   12 |     max=0;
      |         ^
a.cc:14:21: error: invalid types 'int [n][<unresolved overloaded function type>]' for array subscript
   14 |         if (cp[i]>cp[max]){max=i;}
      |                     ^
a.cc:14:32: error: overloaded function with no contextual type information
   14 |         if (cp[i]>cp[max]){max=i;}
      |                                ^
a.cc:16:5: error: 'aa' was not declared in this scope; did you mean 'a'?
   16 |     aa=a[max];
      |     ^~
      |     a
a.cc:16:9: error: invalid types 'int [n][<unresolved overloaded function type>]' for array subscript
   16 |     aa=a[max];
      |         ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

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

	vector<int> a(n), b(n);
	vector<long long> d(h + 1, LLONG_MAX);
	d[0] = 0;
	for (int i = 0; i < n; i++) {
		cin >> a[i] >> b[i];
	}

	for (int i = 0; i < n; i++) {
		if (a[i] >= h) {
			for (int j = 1; j <= h; j++) {
				if (d[j] > b[i]) {
					d[j] = b[i];
				}
			}
		}
		else {
			for (int j = 1; j <= a[i]; j++) {
				if (d[j] > b[i]) {
					d[j] = b[i];
				}
			}
			for (int j = a[i] + 1; j <= h; j++) {
				if (d[j] > d[j - a[i]] + b[i]) {
					d[j] = d[j - a[i]] + b[i];
				}
			}
		}
	}

	cout << d[h] << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:36: error: 'LLONG_MAX' was not declared in this scope
   12 |         vector<long long> d(h + 1, LLONG_MAX);
      |                                    ^~~~~~~~~
a.cc:3:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <vector>
  +++ |+#include <climits>
    3 |
Language: C++

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

int n, m;
int w[1010];
int v[1010];

int main(void)
{
	cin >> m >> n;
	long long dp[m];
	fill(dp, dp + 10000000, 1000000000);
	dp[0] = 0;
	int minn = 1000000, minx = 1000000;
	for (int i = 1; i <= n; i++) {
		cin >> w[i] >> v[i];
	}
	for (int i = 1; i <= n; i++) {
		for (int j = w[i]; j <= m + 10000; j++) {
			dp[j] = min(dp[j], dp[j - w[i]] + v[i]);
		}
	}
	int ans = 100000000;
	for(int i=m;i<=m+10000;i++) {
		ans = min(ans,dp[i]);
	}
	cout << ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:26: error: no matching function for call to 'min(int&, long long int&)'
   26 |                 ans = min(ans,dp[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:26:26: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   26 |                 ans = min(ans,dp[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:2:
/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:26:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   26 |                 ans = min(ans,dp[i]);
      |                       ~~~^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
struct _I { _I() {cin.tie(0);ios::sync_with_stdio(false);}} __I;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i < (n); i++)
template<class T> inline bool chmin(T& a, T b) {return a>b?a=b,true:false;}

#define INF 1000000000

int main()
{
    int H, N; cin >> H >> N;
    vi A(N), B(N);
    rep(i, N) cin >> A[i] >> B[i];

    vvi dp(N+1, vi(H+1, INF));
    dp[0][0] = 0;

    rep(i, N) {
        rep(j, H+1) {
            if (dp[i][j] != INF) {
                for (int k = 0; k <= (H-j+A[i]-1)/A[i]; k++) {
                    int dmg = min(H, j + A[i]*k);
                    dp[i+1][dmg] = min(dp[i+1][dmg], dp[i][j] + B[i]*k)
                }
            }
        }
    }

#if 0
rep(i, N+1) {
    rep(j,H+1) {
        if (dp[i][j]==INF) {
            cout << "_____" << " ";
        } else {
            cout << setw(5)<<dp[i][j] << " ";
        }
        
    }
    cout << endl;
}
#endif

    cout << dp[N][H] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:72: error: expected ';' before '}' token
   26 |                     dp[i+1][dmg] = min(dp[i+1][dmg], dp[i][j] + B[i]*k)
      |                                                                        ^
      |                                                                        ;
   27 |                 }
      |                 ~
Language: C++

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

const int INF = 1001001001;

int main(){
  int h,n;
  cin >>h >>n;
  vector<int> dp(h+1,INF);
  dp[0] = 0;
  rep(i,n){
   int a,b;
   cin >> a, b;
   rep(j,h){
     int nj = min(j+a,h);
     dp[nj] = min(dp[nj], dp[j]+b);
   }
  }
  cout << dp[h] << endl;
  return 0;
}

Compiler output:
a.cc:4:12: error: 'Long' does not name a type; did you mean 'long'?
    4 | using ll = Long Long;
      |            ^~~~
      |            long