Language: C++

using namespace std;

int d, g;

int cal(vector<int> p,vector<int> c,vector<bool> ju) {
	int num = 0, up = -1, ans = 1e9, co = 0;
	for (int i = 0;i < d;i++) {
		if (ju[i]) {
			num += p[i] * (i + 1) * 100 + c[i];
			co += p[i];
		}
		else
		up = i;
	}
	if (up == -1)
		if (num >= g)
			return co;
		return ans;
	if (num >= g)
		return co;
	if (num + (up + 1)*p[up] * 100 <= g)
		return ans;
	int la = g - num;
	co += (la + (up + 1) * 100 - 1) / ((up + 1) * 100);
	return co;
}

int gen(int n,vector<int> p,vector<int> c,vector<bool> ju) {
	int ans;
	if (n > -1) {
		ju[n] = false;
		ans = gen(n - 1, p, c,ju);
		ju[n] = true;
		ans = min(ans, gen(n - 1, p, c,ju));
	}
	else {
		ans=cal(p, c, ju);
	}
	return ans;
}

int main() {
	cin >> d >> g;
	vector<int> p(d), c(d);
	for (int i = 0;i < d;i++) {
		cin >> p[i] >> c[i];
	}
	vector<bool> ju(10, false);
	int ans=gen(d - 1, p, c, ju);
	cout << ans << endl;
}


Compiler output:
a.cc:5:9: error: 'vector' was not declared in this scope
    5 | int cal(vector<int> p,vector<int> c,vector<bool> ju) {
      |         ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:5:16: error: expected primary-expression before 'int'
    5 | int cal(vector<int> p,vector<int> c,vector<bool> ju) {
      |                ^~~
a.cc:5:23: error: 'vector' was not declared in this scope
    5 | int cal(vector<int> p,vector<int> c,vector<bool> ju) {
      |                       ^~~~~~
a.cc:5:23: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:5:30: error: expected primary-expression before 'int'
    5 | int cal(vector<int> p,vector<int> c,vector<bool> ju) {
      |                              ^~~
a.cc:5:37: error: 'vector' was not declared in this scope
    5 | int cal(vector<int> p,vector<int> c,vector<bool> ju) {
      |                                     ^~~~~~
a.cc:5:37: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:5:44: error: expected primary-expression before 'bool'
    5 | int cal(vector<int> p,vector<int> c,vector<bool> ju) {
      |                                            ^~~~
a.cc:5:52: error: expression list treated as compound expression in initializer [-fpermissive]
    5 | int cal(vector<int> p,vector<int> c,vector<bool> ju) {
      |                                                    ^
a.cc:28:15: error: 'vector' has not been declared
   28 | int gen(int n,vector<int> p,vector<int> c,vector<bool> ju) {
      |               ^~~~~~
a.cc:28:21: error: expected ',' or '...' before '<' token
   28 | int gen(int n,vector<int> p,vector<int> c,vector<bool> ju) {
      |                     ^
a.cc: In function 'int gen(int, int)':
a.cc:31:17: error: 'ju' was not declared in this scope
   31 |                 ju[n] = false;
      |                 ^~
a.cc:32:34: error: 'p' was not declared in this scope
   32 |                 ans = gen(n - 1, p, c,ju);
      |                                  ^
a.cc:32:37: error: 'c' was not declared in this scope
   32 |                 ans = gen(n - 1, p, c,ju);
      |                                     ^
a.cc:34:23: error: 'min' was not declared in this scope
   34 |                 ans = min(ans, gen(n - 1, p, c,ju));
      |                       ^~~
a.cc:37:25: error: 'p' was not declared in this scope
   37 |                 ans=cal(p, c, ju);
      |                         ^
a.cc:37:28: error: 'c' was not declared in this scope
   37 |                 ans=cal(p, c, ju);
      |                            ^
a.cc:37:31: error: 'ju' was not declared in this scope
   37 |                 ans=cal(p, c, ju);
      |                               ^~
a.cc:37:33: error: 'cal' cannot be used as a function
   37 |                 ans=cal(p, c, ju);
      |                                 ^
a.cc: In function 'int main()':
a.cc:43:9: error: 'cin' was not declared in this scope
   43 |         cin >> d >> g;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:44:9: error: 'vector' was not declared in this scope
   44 |         vector<int> p(d), c(d);
      |         ^~~~~~
a.cc:44:9: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:44:16: error: expected primary-expression before 'int'
   44 |         vector<int> p(d), c(d);
      |                ^~~
a.cc:46:24: error: 'p' was not declared in this scope
   46 |                 cin >> p[i] >> c[i];
      |                        ^
a.cc:46:32: error: 'c' was not declared in this scope
   46 |                 cin >> p[i] >> c[i];
      |                                ^
a.cc:48:16: error: expected primary-expression before 'bool'
   48 |         vector<bool> ju(10, false);
      |                ^~~~
a.cc:49:28: error: 'p' was not declared in this scope
   49 |         int ans=gen(d - 1, p, c, ju);
      |                            ^
a.cc:49:31: error: 'c' was not declared in this scope
   49 |         int ans=gen(d - 1, p, c, ju);
      |                               ^
a.cc:49:34: error: 'ju' was not declared in this scope
   49 |         int ans=gen(d - 1, p, c, ju);
      |                                  ^~
a.cc:50:9: error: 'cout' was not declared in this scope
   50 |         cout << ans << endl;
      |         ^~~~
a.cc:50:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:50:24: error: 'endl' was not declared in this scope
   50 |         cout << ans << endl;
      |                        ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;