Language: C++

#pragma GCC optimize(2)
#include <bits/stdc++.h>

using namespace std;

struct move
{
	int hurt, cost;
};

int h, n, ans;
move minm, maxm;
move moves[100005];
int dp[200005];

int main()
{	
	cin>>h>>n;
	minm.hurt = 0x3f;
	for(int i = 0; i < n; i ++)
	{
		cin>>moves[i].hurt>>moves[i].cost;
		if(moves[i].hurt < minm.hurt) 
			minm.hurt = moves[i].hurt, minm.cost = moves[i].cost;
		if(moves[i].hurt > maxm.hurt) 
			maxm.hurt = moves[i].hurt, maxm.cost = moves[i].cost;
	}
	memset(dp, 0x3f, sizeof(dp));
	//dp[minm.hurt] = minm.cost;
	dp[0] = 0;
	for(int i = 0; i <= h + maxm.hurt; i ++)
	{
		if(dp[i] >= dp[200004]) continue;
		//cout<<i<<' '<<dp[i]<<endl;
		for(int j = 0; j < n; j ++)
		{
			if(moves[j].hurt + i > h + maxm.hurt) 
				continue;
			dp[moves[j].hurt + i] = min(dp[moves[j].hurt + i], dp[i] + moves[j].cost);
		}
	}
	for(int i = h; i <= h + maxm.hurt; i ++)
		if(i == h || dp[i] < ans) ans = dp[i];
	cout<<ans;
	return 0;
}

Compiler output:
a.cc:12:1: error: reference to 'move' is ambiguous
   12 | move minm, maxm;
      | ^~~~
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:353:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::move(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2)'
  353 | move(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __d_first);
      | ^~~~
In file included from /usr/include/c++/14/algorithm:60:
/usr/include/c++/14/bits/stl_algobase.h:675:5: note:                 'template<class _II, class _OI> _OI std::move(_II, _II, _OI)'
  675 |     move(_II __first, _II __last, _OI __result)
      |     ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:61,
                 from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/bits/move.h:137:5: note:                 'template<class _Tp> constexpr typename std::remove_reference<_Tp>::type&& std::move(_Tp&&)'
  137 |     move(_Tp&& __t) noexcept
      |     ^~~~
a.cc:6:8: note:                 'struct move'
    6 | struct move
      |        ^~~~
a.cc:13:1: error: reference to 'move' is ambiguous
   13 | move moves[100005];
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:353:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::move(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2)'
  353 | move(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __d_first);
      | ^~~~
/usr/include/c++/14/bits/stl_algobase.h:675:5: note:                 'template<class _II, class _OI> _OI std::move(_II, _II, _OI)'
  675 |     move(_II __first, _II __last, _OI __result)
      |     ^~~~
/usr/include/c++/14/bits/move.h:137:5: note:                 'template<class _Tp> constexpr typename std::remove_reference<_Tp>::type&& std::move(_Tp&&)'
  137 |     move(_Tp&& __t) noexcept
      |     ^~~~
a.cc:6:8: note:                 'struct move'
    6 | struct move
      |        ^~~~
a.cc: In function 'int main()':
a.cc:19:9: error: 'minm' was not declared in this scope
   19 |         minm.hurt = 0x3f;
      |         ^~~~
a.cc:22:22: error: 'moves' was not declared in this scope; did you mean 'move'?
   22 |                 cin>>moves[i].hurt>>moves[i].cost;
      |                      ^~~~~
      |                      move
a.cc:25:36: error: 'maxm' was not declared in this scope
   25 |                 if(moves[i].hurt > maxm.hurt)
      |                                    ^~~~
a.cc:31:33: error: 'maxm' was not declared in this scope
   31 |         for(int i = 0; i <= h + maxm.hurt; i ++)
      |                                 ^~~~
a.cc:37:28: error: 'moves' was not declared in this scope; did you mean 'move'?
   37 |                         if(moves[j].hurt + i > h + maxm.hurt)
      |                            ^~~~~
      |                            move
a.cc:39:28: error: 'moves' was not declared in this scope; did you mean 'move'?
   39 |                         dp[moves[j].hurt + i] = min(dp[moves[j].hurt + i], dp[i] + moves[j].cost);
      |                            ^~~~~
      |                            move
a.cc:42:33: error: 'maxm' was not declared in this scope
   42 |         for(int i = h; i <= h + maxm.hurt; i ++)
      |                                 ^~~~