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

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
/* 4 方向への隣接頂点への移動を表すベクトル */
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
int main() {
ll h,n;
cin>>h>>n;
ll a[n]={}, b[n]={};
rep(i,n) cin>>a[i]>>b[i];
ll ca=0;
dp[n+10][h+10]={};
rep(i,n){
rep(j,h){
dp[i+1][h]=min(dp[i+1][h],dp[i+1][h-a[i]]+b[i]);
}}
cout << dp[n][h] << endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'i' was not declared in this scope
   13 | rep(i,n) cin>>a[i]>>b[i];
      |     ^
a.cc:13:1: error: 'rep' was not declared in this scope
   13 | rep(i,n) cin>>a[i]>>b[i];
      | ^~~
a.cc:15:1: error: 'dp' was not declared in this scope; did you mean 'dy'?
   15 | dp[n+10][h+10]={};
      | ^~
      | dy
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const long long INF = 1LL<<60;
int main() {
  int H,N; cin>>H>>N;
  vector<int> A(N);
  vector<int> B(N);
  rep(i,N) cin>>A.at(i)>>B.at(i);
  vector<long long> dp(H+1, INF);
  DP[0]=0;
  for(int i=0;i<=H;i++){
    rep(j,N){
      DP[min(i+A.at(j),H)]=min(DP[min(i+A.at(j),H)],DP[i]+B.at(j));
    }
  }
  cout<<DP[H];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'DP' was not declared in this scope; did you mean 'dp'?
   11 |   DP[0]=0;
      |   ^~
      |   dp
Language: C

#include <iostream>
#include <vector>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL<<60;

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:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
using namespace std;

int Min(int h, int n, int dmg[], int cost[], int min){ 
	if(h<=0){
		return 0; // 0 more spell(s) needed to activate
	} 
	while (h>0){
		int temp = 0; // current number of mana used
		for (int i=0;i<n;i++){ 
			temp = cost[i] + Min(h-dmg[i], n, dmg, cost, min); // repeat the function when the damage is subtracted
			if (temp < min){ // checks after recursion if variable temp is smaller than minimum
				min = temp;
			}
		}
	}
	return min;
}
int three(){
	int monsterHealth, n; //health of monster and number of spells
	cin >> monsterHealth >> n;
	int damage[n]; //arrays of damaga and its cost
	int cost[n];
	int minimum = 999; // preset minimum value of mana cost
	for(int i=0;i<n;i++){
		cin >> damage[i];
		cin >> cost[i];
	}
	cout << Min(monsterHealth, n, damage, cost, minimum); // prints output of function Min()
}

Compiler output:
a.cc: In function 'int three()':
a.cc:30:1: warning: no return statement in function returning non-void [-Wreturn-type]
   30 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
using namespace std;

int Min(int h, int n, int dmg[], int cost[], int min){ 
	if(h<=0){
		return 0; // 0 more spell(s) needed to activate
	} 
	while (h>0){
		int temp = 0; // current number of mana used
		for (int i=0;i<n;i++){ 
			temp = cost[i] + Min(h-dmg[i], n, dmg, cost, min); // repeat the function when the damage is subtracted
			if (temp < min){ // checks after recursion if variable temp is smaller than minimum
				min = temp;
			}
		}
	}
	return min;
}
int three(){
	int monsterHealth, n; //health of monster and number of spells
	cin >> monsterHealth >> n;
	int damage[n]; //arrays of damaga and its cost
	int cost[n];
	int minimum = 999; // preset minimum value of mana cost
	for(int i=0;i<n;i++){
		cin >> damage[i];
		cin >> cost[i];
	}
	cout << Min(monsterHealth, n, damage, cost, minimum); // prints output of function Min()
	return 0;
}


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
using namespace std;

int Min(int h, int n, int dmg[], int cost[], int min){ 
	if(h<=0){
		return 0; // 0 more spell(s) needed to activate
	} 
	while (h>0){
		int temp = 0; // current number of mana used
		for (int i=0;i<n;i++){ 
			temp = cost[i] + Min(h-dmg[i], n, dmg, cost, min); // repeat the function when the damage is subtracted
			if (temp < min){ // checks after recursion if variable temp is smaller than minimum
				min = temp;
			}
		}
	}
	return min;
}
int three(){
	int monsterHealth, n; //health of monster and number of spells
	cin >> monsterHealth >> n;
	int damage[n]; //arrays of damaga and its cost
	int cost[n];
	int minimum = 999; // preset minimum value of mana cost
	for(int i=0;i<n;i++){
		cin >> damage[i];
		cin >> cost[i];
	}
	cout << Min(monsterHealth, n, damage, cost, minimum); // prints output of function Min()
}


Compiler output:
a.cc: In function 'int three()':
a.cc:30:1: warning: no return statement in function returning non-void [-Wreturn-type]
   30 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

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

int main(){
        int h,n,i,j;
        cin >> h >> n;
        vector<int> a(n+1);
        vector<int> b(n+1);
        vector<vector<int>> dp(n+1, vector<int>(h+1,10000001));
        for(i=1;i<n+1;++i) cin >> a.at(i) >> b.at(i);
        dp.at(0).at(0) = 0;
        for(i=1;i<n+1;++i){
                dp.at(i).at(0) = 0;
                for(j=0;j<h+1;++j){
                        if(j-a.at(i)>=0) dp.at(i).at(j) = min(dp.at(i-1).at(j), dp.at(i).at(j-a.at(i))+b.at(i));
                        else dp.at(i).at(j) = min(b.at(i),dp.at(i-1).at(j));
                }
        }
        cout << dp.at(n).at(h) << endl;
        return 0;
}

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

#define REP(i,n) for(int i=0;i<(n);++i)
#define COUT(x) cout<<(x)<<"\n"

int main(){
    int h,n;
    cin >> h >> n;
    vector<int> a(n),b(n);
    REP(i,n){
        cin >> a[i] >> b[i];
    }
    vector<int> dp(20010,INF);
    REP(i,n){
        dp[a[i]]=b[i];
    }
    for(int i=1;i<h+10010;i++){
        REP(j,n){
            dp[a[j]+i]=min(dp[i]+b[j],dp[a[j]+i]);
        }
    }
    int min1 = INF;
    for(int i=h;i<h+10010;i++){
        min1 = min(min1,dp[i]);
    }
    COUT(min1);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> h >> n;
      |     ^~~
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<int> a(n),b(n);
      |     ^~~~~~
a.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int> a(n),b(n);
      |            ^~~
a.cc:9:16: error: 'a' was not declared in this scope
    9 |         cin >> a[i] >> b[i];
      |                ^
a.cc:9:24: error: 'b' was not declared in this scope
    9 |         cin >> a[i] >> b[i];
      |                        ^
a.cc:11:12: error: expected primary-expression before 'int'
   11 |     vector<int> dp(20010,INF);
      |            ^~~
a.cc:13:9: error: 'dp' was not declared in this scope
   13 |         dp[a[i]]=b[i];
      |         ^~
a.cc:13:12: error: 'a' was not declared in this scope
   13 |         dp[a[i]]=b[i];
      |            ^
a.cc:13:18: error: 'b' was not declared in this scope
   13 |         dp[a[i]]=b[i];
      |                  ^
a.cc:17:13: error: 'dp' was not declared in this scope
   17 |             dp[a[j]+i]=min(dp[i]+b[j],dp[a[j]+i]);
      |             ^~
a.cc:17:16: error: 'a' was not declared in this scope
   17 |             dp[a[j]+i]=min(dp[i]+b[j],dp[a[j]+i]);
      |                ^
a.cc:17:34: error: 'b' was not declared in this scope
   17 |             dp[a[j]+i]=min(dp[i]+b[j],dp[a[j]+i]);
      |                                  ^
a.cc:17:24: error: 'min' was not declared in this scope; did you mean 'main'?
   17 |             dp[a[j]+i]=min(dp[i]+b[j],dp[a[j]+i]);
      |                        ^~~
      |                        main
a.cc:20:16: error: 'INF' was not declared in this scope
   20 |     int min1 = INF;
      |                ^~~
a.cc:22:25: error: 'dp' was not declared in this scope
   22 |         min1 = min(min1,dp[i]);
      |                         ^~
a.cc:22:16: error: 'min' was not declared in this scope; did you mean 'min1'?
   22 |         min1 = min(min1,dp[i]);
      |                ^~~
      |                min1
a.cc:2:17: error: 'cout' was not declared in this scope
    2 | #define COUT(x) cout<<(x)<<"\n"
      |                 ^~~~
a.cc:24:5: note: in expansion of macro 'COUT'
   24 |     COUT(min1);
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
using pint = pair<int, int>;
using pll = pair<ll,ll>;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define COUT(x) cout<<(x)<<"\n"

int main(){
    int h,n;
    cin >> h >> n;
    vector<int> a(n),b(n);
    REP(i,n){
        cin >> a[i] >> b[i];
    }
    vector<int> dp(20010,INF);
    REP(i,n){
        dp[a[i]]=b[i];
    }
    for(int i=1;i<=h;i++){
        REP(j,n){
            if(dp[i]==INF){
                continue;
            }
            else{
                dp[a[j]+i]=min(dp[i]+b[j],dp[a[j]+i]);
            }
        }
    }
    ll min1 = INF;
    for(int i=h;i<20005;i++){
        min1 = min(min1,dp[i]);
    }
    COUT(min1);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:19: error: no matching function for call to 'min(ll&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   38 |         min1 = min(min1,dp[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: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:38:19: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
   38 |         min1 = min(min1,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:
/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:38:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   38 |         min1 = min(min1,dp[i]);
      |                ~~~^~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
using pint = pair<int, int>;
using pll = pair<ll,ll>;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define COUT(x) cout<<(x)<<"\n"

int main(){
    int h,n;
    cin >> h >> n;
    vector<int> a(n),b(n);
    REP(i,n){
        cin >> a[i] >> b[i];
    }
    vector<ll> dp(20010,INF);
    REP(i,n){
        dp[a[i]]=b[i];
    }
    for(int i=1;i<=h;i++){
        REP(j,n){
            if(dp[i]==INF){
                continue;
            }
            else{
                dp[a[j]+i]=min(dp[i]+b[j],dp[a[j]+i]);
            }
        }
    }
    int min1 = INF;
    for(int i=h;i<20010;i++){
        min1 = min(min1,dp[i]);
    }
    COUT(min1);
    return 0;
}

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

h,n = [int(x) for x in input().split()]

# dp[i] = min magic points to decrease i health points
maxmax = 99999999
dp = [maxmax for x in range(h+1)]
dp[0] = 0
for x in range(n):
    a,b = [int(r) for r in input().split()]
    
    for j in range(h):
        dp[min(j+a, h)] = min(dp[min(j+a, h)], dp[j]+b)

print(dp[h])


Compiler output:
a.cc:3:3: error: invalid preprocessing directive #dp
    3 | # dp[i] = min magic points to decrease i health points
      |   ^~
a.cc:1:1: error: 'h' does not name a type
    1 | h,n = [int(x) for x in input().split()]
      | ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, z, n) for(int64_t i = z; i < n; i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
#define PI 3.14159265358979
//const int64_t INF = 1LL << 60;
const int INF = 1 << 29;
//const int64_t MOD = 1000000007;
//const int64_t INF = 998244353;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;
typedef pair<int64_t, int64_t> P;

int main() {
    int H, N;
    cin >> H >> N;
    vector<int> A(N), B(N);
    rep(i, 0, N) cin >> A[i] >> B[i];
    
    vector<vector<int>> dp(N+1, vector<int>(H+1, INF));
    dp[0][0] = 0;
    rep(i, 0 ,N){
        rep(j, 0, H + 1){
            chmin(dp[i+1][j], dp[i][j]);
            chmin(dp[i+1][min(j+A[i], H)], dp[i+1][j] + B[i]);
        }
    }
    cout << dp[N][H] << endl;
}


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

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

const int inf = 1e9;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int h, n;
	cin >> h >> n;
	pair<int, int> s[n];
	for (int i = 0; i < n; i++) cin >> s[i].first >> s[i].second;
	sort(s, s + n);
	
	map<int, int> dp;
	for (int i = 1 - s[n - 1].first; i < h; i++) dp[i] = inf;
	dp[h] = 0;
	for (int i = h; i; i--) {
		for (auto spell : s) {
			dp[i - spell.first] = min(dp[i - spell.first], dp[i] + spell.second);
		}
	}
	int ans = inf;
	for (int i = 0; i > 1 - s[n - 1].first; i--) {
		ans = min(ans, dp[i]);
	}
	cout << ans;
}

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

// #include <bits/stdc++.h>

// typedef long long int ll;
// using namespace std;

// int main()
// {

//     ll H, N;
//     cin >> H >> N;

//     ll inf = 999999999;

//     vector<ll> A(N), B(N);

//     vector<ll> dp(H + 1, inf);

//     for (int i = 0; i < N; i++)
//     {

//         cin >> A[i] >> B[i];
//     }

//     dp[0] = 0;

//     for (int i = 0; i < N; i++)
//     {

//         for (int j = 0; j <= H; j++)
//         {

//             int nj = min(j + A[i], H);
//             dp[nj] = min(dp[nj], dp[j] + B[i]);
//         }
//     }

// cout << dp[H] << endl;
// return 0;
// }

#include <bits/stdc++.h>

typedef long long int ll;
using namespace std;

int main()
{

    int H, N;
    cin >> H >> N;

    int inf = 999999999;

    vector<int> A(N), B(N);

    vector<vector<int>> dp(H + 1, vector<int>(N + 1, inf));

    for (int i = 0; i < N; i++)
    {

        cin >> A[i] >> B[i];
    }

    for (int i = 0; i = < N; i++)
    {

        dp[0][i] = 0;
    }

    for (int j = 0; j = < A[0]; j++)
    {

        dp[j][1] = B[0];
    }

    for (int i = 0; i < N; i++)
    {

        for (int j = 0; j <= H; j++)
        {

            if (j >= A[i])
            {
                dp[j][i + 1] = min(dp[j][i], dp[j - A[i]][i + 1] + B[i]);
            }
            else{

                dp[j][i+1] = min(dp[j][i],dp[0][i+1] + B[i]);
            }
        }
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:64:25: error: expected primary-expression before '<' token
   64 |     for (int i = 0; i = < N; i++)
      |                         ^
a.cc:70:25: error: expected primary-expression before '<' token
   70 |     for (int j = 0; j = < A[0]; j++)
      |                         ^
Language: C++

#include <bits/stdc++.h>

typedef long long int ll;
using namespace std;

int main()
{

    ll H, N;
    cin >> H >> N;

    ll inf = 999999999;

    vector<ll> A(N), B(N);

    vector<ll> dp(H + 1, inf);

    for (int i = 0; i < N; i++)
    {

        cin >> A[i] >> B[i];
    }

    dp[0] = 0;

    for (int i = 0; i < N; i++)
    {

        for (int j = 0; j <= H; j++)
        {

            int nj = min(j + A[i], h);
            dp[nj] = min(dp[nj], dp[j] + B[i]);
        }
    }

cout << dp[H] << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:36: error: 'h' was not declared in this scope
   32 |             int nj = min(j + A[i], h);
      |                                    ^
Language: C++

#include <bits/stdc++.h>

typedef long long int ll;
using namespace std;

int main()
{

    ll H, N;
    cin >> H >> N;

    ll inf = 999999999;

    vector<ll> A(N), B(N);

    vector<ll> dp(H + 1, inf);

    for (int i = 0; i < N; i++)
    {

        cin >> A[i] >> B[i];
    }

    dp[0] = 0;

    for (int i = 0; i < N; i++)
    {

        for (int j = 0; j <= H; j++)
        {

            int nj = min(j + A[i], h);
            dp[nj] = min(dp[nj], dp[j] + B[i]);
        }
    }
}

cout << dp[H] << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:36: error: 'h' was not declared in this scope
   32 |             int nj = min(j + A[i], h);
      |                                    ^
a.cc: At global scope:
a.cc:38:1: error: 'cout' does not name a type
   38 | cout << dp[H] << endl;
      | ^~~~
a.cc:39:1: error: expected unqualified-id before 'return'
   39 | return 0;
      | ^~~~~~
a.cc:40:1: error: expected declaration before '}' token
   40 | }
      | ^
Language: C++

#include<algorithm>
#include<cmath>
#include<cstdio>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<string>
#include<utility>
#include<vector>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll MOD = 1000000007;
#define rep(i,n) for(int i=0;i<n;i++)
#define repl(i,s,e) for(int i=s;i<e;i++)
#define reple(i,s,e) for(int i=s;i<=e;i++)
#define revrep(i,n) for(int i=n-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int main()
{
	int H, N;
	cin >> H >> N;

	vector<int> A(N), B(N);
	rep(i, N) cin >> A[i] >> B[i];

	//dp[i] := 体力をi以下にするために必要な魔力の最小値
	vector<ll> dp(H + 1, LLONG_MAX);
	dp[0] = 0;

	reple(i, 1, H)
	{
		rep(j, N)
		{
			int h = max(i - A[j], 0);

			dp[i] = min(dp[i], dp[h] + B[j]);
		}
	}

	cout << dp[H] << endl;

	return 0;
}	

Compiler output:
a.cc: In function 'int main()':
a.cc:37:30: error: 'LLONG_MAX' was not declared in this scope
   37 |         vector<ll> dp(H + 1, LLONG_MAX);
      |                              ^~~~~~~~~
a.cc:13:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   12 | #include<utility>
  +++ |+#include <climits>
   13 | #include<vector>
Language: C++

#include <vector>
#include <iostream>

using namespace std;

struct magic{
    int a, b;
};

int main(){
    int h, n;
    const int h_max = 1e9;
    cin >> h >> n;

    vector<magic> v(n);
    for(auto& vi : v) cin >> vi.a >> vi.b;
    vector<int> mpv(h+1, h_max);
    mpv.at(0) = 0;
    for(const auto& vi : v){
        for(int j=vi.a; j < h; j++) mpv.at(j) = min(mpv.at(j-vi.a)+vi.b , mpv.at(j));
        //for(int j=0; j<vi.a; j++) mpv.at(h) = min(mpv.at(h-vi.a+j)+vi.b, mpv.at(h)); // ここにバグが入るのんだろう。
        for(int j=max(h-vi.a, 0); j<h; j++) mpv.at(h) = min(mpv.at(j)+vi.b, mpv.at(h));
    }

    cout << mpv.at(h) << endl;
    return 0;

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

import java.util.*;
import java.math.*;
     
class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){
 
            int h = Integer.parseInt(sc.next());
            int n = Integer.parseInt(sc.next());

            Map<Integer, Integer> atkMp = new TreeMap<>();

            double goodMagic = 0;
            int goodMagicAtk = 0;
            int goodMagicMp = 0;

            for(int i = 0; i < n; i++){
                int atkNum = Integer.parseInt(sc.next());
                int mpNum = Integer.parseInt(sc.next());
                double judgeMagic = atkNum/mpNum;

                if(goodmagic < judgeMagic){
                    goodMagic = judgeMagic;
                    goodMagicAtk = atkNum;
                    goodMagicMp = mpNum;
                }

                if(atkMp.get(atkNum) == null) atkMp.put(atkNum, mpNum);
                else{
                    if(atkMp.get(atkNum) > mpNum) atkMp.put(atkNum, mpNum);
                }
            }

            int ans = 0;
            int mod = h % goodMagicAtk;
            if(mod == 0){
                ans = (h/goodMagicAtk)*goodMagicMp;
            }else{
                ans = ((h - mod)/goodMagicAtk)*goodMagicMp;
                if(atkMp.get(mod) != null){
                    if(atkMp.get(mod) < goodMagicMp) ans += goodMagicMp;
                    else ans += goodMagicMp;
                }else{

                }
            }

            System.out.println(ans);
 
        }catch(Exception e){
            e.printStackTrace();
        }        
    }
}

Compiler output:
Main.java:23: error: cannot find symbol
                if(goodmagic < judgeMagic){
                   ^
  symbol:   variable goodmagic
  location: class Main
1 error
Language: Java

import java.util.*;
import java.math.*;
     
class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){
 
            int h = Integer.parseInt(sc.next());
            int n = Integer.parseInt(sc.next());

            Map<Integer, Integer> atkMp = new TreeMap<>();

            double goodMagic = 0;
            int goodMagicAtk = 0;
            int goodMagicMp = 0;

            for(int i = 0; i < n; i++){
                int atkNum = Integer.parseInt(sc.next());
                int mpNum = Integer.parseInt(sc.next());
                double judgeMagic = atkNum/mpNum;

                if(goodmagic < judgeMagic){
                    goodMagic = judgeMagic;
                    goodMagicAtk = atkNum;
                    goodMagicMp = mpNum;
                }

                if(atkMp.get(atkNum) == null) atkMp.put(atkNum, mpNum);
                else{
                    if(atkMp.get(atkNum) > mpNum) atkMp.put(atkNum, mpNum);
                }
            }

            int ans = 0;
            int mod = h % goodMagicAtk;
            if(mod == 0){
                ans = (h/goodMagicAtk)*goodMagicMp;
            }else{
                ans = ((h - mod)/goodMagicAtk)*goodMagicMp;
                if(atkMp.get(mod) != null){
                    if(atkMp.get(mod) < goodMagicMp) ans += mpNum;
                    else ans += goodMagicMp;
                }else{

                }
            }

            System.out.println(ans);
 
        }catch(Exception e){
            e.printStackTrace();
        }        
    }
}

Compiler output:
Main.java:23: error: cannot find symbol
                if(goodmagic < judgeMagic){
                   ^
  symbol:   variable goodmagic
  location: class Main
Main.java:42: error: cannot find symbol
                    if(atkMp.get(mod) < goodMagicMp) ans += mpNum;
                                                            ^
  symbol:   variable mpNum
  location: class Main
2 errors
Language: Java

import java.util.*;
import java.math.*;
     
class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){
 
            int h = Integer.parseInt(sc.next());
            int n = Integer.parseInt(sc.next());

            Map<Integer, Integer> atkMp = new TreeMap<>();

            double goodMagic = 0;
            int goodMagicAtk = 0;
            int goodMagicMp = 0;

            for(int i = 0; i < n; i++){
                int atkNum = Integer.parseInt(sc.next());
                int mpNum = Integer.parseInt(sc.next());
                double judgeMagic = atkNum/mpNum;

                if(goodmagic < judgeMagic){
                    goodMagic = judgeMagic;
                    goodMagicAtk = atkNum;
                    goodMagicMp = mpNum;
                }

                if(atkMp.get(atkNum) == null) atkMp.set(atkNum, mpNum);
                else{
                    if(atkMp.get(atkNum) > mpNum) atkMp.set(atkNum, mpNum);
                }
            }

            int ans = 0;
            int mod = h % goodMagicAtk;
            if(mod == 0){
                ans = (h/goodMagicAtk)*goodMagicMp;
            }else{
                ans = ((h - mod)/goodMagicAtk)*goodMagicMp;
                if(atkMp.get(mod) != null){
                    if(atkMp.get(mod) < goodMagicMp) ans += mpNum;
                    else ans += goodMagicMp;
                }else{
                    
                }
            }

            System.out.println(sb.toString());
 
        }catch(Exception e){
            e.printStackTrace();
        }        
    }
}

