Language: C++

//Problem 1102F DP+Bitmasking
#include<bits/stdc++.h>

#define hell                         1000000007
#define __lcm(a,b)                   (a*b)/__gcd(a,b)
#define ll                           long long
#define vll                          vector<ll>
#define pll                          vector< pair<ll,ll> >
#define pb                           push_back
#define mp                           make_pair
#define all(v)                       v.begin(),v.end()
#define bs                           binary_search
#define F                            first
#define S                            second
#define rep(i,a,b)                   for(ll i=a;i<b;i++)
#define pcont(a)                     for(auto i:a) cout<<i<<" ";cout<<endl;
#define ret(x)                       return cout<<x,0;
#define dbg(x)                       cerr << #x << " is " << x << endl;
#define endl                           '\n'

#define MAX 100005
using namespace std;

ll h,n;
ll a[1001],b[1001];
ll dp[10001];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    
    cin >> h >> n;
    rep(i,0,n) cin >> a[i] >> b[i];
    
    dp[0]=0;
    rep(hh,1,h+1) {
    	dp[hh]=1e15;
    	rep(i,0,n) {
    		if(hh>=a[i]) dp[hh]=min(dp[hh],b[i]+dp[hh-a[i]]);
    		else dp[hh]=min(dp[hh],b[i]);
    	}
    }
    cout << dp[h] << endl;
}//Problem 1102F DP+Bitmasking
#include<bits/stdc++.h>

#define hell                         1000000007
#define __lcm(a,b)                   (a*b)/__gcd(a,b)
#define ll                           long long
#define vll                          vector<ll>
#define pll                          vector< pair<ll,ll> >
#define pb                           push_back
#define mp                           make_pair
#define all(v)                       v.begin(),v.end()
#define bs                           binary_search
#define F                            first
#define S                            second
#define rep(i,a,b)                   for(ll i=a;i<b;i++)
#define pcont(a)                     for(auto i:a) cout<<i<<" ";cout<<endl;
#define ret(x)                       return cout<<x,0;
#define dbg(x)                       cerr << #x << " is " << x << endl;
#define endl                           '\n'

#define MAX 100005
using namespace std;

ll h,n;
ll a[1001],b[1001];
ll dp[10001];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    
    cin >> h >> n;
    rep(i,0,n) cin >> a[i] >> b[i];
    
    dp[0]=0;
    rep(hh,1,h+1) {
    	dp[hh]=1e15;
    	rep(i,0,n) {
    		if(hh>=a[i]) dp[hh]=min(dp[hh],b[i]+dp[hh-a[i]]);
    		else dp[hh]=min(dp[hh],b[i]);
    	}
    }
    cout << dp[h] << endl;
}

Compiler output:
a.cc:68:4: error: redefinition of 'long long int h'
   68 | ll h,n;
      |    ^
a.cc:24:4: note: 'long long int h' previously declared here
   24 | ll h,n;
      |    ^
a.cc:68:6: error: redefinition of 'long long int n'
   68 | ll h,n;
      |      ^
a.cc:24:6: note: 'long long int n' previously declared here
   24 | ll h,n;
      |      ^
a.cc:69:4: error: redefinition of 'long long int a [1001]'
   69 | ll a[1001],b[1001];
      |    ^
a.cc:25:4: note: 'long long int a [1001]' previously declared here
   25 | ll a[1001],b[1001];
      |    ^
a.cc:69:12: error: redefinition of 'long long int b [1001]'
   69 | ll a[1001],b[1001];
      |            ^
a.cc:25:12: note: 'long long int b [1001]' previously declared here
   25 | ll a[1001],b[1001];
      |            ^
a.cc:70:4: error: redefinition of 'long long int dp [10001]'
   70 | ll dp[10001];
      |    ^~
a.cc:26:4: note: 'long long int dp [10001]' previously declared here
   26 | ll dp[10001];
      |    ^~
a.cc:72:5: error: redefinition of 'int main()'
   72 | int main()
      |     ^~~~
a.cc:28:5: note: 'int main()' previously defined here
   28 | int main()
      |     ^~~~