criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <sstream>
#include <stack>
#include <deque>
using namespace std;
#define ll long long
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define pi pair<int,int>
#define pii pair<pi,int>
#define sqr(x) ((x)*(x))
#define FOR for(int i=0;i<n;i++)for(int j=0;j<m;j++)
const int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
const int mod=1e9+7;
string s;
unsigned f[4];

void add(unsigned &a,unsigned b) {
    a+=b;
    while(a>=mod)a-=mod;
}

int main(void){
    cin>>s;
    f[0]=1;
    for (int i=0;i<s.size();++i) {
        for (int j=3;j>=0;--j){
            add(f[j],f[j]*2*(s[i]=='?'));
            if (j) add(f[j],f[j-1]*(s[i]=='?'||s[i]=='A'+j-1));}}
    cout<<f[3]<<endl;
  return 0；
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:10: error: unable to find numeric literal operator 'operator""\U0000ff1b'
   40 |   return 0；
      |          ^~~
a.cc:40:13: error: expected ';' before '}' token
   40 |   return 0；
      |             ^
      |             ;
   41 | }
      | ~
Language: C

#include <algorithm>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <queue>
#include <stack>
#include <utility>
#include <vector>
using std::cin;
using std::cout;
using std::endl;

int main(void) {

    int d, g;
    int amount[11], bonus[11];
    int answer = 1100;
    cin >> d >> g;
    for (int i = 1; i <= d; i++) {
        cin >> amount[i] >> bonus[i];
    }

    //解き切らなくても大丈夫な時
    if (amount[d] * d * 100 >= g) {
        answer = g / (d * 100);
        if (g % (d * 100) != 0)
            answer++;
        cout << answer << endl;
        return 0;
    }

    //だめな時
    for (int bit = 1; bit <= (1 << d) - 1; bit++) {
        // bitは解き切る問題の集合
        int score;
        int count;
        //解き切る問題を解き切る
        for (int i = 1; i <= d; i++) {
            int mask = 1 << (i - 1);
            if (bit & mask) {
                score += amount[i] * i * 100 + bonus[i];
                count += amount[i];
            }
        }
        //解き切らない問題のうち最大スコアのものを見る
        int not_complete = 1 << d;
        for (int i = d; i > 0; i--) {
            not_complete = 1;
            if (not_complete & (~bit)) {
                //見つかったら残りを埋めきれるか確認
                if (score + (amount[i] - 1) * 100 * i >= g) {
                    //残りを埋めきれる
                    int needed_score = g - score;
                    count += needed_score / (i * 100);
                    if (needed_score % (i * 100) != 0)
                        count++;
                } else {
                    //残りを埋めるのに失敗
                    count = 1100;
                }
                break;
            }
        }
        //仕上げの比較
        if (answer > count) {
            answer = count;
        }
    }

    cout << answer << endl;
}


Compiler output:
main.c:1:10: fatal error: algorithm: No such file or directory
    1 | #include <algorithm>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;