Compiler output:
Main.java:23: error: cannot find symbol
                if(goodmagic < judgeMagic){
                   ^
  symbol:   variable goodmagic
  location: class Main
Main.java:29: error: cannot find symbol
                if(atkMp.get(atkNum) == null) atkMp.set(atkNum, mpNum);
                                                   ^
  symbol:   method set(int,int)
  location: variable atkMp of type Map<Integer,Integer>
Main.java:31: error: cannot find symbol
                    if(atkMp.get(atkNum) > mpNum) atkMp.set(atkNum, mpNum);
                                                       ^
  symbol:   method set(int,int)
  location: variable atkMp of type Map<Integer,Integer>
Main.java:42: error: cannot find symbol
                    if(atkMp.get(mod) < goodMagicMp) ans += mpNum;
                                                            ^
  symbol:   variable mpNum
  location: class Main
Main.java:49: error: cannot find symbol
            System.out.println(sb.toString());
                               ^
  symbol:   variable sb
  location: class Main
5 errors
Language: C++

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using bint = boost::multiprecision::cpp_int;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repSE(i,s,n) for (int i = (s); i < (n); i++)
#define ssort(v) sort(v.begin(), v.end())
#define gsort(v) sort(v.rbegin(), v.rend())
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const deque<T> &vec){ os << "deq["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const unordered_map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool chmin(T &m, const T q) { if (q < m) {m = q; return true;} else return false; }

const int INF = 100010001;

int main()
{
    int H, N;
    cin >> H >> N;
    vector<int> A(N), B(N);
    rep(i,N) cin >> A[i] >> B[i];
    int maxA = 0;
    rep(i,N) chmax (maxA, A[i]);
    int maxH = H+maxA+1;
    vector<int> dp(maxH, INF);
    dp[0] = 0;
    repSE(i,1,maxH) {
        rep(j,N) chmin(dp[i], dp[max(0,i-A[j])] + B[j]);
    }
    int ans = INF;
    repSE(i,H,maxH) chmin(ans, dp[i]);
    cout << ans << "\n";
    return 0;
}


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

#include <iostream>
#include <vector>

using namespace std;

typedef long long ll

int main(){
  ll H, N, a, b;
  cin >> H >> N;
  vector<vector<ll>> dp;
  vector<pair<ll, ll>> M;
  for (ll i=0; i<N; i++){
    dp.emplace_back(vector<ll>(H+1, 1e9));
    cin >> a >> b;
    M.emplace_back(pair<ll, ll>(a, b));
  }
  for (ll i=0; i<N; i++){
    for (ll j=H; j>=0; j--){
      if (j == H) dp[i][j] = 0;
      else if (j != 0){
        if (i > 0) {
          dp[i][j] = min(dp[i-1][j], dp[i][j]);
        }
        if (j <= H - M[i].first){
          dp[i][j] = min(dp[i][j], dp[i][j+M[i].first] + M[i].second);

        }
      }
      else{
        ll tmp = 1e9;
        for (ll k=M[i].first; k>0; k--){
          tmp = min(tmp, dp[i][k]);
        }
        dp[i][0] = (i > 0 ? min(dp[i-1][0], tmp + M[i].second) : tmp + M[i].second);
      }
    }
  }

  cout << dp[N-1][0] << "\n";
  return 0;
}


Compiler output:
a.cc:8:1: error: expected initializer before 'int'
    8 | int main(){
      | ^~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(){
	int h,n;
	int a[1000],b[1000];
	cin>>h>>n;
	int ans=1e9+7;
	vector<pair<int,int> > mahou;
	for(int i=0;i<n;i++){
		cin>>a[i]>>b[i];
		mahou.push_back(make_pair(a[i],b[i]));
	}
	sort(mahou.begin(),mahou.end());
	for(int i=0;i<n;i++){
		ans=min(ans,(h+a[i]-1)/a[i]*b[i]);
		for(int j=0;j<n;j++){
			if(mahou[j].first>=h%a[i]){
				ans=min(ans,h/a[i]*b[i]+mahou[j].second);
				break;
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}

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

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <limits>
#include <numeric>
#include <type_traits>

using namespace std;
using ll = long long int;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;

int main(){
    int H,N;
    cin>>H>>N;
    vector<int> A(N),B(N);
    ll max_value=0;
    for(int i=0;i<N;i++){
        cin>>A[i]>>B[i];
        if(A[i]>max_value) max_value=A[i];
    }
    
    vll dp(H+max_value,-1);
    
    dp[0]=0;
    
    for(int i=0;i<dp.size();i++){
        if(dp[i]==-1) continue;
        for(int j=0;j<N;j++){
            if(i+A[j]<dp.size()){
                if(dp[i+A[j]]==-1) dp[i+A[j]]=dp[i]+B[j];
                else dp[i+A[j]]=min(dp[i+A[j]],dp[i]+B[j]);
            }
        }
    }
    
    //for(int i=0;i<dp.size();i++) printf("%d|",dp[i]);
    //printf("\n");
    
    ll min_value=INT_MAX;
    for(int i=H;i<H+max_value;i++){
        if(dp[i]<min_value && dp[i]!=-1){
            min_value=dp[i];
        }
    }
    
    cout<<min_value<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:18: error: 'INT_MAX' was not declared in this scope
   43 |     ll min_value=INT_MAX;
      |                  ^~~~~~~
a.cc:8:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    7 | #include <numeric>
  +++ |+#include <climits>
    8 | #include <type_traits>
Language: C++

using namespace std;
int h,n,a,b,dp[10001];
int main()
{
	memset(dp,0x3f,sizeof(dp));
	dp[0]=0;
	scanf("%d%d",&h,&n);
	while(n--)
	{
		scanf("%d%d",&a,&b);
		for(int i=1;i<=h;i++)dp[i]=min(dp[max(i-a,0)]+b,dp[i]);
	}
	printf("%d",dp[h]);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'memset' was not declared in this scope
    5 |         memset(dp,0x3f,sizeof(dp));
      |         ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | using namespace std;
a.cc:7:9: error: 'scanf' was not declared in this scope
    7 |         scanf("%d%d",&h,&n);
      |         ^~~~~
a.cc:11:51: error: 'max' was not declared in this scope
   11 |                 for(int i=1;i<=h;i++)dp[i]=min(dp[max(i-a,0)]+b,dp[i]);
      |                                                   ^~~
a.cc:11:44: error: 'min' was not declared in this scope; did you mean 'main'?
   11 |                 for(int i=1;i<=h;i++)dp[i]=min(dp[max(i-a,0)]+b,dp[i]);
      |                                            ^~~
      |                                            main
a.cc:13:9: error: 'printf' was not declared in this scope
   13 |         printf("%d",dp[h]);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | using namespace std;
Language: C++

h, n = map(int, input().split())
a = []
b = []
for i in range(n):
    a_, b_ = map(int, input().split())
    a.append(a_)
    b.append(b_)
 
dp = [10**9] * (h+1)
dp[0] = 0
 
for i in range(1, h+1):
    for j in range(n):
        dp[i] = min(dp[i], dp[max(i-a[j], 0)] + b[j])
 
print(dp[-1])

Compiler output:
a.cc:1:1: error: 'h' does not name a type
    1 | h, n = map(int, input().split())
      | ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL<<60;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:34: error: no match for call to '(std::vector<int>) (int&)'
   11 |   for(int i=0; i<N; i++) cin >> A(i) >> B(i);
      |                                 ~^~~
a.cc:11:42: error: no match for call to '(std::vector<int>) (int&)'
   11 |   for(int i=0; i<N; i++) cin >> A(i) >> B(i);
      |                                         ~^~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL<<60;
 
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<long long>> dp(N+1, vector<long long>(H+1, INF));
  dp[0][0] = 0;
  for(int i=0; i<N; i++){
    for(int j=0; j<N; j++){
      chmin(dp[i+1][j], dp[i][j]);
      chmin(dp[i+1][min(j+A[i])], dp[i+1][j] + B[i]);
    }
  }
  cout << dp[N][H] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:24: error: no matching function for call to 'min(int)'
   17 |       chmin(dp[i+1][min(j+A[i])], dp[i+1][j] + B[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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 1000000007
#define all(ppp) ppp.begin(),ppp.end()
#define out(ppp) cout<<(ppp)<<endl
#define out1(ppp) cout<<(ppp) 

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define pb push_back

typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<pll> vpll;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
typedef vector<vpi> vvpi;

typedef set<pi> spi;

const int INF=INT_MAX;

ll solve(ll n){
    if(n==1){
        return 1;
    }else if(n<1){
        return 0;
    }
    return 1+2*solve(n/2);
}



int main(){
    ll H,N;
    cin>>H>>N;
    vpll AB(N);
    F0R(i,N){
        cin>>AB[i].first>>AB[i].second;
    }
    sort(all(AB));
    vvll dp(N+1,vll(H+1,0));
    for(int j=1;j<=H;j++){
        if(j<=AB[0].first){
            dp[1][j]=AB[0].second;
        }else{
            dp[1][j]=dp[1][j-AB[0].first]+AB[0].second;
        }
    }

    for(int i=1;i<N;i++){
        for(int j=1;j<=H;j++){
            if(j<=AB[i].first){
                dp[i+1][j]=min(AB[i].second,dp[i][j]);
            }else{
                dp[i+1][j]=min(dp[i+1][j-AB[i].first]+AB[i].second,dp[i][j]);
            }
        }
    }

    out(dp[N][H]);
    return 0;
}


Compiler output:
a.cc:30:16: error: 'pl' was not declared in this scope; did you mean 'pll'?
   30 | typedef vector<pl> vpl;
      |                ^~
      |                pll
a.cc:30:18: error: template argument 1 is invalid
   30 | typedef vector<pl> vpl;
      |                  ^
a.cc:30:18: error: template argument 2 is invalid
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> P;
#define rep(i,a,b) for(int i=a ; i<b ; i++)
const int max_n = 1e5;
const ll mod = 1e9+7;
const ll INF = 1LL<<60;
typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: expression list treated as compound expression in initializer [-fpermissive]
   26 |   ll dp(h+1, INF);
      |                 ^
a.cc:27:5: error: invalid types 'll {aka long long int}[int]' for array subscript
   27 |   dp[0] = 0;
      |     ^
a.cc:30:15: error: invalid types 'll {aka long long int}[const int]' for array subscript
   30 |       chmin(dp[min(h,j+a[i])], dp[j]+b[i]);
      |               ^
a.cc:30:34: error: invalid types 'll {aka long long int}[int]' for array subscript
   30 |       chmin(dp[min(h,j+a[i])], dp[j]+b[i]);
      |                                  ^
a.cc:33:13: error: invalid types 'll {aka long long int}[int]' for array subscript
   33 |   cout << dp[h] << endl;
      |             ^
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=0; i<h+1; i++) dp[i] = Integer.MAX_VALUE;

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


//        for (int i=0; i<h+1; i++) out.print(dp[i]+" ");



        out.println(dp[h-1]);
        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