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

#include <bits/stdc++.h>
#define REP(i,s,e) for(int i=(s); i<(e);i++)
#define rep(i,n) REP(i,0,n)
#define rep1(i,n) REP(i,1,n)
#define repe(i,n) for(auto &&i:n)
#define all(v) (v).begin(),(v).end()
#define decimal fixed<<setprecision(20)
#define fastcin() cin.tie(0);ios::sync_with_stdio(false)
using namespace std;
using LL = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int main(){
    int D, G;
    cin >> D >> G;
    vector<int> p(D), c(D);
    for(int i=0; i<D; i++){
        cin >> p[i] >> c[i];
    }
    int ans = INF;
    for(int s=0; s<(1<<D); s++){
        int solve = 0, score = 0;
        int partial = -1;
        for(int i=0; i<D; i++){
            // i番目のセットをすべて解く
            if(s & (1<<i)){
                solve += p[i];
                score += 100*(i+1)*p[i] + c[i];
            }else{
                // 余ったセットで最高点のもの
                partial = i;
            }
        }
        // G点に達するまで問題を解く
        int less = G-score;
        if(less > 0){
            int prob_score = 100*(partial+1)    // 1問の点数
            // 解き切っても足りないなら、その組み合わせは不適
            if(less > prob_score*p[partial]) continue;
            // floor(less/(1問あたりの点数)) と等価
            solve += min(p[partial], (less+(prob_score-1))/prob_score;
        }
        ans = min(ans, solve);
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:15: error: 'INF' was not declared in this scope
   20 |     int ans = INF;
      |               ^~~
a.cc:39:13: error: expected ',' or ';' before 'if'
   39 |             if(less > prob_score*p[partial]) continue;
      |             ^~
a.cc:41:70: error: expected ')' before ';' token
   41 |             solve += min(p[partial], (less+(prob_score-1))/prob_score;
      |                         ~                                            ^
      |                                                                      )
Language: C++

// ConsoleApplication5.cpp : Defines the entry polong long for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
//#include <bits/stdc++.h>
using namespace std;

//探索済みかどうかの確認

bool IsUnchecked(vector<vector<int>> vec, int kind)
{
    // 計算済みのマーク
    if (vec.at(kind).at(2) == 1)
    {
        return false;
    }
    return true;
}

// 最初に解く種類を指定した場合の最小回数を計算
long long ReFunc(vector<vector<int>> vec,
    int  kind,       //種別
    long long score,      //目標スコア
    long long tempScore,  //計算中のスコア
    long long tempCount,  //計算中のカウント
    long long minCount)   //最小カウント

{
    //最初にkindごとに全てループする
    for (int i = 0; i < vec.at(kind).at(0); i++)
    {
        tempScore += (kind+1) * 100;
        tempCount++;
        if (tempScore >= score)
        {
            return tempCount;
        }
    }
    tempScore += vec.at(kind).at(1);
    if (tempScore >= score)
    {
        return tempCount;
    }

    // 計算済みのマーク
    vec.at(kind).at(2) = 1;


    //目標スコアに届かなかった場合の処理
    for (int i = 0; i < vec.size(); i++)
    {
        if (IsUnchecked(vec, i))
        {
            minCount = min(minCount, ReFunc(vec, i, score, tempScore, tempCount, minCount));
        }
    }
    return minCount;
}


int main()
{
    int D, G;
    cin >> D >> G;
    vector<vector<int>> vec(D, vector<int>(3, 0));
    for (int  i = 0; i < D; i++)
    {
        for (int  j = 0; j < 2; j++)
        {
            cin >> vec.at(i).at(j);
        }
    }
    
    long long answer = INT64_MAX;
    for (int  i = 0; i < D; i++)
    {
        answer = min(answer, ReFunc(vec, i, G, 0, 0, INT64_MAX));
    }
   
    cout << answer << endl;
}



Compiler output:
a.cc:4:10: fatal error: stdafx.h: No such file or directory
    4 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<deque>
#include<algorithm>
#include<math.h>
#include<string>
using namespace std;
int main() {
	int n, g, ans2 = INT_MAX, sum, ans1;
	cin >> n >> g;
	deque<pair<int, int>>d(n);
	for (int i = 0; i < n; i++)
		cin >> d[i].first >> d[i].second;

	for (int v = 0; v < n; v++) {
		 sum = 0, ans1 = 0;
		for (int i = n - 1; i >= 0; i--) {
			for (int t = 0; t < d[i].first; t++) {
				sum += (i + 1) * 100;
				ans1++;
				if (t == d[i].first - 1)sum += d[i].second;
				if (sum >= g)break;
			}
			if (sum >= g) {
				ans2 = min(ans1, ans2);
				ans1 = 0;
				sum = 0;
			}
		}
		if (sum >= g) {
			ans2 = min(ans1, ans2);
		}
	}

	cout << ans2 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: 'INT_MAX' was not declared in this scope
    8 |         int n, g, ans2 = INT_MAX, sum, ans1;
      |                          ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include<math.h>
  +++ |+#include <climits>
    5 | #include<string>
a.cc:15:18: error: 'sum' was not declared in this scope
   15 |                  sum = 0, ans1 = 0;
      |                  ^~~
a.cc:15:27: error: 'ans1' was not declared in this scope; did you mean 'ans2'?
   15 |                  sum = 0, ans1 = 0;
      |                           ^~~~
      |                           ans2
Language: C++

#include <iostream>
using namespace std;

int main() {
    int D, G, P[10], C[10];
    cin >> D >> G;
    for(int i=0; i<D; i++) {
        cin >> P[i] >> C[i]l
    } 

    int ans = 1e9;
    for(int i=0; i<(i<<D); i++) {
        int s = 0; num = 0; rest_max = -1;
        for(int j=0; j<D; j++) {
            if( (i>>j) &1) {
                s += P[j] * 100 * j + C[j];
                num += P[j];
            } else {
                max = j;
            }
        }

        if(s<G) {
            int s1 = (max + 1) * 100;
            int shortage = (G - s + s1 -1) / s1;
            if(shortage >= P[rest_max]) {
                continue;
            }
            num += shortage;
        }
        ans = min(ans, num);
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:28: error: expected ';' before 'l'
    8 |         cin >> P[i] >> C[i]l
      |                            ^
      |                            ;
a.cc:13:20: error: 'num' was not declared in this scope; did you mean 'enum'?
   13 |         int s = 0; num = 0; rest_max = -1;
      |                    ^~~
      |                    enum
a.cc:13:29: error: 'rest_max' was not declared in this scope
   13 |         int s = 0; num = 0; rest_max = -1;
      |                             ^~~~~~~~
a.cc:19:23: error: overloaded function with no contextual type information
   19 |                 max = j;
      |                       ^
a.cc:24:27: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   24 |             int s1 = (max + 1) * 100;
      |                       ~~~~^~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
#include<math.h>
using namespace std;
#define INF 110000000000
#define MOD 1000000007
typedef long long ll;
typedef pair<ll,int> P;

int D,G,p[11],c[11]

int main(){
  cin>>D>>G;

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

  int ans=1e9;

  for(int bit=0;bit< (1<<D); bit++){
    int s=0,num=0,rest_max=-1;
    for(int i=0;i<D;i++){
      if(bit>>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;
      else{
        num+=need;
        ans=min(ans,num);
      }
    }
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc:17:1: error: expected initializer before 'int'
   17 | int main(){
      | ^~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
#include<math.h>
using namespace std;
#define INF 110000000000
#define MOD 1000000007
typedef long long ll;
typedef pair<ll,int> P;

int D,G,p[11],c[11]

int main(){
  cin>>D>>G;

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

  int ans=1e9;

  for(int bit=0;bit< (1<<n); bit++){
    int s=0,num=0,rest_max=-1;
    for(int i=0;i<D;i++){
      if(bit>>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;
      else{
        num+=need
        ans=min(ans,num);
      }
    }
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc:17:1: error: expected initializer before 'int'
   17 | int main(){
      | ^~~
Language: C++

#include <bits/stdc++.h>

#define mod 1000000007

using namespace std;
typedef long long ll; 
 
int main(void){
	
	int D, count = 1e9;
	ll G;
	
	cin >> D >> G;
	
	int p[D];
	ll c[D];
	
	for(int i=0; i<D; i++)
		cin >> p[i] >> c[i];
	
	for(int i=0; i < (1<<D); i++){
		ll s = 0, num = 0, rest_max = -1;
		for(int j=0; j<D; j++){
			if(i >> j & 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 - 99) / s1;
			if(need >= p[rest_max])
				continue;
			num += need;
		}
		count = min(count, num);
	}
	
	cout << count;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:37: error: 'g' was not declared in this scope
   32 |                         int need = (g - s + s1 - 99) / s1;
      |                                     ^
a.cc:37:28: error: no matching function for call to 'min(int&, ll&)'
   37 |                 count = min(count, num);
      |                         ~~~^~~~~~~~~~~~
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:37:28: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   37 |                 count = min(count, num);
      |                         ~~~^~~~~~~~~~~~
/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:37:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   37 |                 count = min(count, num);
      |                         ~~~^~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
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 bit = 0; bit < (1<<D);++bit){
        int s = 0, num = 0, rest_max = -1;
        for(int i = 0; i < D; ++i){
            if((bit >> 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(ams,num);
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:19: error: 'ams' was not declared in this scope; did you mean 'ans'?
   32 |         ans = min(ams,num);
      |                   ^~~
      |                   ans
Language: C++

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

int main(){
  ll D, G;
  cin >> D >> G;
  ll p[D], c[D];
  for(int i = 0; i < D; i++){
   cin >> p[i] >> c[i];
  }
  ll e[D];
  for(int i = 0; i < D; i++){//効率入力
    e[D] = (100*(i+1)*p[i]+c[i])/p[i];
  }
  int frag = 1;
  int ans = 0;
  ll sub = 0;
  ll sum = 0;
  int temp;
  while(frag){
    for(int i = D-1; i >= 0; i--){//max調べる
      if(e[i] > 0){
        temp = i;
      }
    }
    if(G <= sum + (temp+1)*100*p[temp]){
      for(int j = 0; j < p[temp]; j++){
        sub++;
        sum += (temp+1)*100;
        if(sum >= G){
          frag = 0;
          break;
        }
      }
    }
    temp = 0;
    for(int i = 0; i < D; i++){//max効率調べる
      if(e[temp] < e[i]){
      temp = i;
      }
    }
    if(G <= sum + (temp+1)*100*p[temp]){
      ans+=min(sub,p[temp]);
    }
    else{
      temp = 0;
      for(int i = 0; i < D; i++){//max効率調べる
        if(e[temp] < e[i]){
          temp = i;
        }
      }
      sum += (i+1)*100*p[temp];
      ans += p[temp];
      e[temp] = 0;
    }
  }
  cout << ans << endl;
}


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

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

int D,G;

int dfs(vector<int> p(D), vector<int> c(D), int sum, int count){
  int min = 1001;
  if(sum>=G){
    if(min>count){
      min = count;
    }
  }
  else{
    for(int i = 0; i < D; i++){
      if(p[i]>0){
        p[i] -=  1;
        sum += (i+1)*100;
        if(p[i] == 0){
          sum += c[i];
        }
      }
      dfs(p,c,sum,count+1);
    }
  }
  return min;
}

int main(){
  cin >> D >> G;
  vector<int> p(D);
  vector<int> c(D);
  for(int i = 0; i < D; i++){
    cin >> p[i] >> c[i];
  }
  cout << dfs(p,c,0,0) << endl;
}

Compiler output:
a.cc:6:22: error: expected ',' or '...' before '(' token
    6 | int dfs(vector<int> p(D), vector<int> c(D), int sum, int count){
      |                      ^
a.cc: In function 'int dfs(std::vector<int>)':
a.cc:8:6: error: 'sum' was not declared in this scope
    8 |   if(sum>=G){
      |      ^~~
a.cc:9:11: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>'
    9 |     if(min>count){
      |        ~~~^~~~~~
a.cc:10:13: error: cannot resolve overloaded function 'count' based on conversion to type 'int'
   10 |       min = count;
      |             ^~~~~
a.cc:19:18: error: 'c' was not declared in this scope
   19 |           sum += c[i];
      |                  ^
a.cc:22:13: error: 'c' was not declared in this scope
   22 |       dfs(p,c,sum,count+1);
      |             ^
a.cc:22:24: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   22 |       dfs(p,c,sum,count+1);
      |                   ~~~~~^~
a.cc: In function 'int main()':
a.cc:35:14: error: too many arguments to function 'int dfs(std::vector<int>)'
   35 |   cout << dfs(p,c,0,0) << endl;
      |           ~~~^~~~~~~~~
a.cc:6:5: note: declared here
    6 | int dfs(vector<int> p(D), vector<int> c(D), int sum, int count){
      |     ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <numeric>
#include <vector>
#include <queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long int
#define ii pair<int,int>
#define MAX 1000000007

using namespace std;

int d,g;
int p[11],c[11],all[11];
bool flag[11];
int ans=MAX;

void check(){
	//cout<<"check start"<<endl;
	ll tmp=0,num=0;
	rep(i,d){
		if(flag[i]){
			tmp+=all[i];
			num+=p[i];
			//cout<<"complete:"<<i+1<<endl;
		}
	}
	//cout<<"score:"<<tmp<<endl;
	//cout<<"num:"<<num<<endl;
	for(int i=d-1;i>-1;i--){
		if(tmp >= g)break;
		if(!flag[i]){
			if(g-tmp <= p[i]*(i+1)*100){
				num+=(g-tmp)/((i+1)*100);
				tmp=g;
				break;
			}	
		}
	}
	//cout<<"result num:"<<num<<endl;
	if(tmp >= g && ans > num)ans=num;
}
void func(int id){
	if(id==d){
		check();
		return;
	}
	flag[id]=false;
	func(id+1);
	flag[id]=true;
	func(id+1);

}

int main(void){
	cin>>d>>g;
	
	rep(i,d){
		int c;
		cin>>p[i]>>c[i];
		flag[i]=false;
		all[i]=p[i]*100*(i+1)+c[i];
	}
	func(0);
	cout<<ans<<endl;
	return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:61:29: error: invalid types 'int[int]' for array subscript
   61 |                 cin>>p[i]>>c[i];
      |                             ^
a.cc:63:40: error: invalid types 'int[int]' for array subscript
   63 |                 all[i]=p[i]*100*(i+1)+c[i];
      |                                        ^
Language: C++

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

using namespace std;
using Int = long long;

Int INF = 1LL << 60;

int main() {
	Int D, G;
	cin >> D >> G;

	vector<Int> p(D);
	vector<Int> c(D);

	for (Int i = 0; i < D; i++)cin >> p[i] >> c[i];
	
	Int ans = INF;
	for (Int bit = 0; bit < (1LL << D); bit++) {
		Int sum = 0;
		Int num = 0;

		for (Int i = 0; i < D; i++) {
			if (bit & (1LL << i)) {
				sum += p[i] * 100 * (i + 1) + c[i];
				num += p[i];
			}
		}

		if (sum >= G)ans = min(ans, num);
		else {
			for (Int i = D - 1; i > =0; i--) {
				if (bit & (1LL << i))continue;
				for (Int j = 0; j < p[i]; j++) {
					if (sum >= G)break;
					sum += 100 * (i + 1);
					num++;
				}
			}
			ans = min(ans, num);
		}

	}

	cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:49: error: expected primary-expression before '=' token
   34 |                         for (Int i = D - 1; i > =0; i--) {
      |                                                 ^
Language: C++

//  Created by liszt on 2019/07/26. 自信ない
#include<bits/stdc++.h>
using namespace std;

int main(){
    int d,g,i; cin>>d >>g;
    vector<pair<pair<int,int>,int>> pc(d);
    
    for(i=0;i<d;i++){
        cin>>pc[i].first.first >>pc[i].first.second;
        pc[i].second=(100*(i+1))*pc[i].first.first+pc[i].first.second;
    }
    
    sort(pc.second.begin(),pc.second.end());
    
    int sum=g,ans=0;
    i=0;
    while(sum>0){
        if(sum>pc[i].second-pc[i].first.second){
            ans+=pc[i].first.first;
            sum-=pc[i].second;
            i++;
        }else{
            ans++;
            sum-=100*(i+1);
        }
    }
    
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 'class std::vector<std::pair<std::pair<int, int>, int> >' has no member named 'second'
   14 |     sort(pc.second.begin(),pc.second.end());
      |             ^~~~~~
a.cc:14:31: error: 'class std::vector<std::pair<std::pair<int, int>, int> >' has no member named 'second'
   14 |     sort(pc.second.begin(),pc.second.end());
      |                               ^~~~~~
Language: C++

//  Created by liszt on 2019/07/26. 自信ない
#include<bits/stdc++.h>
using namespace std;

int main(){
    int d,g,i; cin>>d >>g;
    vector<pair<pair<int,int>,int>> pc(d);
    
    for(i=0;i<d;i++){
        cin>>pc[i].first.first >>pc[i].first.second;
        pc[i].second=(100*(i+1))*pc[i].first.first+pc[i].first.second;
    }
    
    sort(pc.second,pc.second+d);
    
    int sum=g,ans=0;
    i=0;
    while(sum>0){
        if(sum>pc[i].second-pc[i].first.second){
            ans+=pc[i].first.first;
            sum-=pc[i].second;
            i++;
        }else{
            ans++;
            sum-=100*(i+1);
        }
    }
    
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 'class std::vector<std::pair<std::pair<int, int>, int> >' has no member named 'second'
   14 |     sort(pc.second,pc.second+d);
      |             ^~~~~~
a.cc:14:23: error: 'class std::vector<std::pair<std::pair<int, int>, int> >' has no member named 'second'
   14 |     sort(pc.second,pc.second+d);
      |                       ^~~~~~
Language: C++

#include "SaveFuncs.cpp"

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <iomanip>	//cout << fixed << setprecision(桁数);
#include <stdexcept>

#define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; i++)
#define rep1(i, n) for(int i=1, i##_len=(n); i<i##_len; i++)
#define rrep(i, n) for(int i=(n)-1; i >= 0; i--)
#define rrep1(i, n) for(int i=(n); i > 0; i--)
#define all(x) (x).begin(), (x).end()
#define pair(a, b) make_pair(a, b);
using namespace std;
using ll = long long;
//#define int long long
template<class T> bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
string strMulti(string t, int n) { string out = ""; for (int i = 0; i < n; i++) { out += t; } return out; }
constexpr int INF = 2e9;

/*****/

ll D, G;
vector<pair<int, int>> q;
int minEndDeep;

//map<vector<int>, int> qtime_memo;

// 最小回数を返す
int ret(int deep, ll point, vector<int> qtime, int addHead)
{
	/*
	debug_cout(point);
	rep(i, D)
	{
		debug_tabHeadCout(1, i, qtime.at(i));
	}
	debug_tabCout(1, addHead);
	//*/

	if (deep >= minEndDeep)
	{
		return INF;
	}

	if (point >= G)
	{
		return 0;
	}

	/*
	if (qtime_memo[qtime] != 0)
	{
		//cout << '\t' <<  "know" << endl;
		return qtime_memo[qtime];
	}
	//*/

	int min = INF;
	for (int i = D - 1; i >= addHead; i--)
	{
		if (qtime.at(i) >= q.at(i).first)
		{
			continue;
		}

		ll npoint = point + 100 * (i + 1);
		vector<int> nqtime(qtime);
		nqtime.at(i)++;
		if (nqtime.at(i) == q.at(i).first)
		{
			npoint += q.at(i).second;
		}

		if (point >= G)
		{

			return 1;
		}
		else
		{
			chmin(min, ret(deep + 1, npoint, nqtime, i));
		}
	}

	//qtime_memo[qtime] = min + 1;

	return min + 1;
}

void Main()
{
	minEndDeep = INF;

	cin >> D >> G;
	q.resize(D, make_pair(0, 0));

	rep(i, D)
	{
		int p, c;
		cin >> p >> c;
		q.at(i) = make_pair(p, c);
	}

	cout << ret(0, 0, vector<int>(D), 0) << endl;
}

/*****/

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

	Main();

	return 0;
}


Compiler output:
a.cc:1:10: fatal error: SaveFuncs.cpp: No such file or directory
    1 | #include "SaveFuncs.cpp"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>

using namespace std;


/* define */
#define Yes(X) puts ( (X) ? "Yes" : "No")
#define YES(X) puts ( (X) ? "YES" : "NO")
#define FOR(i, a, b) for ( int i = (a); i < (b) ; i++)
#define REP(i, n) for ( int i = 0; i < (n) ; i++)
#define max(a, b) (((a) > (b)) ? (a) : (b))
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define max3(a, b, c) ((max((a), (b)) > (c)) ? max((a), (b)) : (c))
#define min3(a, b, c) ((min((a), (b)) < (c)) ? min((a), (b)) : (c))

/* const */
const int MOD = 1000000007;

/* alias */
typedef long long ll;
typedef unsigned  u;

/* function */
int cmp(const void *a, const void *b) {
	return *(int*)a - *(int*)b;
}
int cmp2(const void *a, const void *b) {
	return *(int*)b - *(int*)a;
}
int gcd(int a, int b) {
	if (b != 0)return gcd(b, a % b);
	return a;
}
ll Lgcd(ll a, ll b) {
	if (b != 0) return Lgcd(b, a % b);
	return a;
}
int lcm(int a, int b) {
	return a / gcd(a, b) * b;
}
ll Llcm(ll a, ll b) {
	return a / Lgcd(a, b) * b;
}

/* main */

int main() {
	int d, g, p[10], c[10], ans = (int)1e9;
	cin >> d >> g;
	REP(i, d) cin >> p[i] >> c[i];
	REP(i, 1 << d) {
		int s = 0, num = 0, max = 0;
		REP(j, d) {
			if (i >> j & 1) {
				s += 100 * (j + 1) * p[j] + c[j];
				num += p[j];
			}
			else max = j;
		}
		if (s < g) {
			int s1 = 100 * (max + 1);
			int need = (g - s + s1 - 1) / s1;
			if (need < p[max]) {
				num += need;
				s += s1 * need;
			}
		}
		if (s >= g) ans = min(ans, num);
	}
	cout << ans << endl;
	return 0;
}

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

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

int main () {
  int D, G;
  cin >> D >> G;
  G /= 100;
  vector<int> p(D), c(D);
  rep(i,D) {
    cin >> p[i] >> c[i];
    c[i] /= 100;
  }

  int ans = 1000;

  for(int i = 0; i < (1<<D); i++) {
    int s = 0;
    int cnt = 0;
    int l = 0;
    for(int j = 0; j < D; j++) {
      if((i >> j) & 1) {
        s += (j+1)*p[j] + c[j];
        cnt += p[j];
      } else {
        l = j;
      }
    }
    if(s < G) {
      int k = (G - s + (l+1) - 1) / (l+1);
      if(k >= p[j]) continue;
      s += k * (j+1);
      cnt += k;
    }

    ans = min(ans, cnt);
  }

  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:17: error: 'j' was not declared in this scope
   32 |       if(k >= p[j]) continue;
      |                 ^
a.cc:33:17: error: 'j' was not declared in this scope
   33 |       s += k * (j+1);
      |                 ^
Language: C++

include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll G;
const int MAX=10;
int D=MAX;

vector<ll>p(D);
vector<ll>c(D);

ll dfs(ll i,ll j,ll sum,ll d){
  
  if(sum>=G){
   return d-1;
  }
  int chk=0;
    for(int k=0;k<=j;k++){
    if(k==j&&chk==0){
  
  ll m=dfs(i,j+1,sum+i*100,d+1);
    return m;
      break;
    }
  
 
 else if(j==p[k]&&i*100*j< p[k]*100*i+c[k]){
  chk++;
  ll n=dfs(i-1,1,p[k]*100*i+c[k],d+1);
    return n;
   break;
  }
  else if(j==p[k]&&i*100*j>=p[k]*100*i+c[k]){
    chk++;
    ll l=dfs(i,j+1,sum+100*i*j,d+1);
    return l;
    break;
    }
 
    }
}



  int main(){
    
    cin>>D>>G;
    
    for(ll i=0;i<D;i++){
      cin>>p[i]>>c[i];
    }
    
  ll ans=dfs(D,1,0,1);
    
    cout<<ans<<endl;
   
  }
  

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc:8:1: error: 'vector' does not name a type
    8 | vector<ll>p(D);
      | ^~~~~~
a.cc:9:1: error: 'vector' does not name a type
    9 | vector<ll>c(D);
      | ^~~~~~
a.cc: In function 'll dfs(ll, ll, ll, ll)':
a.cc:26:13: error: 'p' was not declared in this scope
   26 |  else if(j==p[k]&&i*100*j< p[k]*100*i+c[k]){
      |             ^
a.cc:26:39: error: 'c' was not declared in this scope
   26 |  else if(j==p[k]&&i*100*j< p[k]*100*i+c[k]){
      |                                       ^
a.cc: In function 'int main()':
a.cc:46:5: error: 'cin' was not declared in this scope
   46 |     cin>>D>>G;
      |     ^~~
a.cc:49:12: error: 'p' was not declared in this scope
   49 |       cin>>p[i]>>c[i];
      |            ^
a.cc:49:18: error: 'c' was not declared in this scope
   49 |       cin>>p[i]>>c[i];
      |                  ^
a.cc:54:5: error: 'cout' was not declared in this scope
   54 |     cout<<ans<<endl;
      |     ^~~~
a.cc:54:16: error: 'endl' was not declared in this scope
   54 |     cout<<ans<<endl;
      |                ^~~~
a.cc: In function 'll dfs(ll, ll, ll, ll)':
a.cc:40:1: warning: control reaches end of non-void function [-Wreturn-type]
   40 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
  
  int D,G;
cin>>D>>G;

vector<int>p(D);
vector<int>c(D);
vector<int>sum(D);
int cnt=0;

for(int i=0;i<D;i++){
  cin>>p[i]>>c[i];
  sum[i]=(i+1)*100*p[i]+c[i];
  cnt+=p[i];
  
}
int max=0;
int ans=0;
for(int i=0;i<cnt;i++){
  
  for(int j=0;j<D;j++){
    if(i+1==p[j]){
      if(sum[j]>
      
    
  

Compiler output:
a.cc:5:3: error: expected initializer before 'int'
    5 |   int D,G;
      |   ^~~
a.cc:6:1: error: 'cin' does not name a type
    6 | cin>>D>>G;
      | ^~~
a.cc:8:14: error: 'D' was not declared in this scope
    8 | vector<int>p(D);
      |              ^
a.cc:9:14: error: 'D' was not declared in this scope
    9 | vector<int>c(D);
      |              ^
a.cc:10:16: error: 'D' was not declared in this scope
   10 | vector<int>sum(D);
      |                ^
a.cc:13:1: error: expected unqualified-id before 'for'
   13 | for(int i=0;i<D;i++){
      | ^~~
a.cc:13:13: error: 'i' does not name a type
   13 | for(int i=0;i<D;i++){
      |             ^
a.cc:13:17: error: 'i' does not name a type
   13 | for(int i=0;i<D;i++){
      |                 ^
a.cc:21:1: error: expected unqualified-id before 'for'
   21 | for(int i=0;i<cnt;i++){
      | ^~~
a.cc:21:13: error: 'i' does not name a type
   21 | for(int i=0;i<cnt;i++){
      |             ^
a.cc:21:19: error: 'i' does not name a type
   21 | for(int i=0;i<cnt;i++){
      |                   ^
Language: C++

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

int main()
{
  int d, g;
  cin >> d >> g;
  vector<int> p(d), c(d);
  for (int i = 0; i < d; i++) cin >> p.at(i) >> c.at(i);
  int minproblems = 1 << 30;
  for (int i = 0; i < 1 << d; i++) {
    int highest = 0;
    for (int j = d - 1; j >= 0; j--) {
      if ((i >> j) % 2 == 0) {
        highest = (j + 1) * 100;
        break;
      }
    }
    int score = 0, problems = 0;
    for (int j = 0; j < d; j++) {
      if ((i >> j) % 2 == 1) {
        score += p.at(j) * (j + 1) * 100 + c.at(j);
        problems += p.at(j);
      }
    }
    if (g - score > 0 && g - score <= highest * p.at(highest / 100 - 1)) {
      problems += (g - score + highest - 1) / highest;
      score = g;
    }
    if (g - score <= 0 && problems < min_problems) {
      min_problems = problems;
    }
  }
  cout << min_problems << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:38: error: 'min_problems' was not declared in this scope; did you mean 'minproblems'?
   30 |     if (g - score <= 0 && problems < min_problems) {
      |                                      ^~~~~~~~~~~~
      |                                      minproblems
a.cc:34:11: error: 'min_problems' was not declared in this scope; did you mean 'minproblems'?
   34 |   cout << min_problems << endl;
      |           ^~~~~~~~~~~~
      |           minproblems
Language: C++

D, G = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(D)]
ans = 100 ** 11
for i in range(2**D):
    score = 0
    count = 0
    bit = format(i, 'b').zfill(D)
    for j, b in enumerate(bit):
        if int(b):
            score += pc[j][0] * (100 * (j+1)) + pc[j][1]
            count += pc[j][0]
    if score < G:
      	for j in range(D-1, -1, -1):
            if not int(bit[j]):
                for k in range(pc[j][0]-1):
                    if score >= G:
                        break
                    score += 100 * (j+1)
                    count += 1
    
    if score >= G:
	    ans = min(ans, count)
    
print(ans)

Compiler output:
a.cc:1:1: error: 'D' does not name a type
    1 | D, G = map(int, input().split())
      | ^
Language: C++

int D, G, P[10], C[10];
int dp[11][401010];
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> D >> G;
    rep(i, 0, D) cin >> P[i] >> C[i];
 
    G /= 100;
    rep(i, 0, D) C[i] /= 100;
 
    rep(i, 0, D + 1) rep(point, 0, 201010) dp[i][point] = inf;
    dp[0][0] = 0;
 
    rep(i, 0, D) rep(point, 0, 201010) {
        rep(j, 0, P[i]) chmin(dp[i + 1][point + (i + 1)*j], dp[i][point] + j);
        chmin(dp[i + 1][point + (i + 1)*P[i] + C[i]], dp[i][point] + P[i]);
    }
 
    int ans = inf;
    rep(point, G, 201010) chmin(ans, dp[D][point]);
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'void _main()':
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     cin >> D >> G;
      |     ^~~
a.cc:6:9: error: 'i' was not declared in this scope
    6 |     rep(i, 0, D) cin >> P[i] >> C[i];
      |         ^
a.cc:6:5: error: 'rep' was not declared in this scope
    6 |     rep(i, 0, D) cin >> P[i] >> C[i];
      |     ^~~
a.cc:19:15: error: 'inf' was not declared in this scope; did you mean 'int'?
   19 |     int ans = inf;
      |               ^~~
      |               int
a.cc:20:9: error: 'point' was not declared in this scope; did you mean 'int'?
   20 |     rep(point, G, 201010) chmin(ans, dp[D][point]);
      |         ^~~~~
      |         int
a.cc:21:5: error: 'cout' was not declared in this scope
   21 |     cout << ans << endl;
      |     ^~~~
a.cc:21:20: error: 'endl' was not declared in this scope
   21 |     cout << ans << endl;
      |                    ^~~~
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<cstdio>
#include<cstdlib>
using namespace std;


using ll = long long int;

/// <summary>
/// GCDを計算します
/// </summary>
template <typename NumType>
NumType calcGCD(NumType a, NumType b) {
	if (a < b) {
		NumType tmp = a;
		a = b;
		b = tmp;
	}

	NumType r = a % b;
	while (r != 0) {
		a = b;
		b = r;
		r = a % b;
	}

	return b;
}

/// <summary>
/// 約数を数えます
/// </summary>
template <typename NumType>
NumType cntDivisor(const NumType& num) {
	NumType cnt = 0;
	for (NumType i = 1; i * i <= num; ++i) {
		if (num % i == 0) {
			cnt++;
			if (i * i != num) cnt++;
		}
	}

	return cnt;
}

/// <summary>
/// [beg, end)の範囲を，添え字indexでループするfor文に置換します
/// </summary>
#define FOR_RANGE(index, beg, end)     for (ll index = beg; index < end; ++index)

#define DEBUG(x)     std::cout << #x << " : " << x << "\n"





int main() {
	// 入出力を早くするための魔法の言葉
	cin.tie(0);ios::sync_with_stdio(false);


	ll D, G;
	cin >> D >> G;

	vector<pair<ll, ll>> score(D);

	for (ll i = 0; i < D; i++) {
		cin >> score[i].first >> score[i].second;
	}

	vector<ll> ans;

	for (ll i = 0; i < score.size(); i++) {
		if (100 * (i + 1) * score[i].first + score[i].second >= G) {
			ans.emplace_back(score[i].first);
		}
	}

	for (ll i = 0; i < score.size(); i++) {
		for (ll j = 1; j < score[i].first; j++) {
			if (100 * (i + 1) * j >= G) {
				ans.emplace_back(j);
			}
		}
	}

	if (ans.size() != 0) {
		sort(ans.begin(), ans.end());
		cout << ans[0] << endl;
		return 0;
	}

	ll hoge = 100 * score.size() * score.back().first + score.back().second;
	ll hogehoge = score.back().first;
	for (ll i = score.size() - 2; i >= 0; i--) {
		for (ll j = 1; j <= score[i].first; j++) {
			if (hoge + 100 * (i + 1) * j >= G) {
				ans.emplace_back(j + hogehoge);
			}
			if (j == score[i].first) {
				hoge += 100 * (i + 1) * j + score[i].second;
				hogehoge += j;
			}
		}
	}

	sort(ans.begin(), ans.end());

	if (ans.size == 0) {
		cout << 0 << endl;
		return 0;
	}

	cout << ans[0] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:113:17: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = long long int; _Alloc = std::allocator<long long int>; size_type = long unsigned int]' (did you forget the '()' ?)
  113 |         if (ans.size == 0) {
      |             ~~~~^~~~
      |                     ()
Language: C++

int D;
long long G;
vector<long long> p, c;

int main() {
  cin >> D >> G;
  p.resize(D); c.resize(D);
  for (int i = 0; i < D; ++i) cin >> p[i] >> c[i];

  long long res = 1<<29;
  for (int bit = 0; bit < (1<<D); ++bit) {
    long long sum = 0;
    long long num = 0;
    for (int i = 0; i < D; ++i) {
      if (bit & (1<<i)) sum += c[i] + p[i] * 100 * (i+1), num += p[i];
    }
    if (sum >= G) res = min(res, num);
    else {
      for (int i = D-1; i >= 0; --i) {
        if (bit & (1<<i)) continue;
        for (int j = 0; j < p[i]; ++j) {
          if (sum >= G) break;
          sum += 100 * (i+1);
          ++num;
        }
      }
      res = min(res, num);
    }
  }
  cout << res << endl;
}

Compiler output:
a.cc:3:1: error: 'vector' does not name a type
    3 | vector<long long> p, c;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> D >> G;
      |   ^~~
a.cc:7:3: error: 'p' was not declared in this scope
    7 |   p.resize(D); c.resize(D);
      |   ^
a.cc:7:16: error: 'c' was not declared in this scope
    7 |   p.resize(D); c.resize(D);
      |                ^
a.cc:17:25: error: 'min' was not declared in this scope; did you mean 'main'?
   17 |     if (sum >= G) res = min(res, num);
      |                         ^~~
      |                         main
a.cc:27:13: error: 'min' was not declared in this scope; did you mean 'main'?
   27 |       res = min(res, num);
      |             ^~~
      |             main
a.cc:30:3: error: 'cout' was not declared in this scope
   30 |   cout << res << endl;
      |   ^~~~
a.cc:30:18: error: 'endl' was not declared in this scope
   30 |   cout << res << endl;
      |                  ^~~~
Language: C++

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

typedef long long ll;
const ll InF = 1e15;
// ll mod = 1000000007;

int solve(int i, int a, int b) {
  return min(a, (b - 100) / (100 * i) + 1 );
}

int main() {
  ll d,g;
  cin>>d>>g;
  vector<pair<int,ll>> ps(11);
  for (int i = 1; i <= d; i++) cin>>ps[i].first>>ps[i].second;
  int ans = 1e9 + 1;
  for (int i = 1; i <= d; i++) {
    ll res,tmp;
    res = solve(i, ps[i].first, g);
    if (res == ps[i].first) {
      tmp =  100 * i * ps[i].first + ps[i].second;
      int cnt = d;
      while (g - tmp > 0) {
        if (cnt == i) {
          cnt--;
          continue;
        }
        int res1 = solve(cnt, ps[cnt].first, g - tmp);
        res += res1;
        tmp += res1 * 100 * cnt;
        if (res1 == ps[cnt].first) tmp += ps[cnt].second;
        cnt--;
      }
    }
    ans = min(res,ans);
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:14: error: no matching function for call to 'min(ll&, int&)'
   36 |     ans = min(res,ans);
      |           ~~~^~~~~~~~~
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:36:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   36 |     ans = min(res,ans);
      |           ~~~^~~~~~~~~
/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:36:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   36 |     ans = min(res,ans);
      |           ~~~^~~~~~~~~
Language: C++

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

int main() {
    ll d, g; cin >> d >> g;
    g /= 100;
    vector<int> p(d), c(d);
    rep (i, d) {
        cin >> p[i] >> c[i];
        c[i] /= 100;
    }

    ll ans = INT_MAX;
    rep (i, (1<<d)) {
        ll cnt = 0, sum = 0;
        rep (j, d) {
            if (i & (1<<j)) {
                cnt += p[j];
                sum += p[j]*(j+1) + c[j];
            }
        }
        for (ll = d-1; j >= 0; j--) {
            // iをbit反転してj番目のフラグが立っていたら足していく
            if (~i>>j & 1) {
                for (ll k = 0; k < p[j] && sum < g; k++) {
                    sum += j+1;
                    cnt++;
                }
            }
        }
        if (sum >= g) {
            ans = min(cnt, ans);
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: expected unqualified-id before '=' token
   24 |         for (ll = d-1; j >= 0; j--) {
      |                 ^
a.cc:24:16: error: expected ';' before '=' token
   24 |         for (ll = d-1; j >= 0; j--) {
      |                ^~
      |                ;
a.cc:24:17: error: expected primary-expression before '=' token
   24 |         for (ll = d-1; j >= 0; j--) {
      |                 ^
a.cc:24:24: error: 'j' was not declared in this scope
   24 |         for (ll = d-1; j >= 0; j--) {
      |                        ^
a.cc:24:30: error: expected ')' before ';' token
   24 |         for (ll = d-1; j >= 0; j--) {
      |             ~                ^
      |                              )
a.cc:24:32: error: 'j' was not declared in this scope
   24 |         for (ll = d-1; j >= 0; j--) {
      |                                ^
Language: C++

#include <iostream>
#include <algorithm>
#include <set>
#include <numeric>
#include <vector>
#include <math.h>
#include <string>

using namespace std;

int main()
{
	int D, G;
	vector<int> num;
	vector<int> bonus;

	cin >> D >> G;
	long long loopnum = 1;

	for (int i = 0; i < D; i++)
	{
		int n, b;
		cin >> n >> b;
		num.emplace_back(n);
		bonus.emplace_back(b);

		loopnum *= (n+1);
	}
	
	int minn = INT_MAX;

	for (long long i = 0; i <= loopnum; i++)
	{
		int score = 0;
		long long pat = i;
		int nn = 0;

		for (int j = 0; j < D; j++)
		{
			int n = pat % (num[j] + 1);
			pat /= (num[j] + 1);

			score += n * 100 * (j + 1);
			nn += n;
			if (n == num[j])
			{
				score += bonus[j];
			}

			if (score >= G || pat == 0)
			{
				break;
			}
		}

		if (score >= G && minn > nn)
		{
			minn = nn;
		}
	}
	
	cout << minn << endl;

	return 0;
}

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

#include <bits/stdc++.h>
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: In function 'int main()':
a.cc:52:29: error: expected '}' at end of input
   52 |         cout << ans << endl;
      |                             ^
a.cc:44:12: note: to match this '{'
   44 | int main() {
      |            ^
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 i = 0; mask < (1 << D); mask++) {
				int s = 0, num = 0, rest_mask = -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 = (G - s + s1 - 1) / s1;
						if (need >= p[rest_max]) continue;
						num += need;
				}

				ans = min(ans, num);
		}
		cout << ans << endl;
		return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:33: error: 'mask' was not declared in this scope
   13 |                 for (int i = 0; mask < (1 << D); mask++) {
      |                                 ^~~~
a.cc:20:65: error: 'rest_max' was not declared in this scope; did you mean 'rest_mask'?
   20 |                                                                 rest_max = i;
      |                                                                 ^~~~~~~~
      |                                                                 rest_mask
a.cc:25:65: error: 'rest_max' was not declared in this scope; did you mean 'rest_mask'?
   25 |                                                 int s1 = 100 * (rest_max + 1);
      |                                                                 ^~~~~~~~
      |                                                                 rest_mask
Language: C++

#include <iostream>                                                                                                          
#include <vector>

const int INF = 1000000000;
const int MAX_D = 10; 
int D, G;
int p[MAX_D], c[MAX_D];

int Solve(int index, int cache){
   if(index==D){
      int plus = -1; 
      for(int i=D-1; i>=0; --i){
         if(!(cache&(1<<i))) {
            plus = i;
            break;
         }
      }   
      int sum = 0;
      int n = 0;
      for(int i=0; i<D; ++i){
         if(cache&(1<<i)){
            sum += (i+1)*100*p[i] + c[i];
            n += p[i];
         }
      }   
      if(plus>=0 && sum+(plus+1)*100*(p[plus]-1)>=G) 
         return n + std::max((G-sum)/(plus+1)/100 + std::min((G-sum)/100%(plus+1),1),0);
      else return INF;
   }   

   int s = Solve(index+1, cache);

   cache |= (1<<index);
   s = std::min(Solve(index+1, cache),s);

   return s;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

int main() {
    int d,g;
    cin >> d >> g;
    int p[20];
    int c[20];
    for(int i=1;i<=d;i++){
        cin >> p[i] >> c[i];
    }
    int final_ans = 10000000;
    for(int i=1;i<=d;i++){
        int 
        for(int j=0;j<p[i];j++){

        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: expected unqualified-id before 'for'
   16 |         for(int j=0;j<p[i];j++){
      |         ^~~
a.cc:16:21: error: 'j' was not declared in this scope
   16 |         for(int j=0;j<p[i];j++){
      |                     ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>

typedef long long ll;
using namespace std;

int d,g,num=10000;
int c[10],p[10];

void dfs(int i, int sum, int n){
  if (i == d){
    if (sum >= g){
      num = min(n,num);
    }
    return ;
  }
  
  if (i != 9){
    int ten = 1000+i+1;
  }else if (i == 9){
    int ten = 10010;
  }
  for (int j=0;j<=p[i];j++){
    if (j == p[i]){
      dfs(i+1,sum+j*ten,n+j);
    }else{
      dfs(i+1,sum+c[i]+j*ten,n+j);
    }
  }
  return ;
}

int main(){
  cin >> d >> g;
  for (int i =0;i<d;i++) cin >> p[i] >> c[i];
  dfs(0,0,0);
  cout << num << endl;
}

Compiler output:
a.cc: In function 'void dfs(int, int, int)':
a.cc:28:21: error: 'ten' was not declared in this scope; did you mean 'tan'?
   28 |       dfs(i+1,sum+j*ten,n+j);
      |                     ^~~
      |                     tan
a.cc:30:26: error: 'ten' was not declared in this scope; did you mean 'tan'?
   30 |       dfs(i+1,sum+c[i]+j*ten,n+j);
      |                          ^~~
      |                          tan