Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int D,G;
int p[10],c[10];
int ans=100000;
int a[11];
int main(){
	cin >> D >> G;
	for(int i=1;i<=D;i++)cin >> p[i] >> c[i];
	for(int i=0;i<1<<D;i++){
		//printf("%d\n",i);
		long long int sum=0,temp=0;
		int x=i;
		int cnt=1;
		while(x>0){
			if(x&1 == 1){a[cnt]=1;}
			cnt++;
			x>>=1;
		}

		for(int z=1;z<=D;z++){
			if(a[z]==1){
				sum+=100*z*p[z]+c[z];
				temp+=p[z];
			}
		}
		//printf("%d %d\n",sum,temp);
		if(sum>=G){
			ans=min(ans,temp);
			for(int z=1;z<=D;z++)a[z]=0;
		}
		else{
			for(int z=1;z<=D;z++){
				if(a[z]==0){
					int d=(G-sum);
					if(d>100*z*p[z]+c[z])continue;
					else {
						if(d%(100*z)==0)ans=min(ans,temp+d/(100*z));
						else ans=min(ans,temp+d/(100*z)+1);
					}
				}
			}
			for(int z=1;z<=D;z++)a[z]=0;
				//printf("%d %d\n",sum,ans);
		}
	}
	printf("%d\n",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:32: error: no matching function for call to 'min(int&, long long int&)'
   32 |                         ans=min(ans,temp);
      |                             ~~~^~~~~~~~~~
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:32:32: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   32 |                         ans=min(ans,temp);
      |                             ~~~^~~~~~~~~~
/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:4:
/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:32:32: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   32 |                         ans=min(ans,temp);
      |                             ~~~^~~~~~~~~~
a.cc:41:72: error: no matching function for call to 'min(int&, long long int)'
   41 |                                                 if(d%(100*z)==0)ans=min(ans,temp+d/(100*z));
      |                                                                     ~~~^~~~~~~~~~~~~~~~~~~~
/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:41:72: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   41 |                                                 if(d%(100*z)==0)ans=min(ans,temp+d/(100*z));
      |                                                                     ~~~^~~~~~~~~~~~~~~~~~~~
/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
/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:41:72: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   41 |                                                 if(d%(100*z)==0)ans=min(ans,temp+d/(100*z));
      |                                                                     ~~~^~~~~~~~~~~~~~~~~~~~
a.cc:42:61: error: no matching function for call to 'min(int&, long long int)'
   42 |                                                 else ans=min(ans,temp+d/(100*z)+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:42:61: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   42 |                                                 else ans=min(ans,temp+d/(100*z)+1);
      |                                                          ~~~^~~~~~~~~~~~~~~~~~~~~~
/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
/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:42:61: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   42 |                                                 else ans=min(ans,temp+d/(100*z)+1);
      |                                                          ~~~^~~~~~~~~~~~~~~~~~~~~~