int main()
{
	int d,g;
	int i,j;
	int p[11],c[11];
	scanf("%d%d",&d,&g);
	for(i=0;i<d;i++)
		scanf("%d%d",&p[i],&c[i]);
	int ans = INF;
	for(i=0;i<(1<<d);i++)
	{
		ll sum=0;
		int ss=0;
		for(j=0;j<d;j++)
		{
			if((i>>j)&1)
			{
				sum += p[j]*(j+1)*100+c[i];
				ss += p[j];
			}
		}
		for(j=d-1;j>=0;j--)
		{
			if((i>>j)&1)	continue;
			if(sum >= g)	continue;
			int s;
			s = (g-sum)/((j+1)*100);
			s = min(s,p[j]);
			ss += s;
			sum += (j+1)*100*q;
		}
		if(g <= sum)
			ans = min(ans,ss);
	}
	printf("%d\n",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:42: error: 'q' was not declared in this scope
   37 |                         sum += (j+1)*100*q;
      |                                          ^
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;
int main()
{
	int d,g;
	int i,j;
	int p[11],c[11];
	scanf("%d%d",&d,&g);
	for(i=0;i<d;i++)
		scanf("%d%d",&p[i],&c[i]);
	int ans = INF;
	for(i=0;i<(1<<d);i++)
	{
		ll sum=0;
		int ss=0;
		for(j=0;j<d;j++)
		{
			if((i>>j)&1)
			{
				sum += p[j]*(j+1)*100+c[i];
				ss += p[j];
			}
		}
		for(j=d-1;j>=0;j--)
		{
			if((i>>j)&1)	continue;
			if(sum >= g)	continue;
			int s;
			s = (g-sum)/((j+1)*100);
			s = min(s,p[j]);
			ss += s;
			sum += (j+1)*100*q;
		}
		if(g <= sum)
			ans = min(ans,ss);
	}
	printf("%d\n",ss);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:42: error: 'q' was not declared in this scope
   37 |                         sum += (j+1)*100*q;
      |                                          ^
a.cc:42:23: error: 'ss' was not declared in this scope
   42 |         printf("%d\n",ss);
      |                       ^~
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl;
#define OK(ok) cout << (ok ? "Yes" : "No") << endl;
typedef long long ll;

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail) {
  cin >> head; CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;
const int MAX_N = 1e5 + 1;

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);

  CIN(D, G);
  vector< int > p(D);
  vector< int > c(D);
  REP(i, D) {
    cin >> p[i] >> c[i];
  }

  int ans = INF;
  REP(bit, (1 << D)) {
    int sm, tmp, mx;
    sm = tmp = mx = 0;
    REP(i, D) {
      if ((bit >> i) & 1) {
	sm += 100 * p[i] + c[i];
	tmp += p[i];
      } else {
	mx = max(mx, i);
      }
    }
    if (sm < G) {
      int tmpMx = 100 * (mx + 1);
      int tmpNum = (G - sm + tmpMx - 1) / tmpMx;
      if (tmpNum > p[mx]) continue;
      tmp += tmpNum;
    }
    ans = min(ans, tmp);
  }
  cout << ans << enld;

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:60:18: error: 'enld' was not declared in this scope
   60 |   cout << ans << enld;
      |                  ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define forx(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;


int main()
{
    int d, g,ans=100000000;
    cin >> d >> g;
    vector<int> p(d), c(d);
    rep(i, d) cin >> p[i] >> c[i];
    for(int x = 1;x<(1<<d);x++){
        int sum=0,num=0,mx=-1;
        rep(i, d) {
            if ((d >> i) & 1) sum += 100*(i+1)*p[i] + c[i];
            else mx = 1+i;
        }
        if(sum<g){
            int need = (g - sum - 1 + 100 * mx) / 100*mx;
            if(need>=p[mx-1])
                continue;
            num += need;
        }
        ans = min(ans, num);
    }
    cout << num << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:13: error: 'num' was not declared in this scope; did you mean 'enum'?
   28 |     cout << num << endl;
      |             ^~~
      |             enum
Language: C++

#include <iostream>
using namespace std;
int main(){
    int D, G, p[11], c[11];
    cin >> D >> G;
    for(int i = 0; i < D; ++i){
        cin >> p[i] >> c[i];
    }
 
    int ans = 1e9;
    for(int mask = 0; mask < (1 << D); ++mask){
        int s = 0, num = 0, rest_max = -1;
        for(int i = 0; i < D; ++i){
            if(mask >> i & 1){
                s += 100 * (i+1) * p[i] + c[i];
                num += p[i];
            }else{
                rest_max = i;
            }
        }
        if(s < G){
            int s1 = 100 * (rest_max + 1);
            int need = int(ceil((float(G - s) / s1));
            if(need > p[rest_max]){
                continue;
            }
            num += need;
        }
        ans = min(ans, num);
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:28: error: 'ceil' was not declared in this scope
   23 |             int need = int(ceil((float(G - s) / s1));
      |                            ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define rep(i, a) for (int (i) = 0; (i) < (a); (i)++)
#define reps(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define REP(i, a) for (int (i) = (a)-1; (i) >= 0; (i)--)
#define REPS(i, a, b) for (int (i) = (a)-1; (i) >= (b); (i)--)
#define MP(a, b) make_pair((a), (b))
#define pb(a) push_back((a))
#define INF 2e9

int bit;
int D, G;
int v[10];
int c[10];
int p[10];
int V[10];
int ma;

void culc(int& cost, int& score)
{
	int t = bit;
	int i = 0;
	cost = 0;
	score = 0;
	while(t) {
		if (t % 2 == 1) {
			cost += p[i];
			score += V[i];
		}
		i++;
		t >>= 1;
	}
}

void rest(int& cost, int& score)
{
	int t = bit;
	int i2 = -1;
	int pt = -1;
	rep(i, D) {
		if (t % 2 == 0) {
			pt = (G - score) / v[i];
			i2 = i;
		}
		t >>= 1;
	}
	if (i2 == -1) return;
	if (pt > p[i2]) {
      if (G - score <= V[i]) {
        cost += p[i];
      } else {
        cost = INF;
      }
    }
	else if (pt >= 0) {
		cost += pt;
		score = G;
	}
}

int main()
{
	cin >> D >> G;
	G /= 100;
	rep(i, D) {
		cin >> p[i] >> c[i];
		v[i] = i+1;
		c[i] /= 100;
		V[i] = p[i] * v[i] + c[i];
		ma += p[i];
	}
	int mi = ma;
	for (bit = 0; bit < (1 << D); bit++) {
		int cost;
		int score;
		culc(cost, score);
		rest(cost, score);
		mi = min(mi, cost);
	}
	cout << mi << endl;
}



Compiler output:
a.cc: In function 'void rest(int&, int&)':
a.cc:51:26: error: 'i' was not declared in this scope; did you mean 'i2'?
   51 |       if (G - score <= V[i]) {
      |                          ^
      |                          i2
Language: C++

#include<iostream>
#include<algorithm>
#include<fstream>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<cctype>
#include<cmath>
#include<vector>
#include<climits>
#include<queue>

using namespace std;


int main()
{
    int i,ans,mask,d,g;
    int p[11],c[11];
    scanf("%d%d",&d,&g);
    for(i=0; i<d; ++i)
        scanf("%d%d",&p[i],&c[i]);
    ans=1e9;
    for(mask=0; mask < pow(2,d); ++mask)
    //for(mask=0; mask < (1 << d); ++mask)
    {
        int s=0,num=0,rest_max=-1;
        for(i=0; i<d; ++i)
        {
            if((mask/pow(2,i))%2==1)
            //if(mask >> i &1)
            {
                s+=100*(i+1)*p[i]+c[i];
                num+=p[i];
            }
            else
            {
                rest_max=i;
            }
        }
        if(s<g)
        {
            int s1=100*(rest_max+1);
            int need=(g-s+s1-1)/s1;
            if(need>=p[rest_max])
                continue;
            num+=need;
        }
        ans=min(ans,num);
    }
    printf("%d\n",ans);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:31: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   31 |             if((mask/pow(2,i))%2==1)
      |                ~~~~~~~~~~~~~~~^~
      |                     |          |
      |                     |          int
      |                     __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include <array>
#include <iostream>
using namespace std;

const int D = 10, P = 100, C = 1E6;
array<int, D+1> p, c;
array<array<long long, D*P+1>, D+1> f;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr); cout.tie(nullptr);
  int d, g; cin >> d >> g; int res = INT_MAX;
  for (int i = 1; i <= d; ++i) cin >> p[i] >> c[i];
  for (int i = 1, prev = 0, cnt = p[i]; i <= d; prev = cnt, cnt += p[++i])
    for (int j = 1; j <= cnt; ++j)
      for (int x = max(j - prev, 0), lim = min(p[i], j); x <= lim; ++x)
        if ((f[i][j] = max(f[i][j], f[i-1][j-x] + (100*i*x + (x == p[i] ? c[i] : 0)))) >= g)
          res = min(res, j);
  cout << res;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:38: error: 'INT_MAX' was not declared in this scope
   12 |   int d, g; cin >> d >> g; int res = INT_MAX;
      |                                      ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <iostream>
  +++ |+#include <climits>
    3 | using namespace std;
Language: C++


#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include <numeric>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 99999999

using namespace std;


int dy[4] = { 0,0,1,-1 };
int dx[4] = { 1,-1,0,0 };
int dxx[8] = { 0,0,1,1,1,-1,-1,-1 };
int dyy[8] = { 1,-1,0,1,-1,0,1,-1 };





ll gcd(ll x, ll y) {
	ll m = max(x, y), n = min(x, y);
	if (m%n == 0)return n;
	else return gcd(m%n, n);
}
ll myPow(ll x, ll n, ll m) {
	if (n == 0)
		return 1;
	if (n % 2 == 0)
		return myPow(x * x % m, n / 2, m);
	else
		return x * myPow(x, n - 1, m) % m;
}
ll m = 10000007;
ll p[10], c[10];
int main() {
	int D, G;
	cin >> D >> G;
	REP(i, D) {
		cin >> p[i] >> c[i];
	}
	ll ans = INF;
	bool used[10];
	REP(i, 10)used[i] = false;
	#各配点の問題を解ききるかどうかで全探索(2^10通り)
	for (int x = 0; x < myPow(2, D, m); x++) {
		#例えばD = 10なら100000000000~1111111111を調べるので10進数だと0~1023
		int sum = 0;
		ll cnt = 0;
		for (int i = 0; i < D; i++) {
			if (x&(1 << i)) {#左からi桁目が1ならば
				used[i] = true;
				sum += 100 * (i + 1)*p[i] + c[i];
				cnt += p[i];
			}
		}
		if (sum >= G) {
			ans = min(ans, cnt);
		}
		else {
			REPR(i, D-1) {
				if (!used[i]) {
					REP(j, p[i]+1) {
						sum += 100 * (i + 1);
						cnt++;
						if (sum >= G) {
							ans = min(ans, cnt);
							break;
						}
					}
				}
			}
		}
		REP(i, 10)used[i] = false;
	}
	cout << ans << endl;
}

Compiler output:
a.cc:60:10: error: invalid preprocessing directive #\U00005404\U0000914d\U000070b9\U0000306e\U0000554f\U0000984c\U00003092\U000089e3\U0000304d\U0000304d\U0000308b\U0000304b\U00003069\U00003046\U0000304b\U00003067\U00005168\U000063a2\U00007d22
   60 |         #各配点の問題を解ききるかどうかで全探索(2^10通り)
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:62:18: error: invalid preprocessing directive #\U00004f8b\U00003048\U00003070D
   62 |                 #例えばD = 10なら100000000000~1111111111を調べるので10進数だと0~1023
      |                  ^~~~~~~
a.cc:66:42: error: stray '#' in program
   66 |                         if (x&(1 << i)) {#左からi桁目が1ならば
      |                                          ^
a.cc: In function 'int main()':
a.cc:66:43: error: '\U00005de6\U0000304b\U00003089i\U00006841\U000076ee\U0000304c1\U0000306a\U00003089\U00003070' was not declared in this scope
   66 |                         if (x&(1 << i)) {#左からi桁目が1ならば
      |                                           ^~~~~~~~~~~~~~~~~~~~
Language: Java

import java.util.Scanner;

public class CMain {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int d = scan.nextInt();
		long g = scan.nextLong();
		long min = 1<<29;
		int[] p = new int[d];
		int[] c = new int[d];
		for (int i = 0; i < d; i++) {
			p[i] = scan.nextInt();
			c[i] = scan.nextInt();
		}
		for (int bit = 0; bit < (1 << d) ; bit++) {
			int count = 0;
			long sum = 0;
			for (int i = 0; i < d; i++) {
				if ((bit & (1<< i)) != 0) {
					sum+=c[i]+(p[i]*100*(i+1));
					count += p[i];
				}
			}
				if (sum>=g) min = Math.min(min, count);
				else {
					for (int j = d-1; j >= 0; j--) {
						if ((bit & (1<< j)) != 0) continue;
						for (int k = 0; k < p[j]; k++) {
							sum += (j+1)*100;
							count++;
							if (sum>=g) break;
						}
					}
					min = Math.min(min, count);
				}
			}
		System.out.println(min);
	}
}


Compiler output:
Main.java:3: error: class CMain is public, should be declared in a file named CMain.java
public class CMain {
       ^
1 error
Language: C++

class Solution:
    def __init__(self):
        self.count = 0

    def check(self):
        n, target = map(int, input().split())
        array = [[0] * 3 for i in range(n)]

        for i in range(n):
            a, b = map(int, input().split())
            full_score = a * (i + 1) * 100 + b
            array[i] = a, b, (i + 1) * 100

        while target > 0:
            sorted(array, key=lambda x: (x[2] * x[0] + x[1]) / x[0] if x[2] * x[0] + x[1] <= target else x[2])
            a, b, c = array.pop()

            if a * c + b <= target:
                self.count += a
                target -= a * c + b
            else:
                self.count += target // c
                target = 0

        return self.count


print(Solution().check())

Compiler output:
a.cc:2:9: error: expected class-name before '__init__'
    2 |     def __init__(self):
      |         ^~~~~~~~
a.cc:2:9: error: expected '{' before '__init__'
a.cc:2:18: error: 'self' was not declared in this scope
    2 |     def __init__(self):
      |                  ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <ctype.h>
#include <algorithm>
#include <iterator>

// int calc_point(std::vector<int> vp, std::vector<int> vc, std::vector<int> route) {
//     int point = 0;
//     int* ans_flag = new int[vp.size()];
//     for (int i=0; i<vp.size(); i++) {
//         ans_flag[i] = 0;
//     }
//     for (int i : route) {
//         point += (i+1) * 100;
//         ans_flag[i] += 1;
//         if (ans_flag[i] == vp[i]) {
//             point += vc[i];
//         }
//     }
//     return point;
// }

// int wfs(int num, std::vector<int> init_flag, int target, std::vector<int> vp, std::vector<int> vc) {
//     std::vector<std::vector<int>> que;
//     int min_depth = INT_MAX;
//     que.push_back(init_flag);
//     while (que.size() > 0) {
//         std::vector<int> route = que.back();
//         int score = calc_point(vp, vc, route);
//         que.pop_back();
//         if (route.size() > min_depth) {
//             continue;
//         }
//         if (score >= target) {
//             min_depth = route.size();
//             continue;
//         }
//         for (int i=0; i<num; i++) {
//             if (std::count(route.begin(), route.end(), i) < vp[i]) {
//                 std::vector<int> new_route;
//                 route.push_back(i);
//                 copy(route.begin(), route.end(), back_inserter(new_route));
//                 que.insert(que.begin(), new_route);
//             }
//         }
//     }
//     return min_depth;
// }

int main() {
    int min_num = INT_MAX;
    int num, target;
    std::vector<int> vp, vc, init_flag;
    std::cin >> num >> target;
    for (int i=0; i<num; i++) {
        int p, c;
        std::cin >> p >> c;
        vp.push_back(p);
        vc.push_back(c);
    }
    for (int bit=0; bit < (1 << num); bit++) {
        int sum = 0, prob_num = 0;
        for (int i=0; i<num; i++) {
            sum += bit & (1 << i) ? (i+1)*100*vp[i]+vc[i] : 0;
            prob_num += bit & (1 << i) ? vp[i] : 0;
        }
        if (sum >= target) {
            min_num = std::min(prob_num, min_num);
        } else {
            for (int i=num-1; i>=0; i--) {
                if (bit & (1 << i)) continue;
                for (int j=0; j<vp[i]; j++) {
                    if (sum >= target) {
                        break;
                    }
                    sum += (i+1) * 100;
                    prob_num ++;
                }
            }
            min_num = std::min(prob_num, min_num);
        }
    }
    std::cout << min_num << "\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:19: error: 'INT_MAX' was not declared in this scope
   52 |     int min_num = INT_MAX;
      |                   ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <iterator>
  +++ |+#include <climits>
    7 |
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <ctype.h>
#include <algorithm>
#include <iterator>

int calc_point(std::vector<int> vp, std::vector<int> vc, std::vector<int> route) {
    int point = 0;
    int* ans_flag = new int[vp.size()];
    for (int i=0; i<vp.size(); i++) {
        ans_flag[i] = 0;
    }
    for (int i : route) {
        point += (i+1) * 100;
        ans_flag[i] += 1;
        if (ans_flag[i] == vp[i]) {
            point += vc[i];
        }
    }
    return point;
}

int wfs(int num, std::vector<int> init_flag, int target, std::vector<int> vp, std::vector<int> vc) {
    std::vector<std::vector<int>> que;
    int min_depth = INT_MAX;
    que.push_back(init_flag);
    while (que.size() > 0) {
        std::vector<int> route = que.back();
        int score = calc_point(vp, vc, route);
        que.pop_back();
        if (route.size() > min_depth) {
            continue;
        }
        if (score >= target) {
            min_depth = route.size();
            continue;
        }
        for (int i=0; i<num; i++) {
            if (std::count(route.begin(), route.end(), i) < vp[i]) {
                std::vector<int> new_route;
                route.push_back(i);
                copy(route.begin(), route.end(), back_inserter(new_route));
                que.insert(que.begin(), new_route);
            }
        }
    }
    return min_depth;
}

int main() {
    int min_num = INT_MAX;
    int num, target;
    std::vector<int> vp, vc, init_flag;
    std::cin >> num >> target;
    for (int i=0; i<num; i++) {
        int p, c;
        std::cin >> p >> c;
        vp.push_back(p);
        vc.push_back(c);
    }
    for (int bit=0; bit < (1 << num); bit++) {
        int sum = 0, prob_num = 0;
        for (int i=0; i<num; i++) {
            sum += bit & (1 << i) ? (i+1)*100*vp[i]+vc[i] : 0;
            prob_num += bit & (1 << i) ? vp[i] : 0;
        }
        if (sum >= target) {
            min_num = std::min(prob_num, min_num);
        } else {
            for (int i=num-1; i>=0; i--) {
                if (bit & (1 << i)) continue;
                for (int j=0; j<vp[i]; j++) {
                    if (sum >= target) {
                        break;
                    }
                    sum += (i+1) * 100;
                    prob_num ++;
                }
            }
            min_num = std::min(prob_num, min_num);
        }
    }
    std::cout << min_num << "\n";
    return 0;
}


Compiler output:
a.cc: In function 'int wfs(int, std::vector<int>, int, std::vector<int>, std::vector<int>)':
a.cc:26:21: error: 'INT_MAX' was not declared in this scope
   26 |     int min_depth = INT_MAX;
      |                     ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <iterator>
  +++ |+#include <climits>
    7 | 
a.cc: In function 'int main()':
a.cc:52:19: error: 'INT_MAX' was not declared in this scope
   52 |     int min_num = INT_MAX;
      |                   ^~~~~~~
a.cc:52:19: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include<iostream>
#include<vector>
using namespace std;

int main() {
	int N, G, res = 999;
	cin >> N >> G;
	int *p, *c;
	p = (int *)malloc(sizeof(N));
	c = (int *)malloc(sizeof(N));

	for (int i = 1;i<=N;i++) {
		cin >> p[i] >> c[i];
		for (int j = 1, sum = G;j<=p[i]||sum>0;j++) {
			sum -= i * 100;
			if (j == p[i])
				sum -= c[i];
				
			
		}
      if (res>j)
					res = j;
	}
	cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:15: error: 'j' was not declared in this scope
   21 |       if (res>j)
      |               ^
Language: C++

#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
using namespace std;
struct mm{
  int x,y,z,b;


}s[30];
bool cmp(mm A,mm B){
  return A.x<B.x;
}
int main()
{int n,sum;
 cin>>n>>sum;
 for(int i=1;i<=n;i++)
 { cin>>s[i].x>>s[i].y;
     s[i].z=s[i]*i*100;
     s[i].b=i*100;
 }
 
  sort(s+1,s+1+n,cmp);
 for(int i=1;i<=n;i++)
 if(sum<=s[i].z+s[i].y&&sum>=s[i].z){cout<<s[i].x<<endl;break;}
 else if(sum<s[i].z)cout<<sum/s[i].b<<endl;

 
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: no match for 'operator*' (operand types are 'mm' and 'int')
   19 |      s[i].z=s[i]*i*100;
      |             ~~~~^~
      |                | |
      |                | int
      |                mm
Language: C++

#include <stdio.h>

int main(void){
    int d,g;
    scanf("%d%d",&d,&g);
    int p[105];
    int c[105];
    for(int i=1; i<=d; i++){
        scanf("%d%d",&p[i],&c[i]);
    }

    //greed
    int score=0,count=0,ans=1000000;
    for(int i=d; i>0; i--){
        for(int j=1; j<=p[i]; j++){
            score+=(100*i);
            count++;
            if(score>=g && ans>count){
                ans=count;
                break;
            }
        }
        score+=c[i];
        if(score>=g){
            if(ans>count){
                ans=count;
            }
            break;
        }
    }
    score=0,count=0;
    //ボーナス狙い
    int expect[105];
    int used[105];
    for(int i=1; i<=d; i++){
        expect[i]=(i*100)+c[i]/p[i];
    }
    for(int j=1; j<=d; j++){
        int max=d*100;
        int temp=0;
    for(int i=j+1; i<=d; i++){
        if(expect[i]>max){
            max=expect[i];
            temp=i;
        }
    }
    
            score+=(i*100)*p[temp]+c[temp];
            count+=p[temp];
        if(score>=g){
            if(ans>count)ans=count;
            break;
        }
    }
    printf("%d",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:21: error: 'i' was not declared in this scope
   48 |             score+=(i*100)*p[temp]+c[temp];
      |                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int d,g,cnt=0,cnt2 = 0;
long long ans = 0;
bool t = true;
struct score {
	int p;
	int c;
	int n;
};
score s[11];
bool cmp(const score x,const score y) {
	if(x.p<y.p) return true;
	if(x.p>y.p) return false;
	if(x.n>y.n) return true;
	else return false;
}
bool cmp2(const score x,const score y) {
	if(x.n>y.n) return true;
	else return false;
}
int main() {
	cin>>d>>g;
	g/=100;
	for(int i=1; i<=d; i++) {
		cin>>s[i].p>>s[i].c;
		s[i].n = i;
		s[i].c/=100;
	}
	stable_sort(s+1,s+d+1,cmp);
	for(int i=1; i<=d&&t; i++)
		for(int j=1; j<=s[i].p; j++) {
			if(ans>=g) {
				t = false;
				break;
			}
			cnt++;
			ans+=s[i].n;
			if(j==s[i].p)
				ans+=s[i].c;
		}
	stable_sort(s+1,s+d+1,cmp);
	t = true;
	ans = 0;
	for(int i=1;i<=d && t;i++) {
		for(int j=1;j<=s[i].p;j++) {
			if(ans>=g) {
				t = false;
				break;
			}
			cnt2++;
			ans+=s[i].n;
			if(j==s[i].p)
				ans+=s[i].c;
		}
	}
	cout<<--min(cnt,cnt2);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:20: error: decrement of read-only location 'std::min<int>(cnt, cnt2)'
   57 |         cout<<--min(cnt,cnt2);
      |                 ~~~^~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int d, g, n, ans=1000, i, j, kari, kazu;
  cin >> d >> g;
  int p[10], c[10], dnum[10];

  for(i=0; i<10; i++) {
    p[i]=0;
    c[i]=0;
  }

  for(i=0; i<d; i++) {
    cin >> p[i] >> c[i];
  }
  

  for(dnum[0]=0; dnum[0]<=p[0]&&100*dnum[0]<=g; dnum[0]++)
    for(dnum[1]=0; dnum[1]<=p[1]&&(100*dnum[0]+200*dnum[1]<=g+200; dnum[1]++)
      for(dnum[2]=0; dnum[2]<=p[2]; dnum[2]++)
	for(dnum[3]=0; dnum[3]<=p[3]; dnum[3]++)
	  for(dnum[4]=0; dnum[4]<=p[4]; dnum[4]++)
	    for(dnum[5]=0; dnum[5]<=p[5]; dnum[5]++)
	      for(dnum[6]=0; dnum[6]<=p[6]; dnum[6]++)
		for(dnum[7]=0; dnum[7]<=p[7]; dnum[7]++)
		  for(dnum[8]=0; dnum[8]<=p[8]; dnum[8]++)
		    for(dnum[9]=0; dnum[9]<=p[9]; dnum[9]++){
		      kari=0;
		      kazu=0;
		      for(i=0; i<10; i++)
			{kazu+=dnum[i];
			  kari+=(100*(i+1)*dnum[i]);
			  if(dnum[i]==p[i])
			    kari+=c[i];
			}
		      if((kari>=g) && (kazu<ans))
			ans=kazu;
		    }
  cout << ans;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:66: error: expected ')' before ';' token
   21 |     for(dnum[1]=0; dnum[1]<=p[1]&&(100*dnum[0]+200*dnum[1]<=g+200; dnum[1]++)
      |                                   ~                              ^
      |                                                                  )
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int D,G;
  cin>>D>>G;
  int p[D],c[D];
  for(int i=0;i<D;i++)cin>>p[i]>>c[i];
  pair<double, pair <int,int > > a[D];
  for(int i=0;i<D;i++){
    a[i].first=(((double)(i+1)*100*p[i]+c[i])/p[i]);
    a[i].second.first=(i+1)*100*p[i]+c[i];
    a[i].second.second=i;
  }
  bool used[D]={false};
  sort(a,a+D,greater<pair<double, pair <int,int> > >());
  int ans=0;
  for(int i=0;i<D;i++){
    if (G>=a[i].second.first){G-=a[i].second.first;ans+=p[a[i].second.second];used[a[i].second.second]=true;}
    else break;
  }
  if(G==0){cout<<ans<<endl; return 0;}
  int _min=999;
  for(int i =0;i<D;i++){
    if (used[i]) continue;
    if(G<=(1+i)*100*(p[i]-1)) {_min=min(_min,(G+(1+i)*100-1)/((1+i)*100));break;}
    else if(G>(i+1)*100*(p[i]-1) and G<=(i+1)*100*p[i]+c[i]) {_min=min(_min,p[i]);break}
  }
  cout<<_min+ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:88: error: expected ';' before '}' token
   26 |     else if(G>(i+1)*100*(p[i]-1) and G<=(i+1)*100*p[i]+c[i]) {_min=min(_min,p[i]);break}
      |                                                                                        ^
      |                                                                                        ;
Language: C++

#include<iostream>
using namespace std;

int main(){
	int d, g;
	int *p, *c;

	cin>> d>> g;

	g= g/100;

	p= new int[d];
	c= new int[d];

	for(int i=0; i< d; i++){
		int tmp;

		cin>> p[i];
		cin>> tmp;

		c[i]= tmp/100;
	}

	int listLength= g+ c[d-1] +1;
	int *dp;
	dp= new int[listLength]();

	cout<< listLength<<endl;

	for(int i=1; i< listLength;i++)
		dp[i]= INT_MAX;

	for(int i=0; i< d; i++){
		int iter= p[i];

		for(int j=0; j< iter; j++){
			int multiply= (i+1)*(j+1);

			if(j==iter-1)
				multiply+= c[i];

			for(int k=listLength-1; k>=0 ; k--){
				if(dp[k]!= INT_MAX){
					int minimum= dp[k]+(j+1);
					int target= k+ multiply;

					if(target< listLength){
						for(int l=0; l<= target; l++)
							dp[l]= min(dp[l],minimum);
					}
					
				}
			}
		}


	}

	int ans= INT_MAX;

	for(int i= listLength-1 ; i>= g-1; i--)
		if(dp[i]< ans)
			ans= dp[i];

	cout<< ans<<endl;

//	for(int i=0; i< listLength;i++)
//		cout<<dp[i]<<endl;

	return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:24: error: 'INT_MAX' was not declared in this scope
   31 |                 dp[i]= INT_MAX;
      |                        ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include<iostream>
  +++ |+#include <climits>
    2 | using namespace std;
a.cc:43:44: error: 'INT_MAX' was not declared in this scope
   43 |                                 if(dp[k]!= INT_MAX){
      |                                            ^~~~~~~
a.cc:43:44: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
a.cc:59:18: error: 'INT_MAX' was not declared in this scope
   59 |         int ans= INT_MAX;
      |                  ^~~~~~~
a.cc:59:18: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>

int main()
{
	int D, G;
	std::cin >> D >> G;
	std::vector<int> p, c;
	p.resize(D, 0);
	c.resize(D, 0);
	for (int i = 0; i < D; ++i) {
		std::cin >> p[i] >> c[i];
	}
	std::vector<int> t;
	t.resize(D, 0);
	int g = G;
	for (int i = D - 1; i >= 0; ) {
		if (g <= 0) {
			break;
		}
		if (t[i] > 0) {
			--i;
			continue;
		}
		auto pi = 100 * (i + 1);
		auto n = std::min(p[i], (int)std::ceil((float)g / pi));
		auto si = pi * n;
		if (n == p[i]) {
			si += c[i];
		}

		int k = -1;
		for (int j = i - 1; j >= 0; --j) {
			auto sj = 100 * (j + 1) * p[j] + c[j];
			if (t[j] == 0 && p[j] <= n && (g <= sj || si <= sj)) {
				if (k >= 0) {
					auto sk = 100 * (k + 1) * p[k] + c[k];
					if (sj <= sk) {
						k = j;
					}
				}
				else {
					k = j;
				}
			}
		}
		if (k >= 0) {
			g -= 100 * (k + 1) * p[k] + c[k];
			t[k] = p[k];
			continue;
		}

		g -= si;
		t[i] = n;
		--i;
	}
	auto result = std::accumulate(t.begin(), t.end(), 0);
	std::cout << result << std::endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:51: error: 'ceil' is not a member of 'std'
   28 |                 auto n = std::min(p[i], (int)std::ceil((float)g / pi));
      |                                                   ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <list>
#include <iomanip>
#include <queue>
#include <functional>
#include <cassert>
#include <cmath>
#include <set>

#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define NL << endl

using namespace std;
using ll = long long;


int main() {

	int d;
	ll g;
	cin >> d >> g;

	vector<int> p(10);
	vector<ll> c(10);
	ll ans = LLONG_MAX;

	REP(i, d) {
		cin >> p[i] >> c[i];
	}
	FOR(i, d, 10) {
		p[d] = 0;
		c[d] = 0;
	}

	for (int i = 0; i < 2048; i++) {
		int t = i;
		ll v = 0;
		vector<int> dd(10, 0);
		ll cand = 0;
		for (int j = 0; j < 10; j++) {
			if (t & 0b1) {
				v += p[j] * (j + 1) * 100 + c[j];
				cand += p[j];
				dd[j] = 1;
			} 
			t = t >> 1;
		}
		if (v >= g) {
			ans = min(ans, cand);
			goto exit;
		}
		for (int j = 9; j >= 0; j--) {
			if(dd[j] == 0)
			for (int k = 1; k <= p[j]; k++) {
				v += (j + 1) * 100;
				cand++;
				if (v >= g) {
					ans = min(ans, cand);
					goto exit;
				}
			}
		}
	exit:;
	}


	cout << ans NL;

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:18: error: 'LLONG_MAX' was not declared in this scope
   30 |         ll ans = LLONG_MAX;
      |                  ^~~~~~~~~
a.cc:13:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   12 | #include <set>
  +++ |+#include <climits>
   13 |
Language: C

#include <stdio.h>
#include <stdlib.h>

typedef struct{
  int p;
  int c;
  int pt;
}problem;

int comp1(const void * a, const void *b)
{
  if(((problem *)a)->p < ((problem *)b)->p)
    return -1;
  else if(((problem *)a)->p == ((problem *)b)->p)
    retrun 0;
  else
    return 1;
}

int comp2(const void * a, const void *b)
{
  if(((problem *)a)->c > ((problem *)b)->c)
    return -1;
  else if(((problem *)a)->c == ((problem *)b)->c)
    retrun 0;
  else
    return 1;
}

int main(void)
{
  int d,g;
  problem probs[10];
  int i, j, k, buf, c1 = 0, c2 = 0,c3 = 0,c4 = 0;

  scanf("%d %d",&d, &g);

  for(i = 0; i < d ; i++){
    scanf("%d %d",&probs[i].p, &probs[i].c);
    probs[i].pt = i;
  }

  g /= 100;
  for(i = 0; i < d; i++)
    probs[i].c /=  100;

  buf = g;
  for(i = d-1; i >= 0; i --){
    for(j = 0; j < probs[i].p; j ++){
      if (buf <= 0)
        goto out1;
     c1 ++; buf -= ( i + 1)  ;
    }
    buf -= probs[i].c;
  }
out1 :

  buf = g;
  for(i = 0; i < d; i ++){
    for (j = 0; j < probs[i].p; j ++){
      if(buf <= 0)
        goto out2;
      c2 ++; buf -= ( i + 1);
    }
    buf -= probs[i].c;
  }
out2 :
  
  qsort(probs,(size_t)d,sizeof(probs[0]),comp1);
  buf = g;
  for(i = 0;i < d; i ++){
    for(j = 0; j < probs[i].p; j ++){
      if(buf <= 0)
        goto out3;
      c3 ++; buf -= (probs[i].pt +1);
    }
    buf -= probs[i].c;
  }

out3: 

  qsort(probs,(size_t)d,sizeof(probs[0]),comp2);
  buf = g;
  for(i = 0;i < d; i ++){
    for(j = 0; j < probs[i].p; j ++){
      if(buf <= 0)
        goto out4;
      c4 ++; buf -= (probs[i].pt +1);
    }
    buf -= probs[i].c;
  }

out4:
  
  if(c1 < c2 && c1 < c3 && c1 < c4)
    printf("%d\n",c1);
  else if(c2 < c3 && c2 < c4)
    printf("%d\n",c2);
  else if(c3 < c4)
    printf("%d\n",c3);
  else
    printf("%d\n",c4);

  return(0);
}

Compiler output:
main.c: In function 'comp1':
main.c:15:5: error: 'retrun' undeclared (first use in this function)
   15 |     retrun 0;
      |     ^~~~~~
main.c:15:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:11: error: expected ';' before numeric constant
   15 |     retrun 0;
      |           ^~
      |           ;
main.c: In function 'comp2':
main.c:25:5: error: 'retrun' undeclared (first use in this function)
   25 |     retrun 0;
      |     ^~~~~~
main.c:25:11: error: expected ';' before numeric constant
   25 |     retrun 0;
      |           ^~
      |           ;
Language: C++

#include <bits/stdc++.h>
using namespace std;

#define int long long
const double PI = 3.14159265358979323846;
typedef vector<int> vint;
typedef pair<int, int> pint;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

int D,G;
int p[22],c[22];
signed main() {
    cin>>D>>G;
    for(int i=1;i<=D;i++)cin>>p[i]>>c[i];
    vint v;
    for(int i=1;i<=D;i++)v.push_back(i);
    int ans=LLONG_MAX;
    do {
        int cur=0,score=0;
        for(int i=0;i<D;i++){
            if(score+v[i]*100*p[v[i]]+c[v[i]]>=G){
                cur+=min(p[v[i]],(G-score)/(v[i]*100)+(G-score)%(v[i]*100)!=0);
                ans=min(ans,cur);
                break;
            }
            cur+=p[v[i]];
            score+=v[i]*100*p[v[i]]+c[v[i]];
        }
    } while (next_permutation(v.begin(), v.end()));
    cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:25: error: no matching function for call to 'min(long long int&, bool)'
   23 |                 cur+=min(p[v[i]],(G-score)/(v[i]*100)+(G-score)%(v[i]*100)!=0);
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:23:25: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'bool')
   23 |                 cur+=min(p[v[i]],(G-score)/(v[i]*100)+(G-score)%(v[i]*100)!=0);
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:
/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:23:25: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   23 |                 cur+=min(p[v[i]],(G-score)/(v[i]*100)+(G-score)%(v[i]*100)!=0);
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define lli long long int
#define ulli unsigned long long int
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define pf pop_front()
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define loopl(i,a,b) for(lli i=a;i<b;i++) 
#define loop(i,a,b) for(int i=a;i<b;i++)
#define mod 1000000007
#define inf 7+1e18
# define lld long double
#define eps 0.000001
#define endl '\n'
using namespace std ;
 
int main()
{

	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
   lli d,g;
    cin>>d>>g;
   // lli a[d+1],b[d+1],c[d+1];
    
    pair<pair<lld,lli> , pair<lli,pair<lli,lli> > > p[d+1]; 
    loopl(i,1,d+1)
    {
    	cin>>p[i].ff.ss>>p[i].ss.ff;
    	p[i].ss.ss.ss=i;
    }
 
    loopl(i,1,d+1)
    {
    	p[i].ss.ss.ff = 100*i*p[i].ff.ss + p[i].ss.ff;
    	p[i].ff.ff = p[i].ss.ss.ff/p[i].ff.ss;
    }

    sort(p+1,p+d+1);
    lli cnt=0,cnt2=1000000000;
 
    lli f=g;
    for(lli i=d;i>=1;i--)
    {
       if(f>=p[i].ss.ss.ff)
       {
         f-=p[i].ss.ss.ff;
         cnt+=p[i].ff.ss;
       }
 
       else
       {
          loopl(j,1,i+1)
          {
          	if(p[j].ss.ss.ff>=f)
          	{
          		if(p[j].ff.ss*100*p[j].ss.ss.ss > f)
          		{
          			if(f%(100*j)==0) 
          			{
          				cnt2 = min(cnt2,f/(100*j));
          			}
 
          			else
          			{
          				cnt2 = min(cnt2,f/(100*j) + 1) ;
          			}
          		}
          		else 
          		{
          			cnt2 = min(cnt2,a[j]); 
          		}
          	}
          }
          f=0;
       }
 
       if(f<=0) break;
    }
    if(cnt2 == 1000000000) cnt2=0;
    //cout<<cnt<<" "<<cnt2<<endl;
    cout<<cnt2+cnt<<endl;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:78:49: error: 'a' was not declared in this scope
   78 |                                 cnt2 = min(cnt2,a[j]);
      |                                                 ^
Language: C++

#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define lli long long int
#define ulli unsigned long long int
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define pf pop_front()
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define loopl(i,a,b) for(lli i=a;i<b;i++) 
#define loop(i,a,b) for(int i=a;i<b;i++)
#define mod 1000000007
#define inf 7+1e18
# define lld long double
#define eps 0.000001
#define endl '\n'
using namespace std ;
 
int main()
{

	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
   lli d,g;
    cin>>d>>g;
   // lli a[d+1],b[d+1],c[d+1];
    
    pair<pair<lld,lli> , pair<lli,pair<lli,lli> > > p[d+1]; 
    loopl(i,1,d+1)
    {
    	cin>>p[i].ff.ss>>p[i].ss.ff;
    	p[i].ss.ss.ss=i;
    }
 
    loopl(i,1,d+1)
    {
    	p[i].ss.ss.ff = 100*i*p[i].ff.ss + p[i].ss.ff;
    	p[i].ff.ff = p[i].ss.ss.ff/p[i].ff.ss;
    }

    sort(p+1,p+d+1);
    lli cnt=0,cnt2=1000000000;
 
    lli f=g;
    for(lli i=d;i>=1;i--)
    {
       if(f>=p[i].ss.ss.ff)
       {
         f-=p[i].ss.ss.ff;
         cnt+=p[i].ff.ss;
       }
 
       else
       {
          loopl(j,1,i+1)
          {
          	if(p[j].ss.ss.ff>=f)
          	{
          		if(p[j].ff.ss*100*p[j].ss.ss.ss > f)
          		{
          			if(f%(100*j)==0) 
          			{
          				cnt2 = min(cnt2,f/(100*j));
          			}
 
          			else
          			{
          				cnt2 = min(cnt2,f/(100*j) + 1) ;
          			}
          		}
          		else 
          		{
          			cnt2 = min(cnt2,a[j]); 
          		}
          	}
          }
          f=0;
       }
 
       if(f<=0) break;
    }
    if(cnt2 == 1000000000) cnt2=0;
    cout<<cnt<<" "<<cnt2<<endl;
    cout<<cnt2+cnt<<endl;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:78:49: error: 'a' was not declared in this scope
   78 |                                 cnt2 = min(cnt2,a[j]);
      |                                                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int d,g,min=10000000,ans=0;
	cin>>d>>g;
	int p[d],c[d];
	for (int i=1;i<=d;i++) 
	{
		cin>>p[i]>>c[i];
		ans=ans+p[i]*100+c[i];
	}
	for (int i=1;i<=d;i++)
	{
		for (int j=1;j<=d;j++)
		{
			if ((p[j]*100+c[j])/(p[j]>p[j-1]*100+c[j])/p[j-1])
			{
				int b,k;
				b=p[j];
				p[j]=p[j-1];
				p[j-1]=b;
				k=c[j];
				c[j]=c[j-1];
				c[j-1]=k;
			}
		}
	}
	for (int i=d;i<=1;i++)
	{
		ans=ans-p[j]*100-c[j];
		if (ans<g)
		{
			ans=ans+p[j]*100;
			if (ans<g)
			{
				ans=ans+c[j];
				continue;
			}
			else
			{
				int k=(g-ans)%100,m=(g-k-ans)/100;
				ans=ans-m;
				cout<<ans<<endl;
				return 0;
			}
		}
	}
	cout<<ans<<endl;
	return 0;
 } 

Compiler output:
a.cc: In function 'int main()':
a.cc:31:27: error: 'j' was not declared in this scope
   31 |                 ans=ans-p[j]*100-c[j];
      |                           ^
Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define N 100010
int d,g,c[N],p[N],ans=inf,vis[N];
void find(){
	int sum=0,ans1=0;
	for(int i=1;i<=d;i++){
		if(vis[i]){
			ans1+=c[i];
			sum+=p[i]+c[i]*100*i;
		}
	}
	if(sum>=g){
		ans=min(ans1,ans);return;
	}
	for(int i=d;i;i--){
		if(vis[i])continue;
		int t=c[i];
		while(t>1){
			t--;
			ans1++;
			sum+=100*i;
			if(sum>=g){
				ans=min(ans1,ans);
				return;
			}
		}
	}
}
void dfs(int x){
	if(x==d+1){find();return;}
	vis[x]=1;dfs(x+1);
	vis[x]=0;dfs(x+1);
}
int main(){
	scanf("%d%d",&d,&g);
	for(int i=1;i<=d;i++)
		scanf("%d%d",&c[i],&p[i]);
	dfs(1);
	printf("%d\n",ans);
}

Compiler output:
a.cc:6:23: error: 'inf' was not declared in this scope; did you mean 'int'?
    6 | int d,g,c[N],p[N],ans=inf,vis[N];
      |                       ^~~
      |                       int
a.cc: In function 'void find()':
a.cc:10:20: error: 'vis' was not declared in this scope
   10 |                 if(vis[i]){
      |                    ^~~
a.cc:19:20: error: 'vis' was not declared in this scope
   19 |                 if(vis[i])continue;
      |                    ^~~
a.cc: In function 'void dfs(int)':
a.cc:34:9: error: 'vis' was not declared in this scope
   34 |         vis[x]=1;dfs(x+1);
      |         ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

long long n , x ;
long long arr[12] , arr1[12] , arr2[12];

long long dp[11][100000][110] ;

long long ans = 1e18 ;

long long solve(long long idx , long long sum , long long step)
{
    if(idx > n)
        return (1e18);
    if(sum >= x)
     return step ;
    long long &ret = dp[idx][step] ;
    if(ret != -1)
        return ret;
    ret = solve(idx+1 , sum , step);
    for(long long i = 0 ; i < arr[idx]-1 ; ++i)
        ret = min(ret , solve(idx+1 , sum + (i+1) * arr2[idx] , step+i+1)) ;
    ret = min(ret , solve(idx+1 , sum + (arr[idx] * arr2[idx]) + arr1[idx] , step + arr[idx]));
    return ret ;
}

int main()
{
    memset(dp , -1 , sizeof(dp));
    cin>>n>>x ;
    for(long long i = 0 ; i < n ; ++i)
    {
        cin>>arr[i]>>arr1[i] ;
        arr2[i] = (i+1) * 100 ;
    }
    cout<<solve(0 , 0 , 0);
    return 0 ;
}


Compiler output:
a.cc: In function 'long long int solve(long long int, long long int, long long int)':
a.cc:18:34: error: invalid conversion from 'long long int*' to 'long long int' [-fpermissive]
   18 |     long long &ret = dp[idx][step] ;
      |                      ~~~~~~~~~~~~^
      |                                  |
      |                                  long long int*
a.cc:18:34: error: cannot bind rvalue '(long long int)((long long int*)(& dp[idx][step]))' to 'long long int&'