Language: C++

#include <bits/stdc++.h>
using namespace std;
int d,g,min;
int p[d];
int c[d];
int nums[d];
int min = 999999999;
int search(int now){
  	int i,rigid=0;
	if (now==d-1){
      	int score = 0;
    	for(i = 0;i<d;i++){
        	score += nums[i]*i*100;
          	rigid += min[i];
          	if (nums[i] == p[i]){
            	score += c[i];
            }
          	if (score>=g){
            	if (min>=rigid){
                	min = rigid;
                }
            }
        }
    }else{
    	for(i=0;i<=p[now];i++){
          	nums[now] = i;
        	search(now + 1);
        }
    }
}
int main(void){
	int i;
  	cin >> d >> g;
  	for (i = 1;i<=d;i++){
    	cin >> p[i] >> c[i];
    }
  	search(0);
  	cout <<min;
  	return 0;
  	
}

Compiler output:
a.cc:4:7: error: size of array 'p' is not an integral constant-expression
    4 | int p[d];
      |       ^
a.cc:5:7: error: size of array 'c' is not an integral constant-expression
    5 | int c[d];
      |       ^
a.cc:6:10: error: size of array 'nums' is not an integral constant-expression
    6 | int nums[d];
      |          ^
a.cc:7:5: error: redefinition of 'int min'
    7 | int min = 999999999;
      |     ^~~
a.cc:3:9: note: 'int min' previously declared here
    3 | int d,g,min;
      |         ^~~
a.cc: In function 'int search(int)':
a.cc:14:26: error: reference to 'min' is ambiguous
   14 |                 rigid += min[i];
      |                          ^~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: '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:5686:5: note:                 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
In file included from /usr/include/c++/14/algorithm:60:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:                 '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:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:3:9: note:                 'int min'
    3 | int d,g,min;
      |         ^~~
a.cc:19:21: error: reference to 'min' is ambiguous
   19 |                 if (min>=rigid){
      |                     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: '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:5686:5: note:                 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:                 '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:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:3:9: note:                 'int min'
    3 | int d,g,min;
      |         ^~~
a.cc:20:25: error: reference to 'min' is ambiguous
   20 |                         min = rigid;
      |                         ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: '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:5686:5: note:                 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:                 '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:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:3:9: note:                 'int min'
    3 | int d,g,min;
      |         ^~~
a.cc:30:1: warning: no return statement in function returning non-void [-Wreturn-type]
   30 | }
      | ^
a.cc: In function 'int main()':
a.cc:38:16: error: reference to 'min' is ambiguous
   38 |         cout <<min;
      |                ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: '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:5686:5: note:                 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:                 '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:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:3:9: note:                 'int min'
    3 | int d,g,min;
      |         ^~~