criyle/codenet-compile-errors huggingface dataset:
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 = (G - s + s1 - 1) / s1;
            if(need >= p[rest_max]){
                continue;
            }
            num += need;
        }
        ans = min(ans, num);
    }
    cout << ans << endl;
}
#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 = (G - s + s1 - 1) / s1;
            if(need >= p[rest_max]){
                continue;
            }
            num += need;
        }
        ans = min(ans, num);
    }
    cout << ans << endl;
}


Compiler output:
a.cc:35:5: error: redefinition of 'int main()'
   35 | int main(){
      |     ^~~~
a.cc:3:5: note: 'int main()' previously defined here
    3 | int main(){
      |     ^~~~
Language: C

D, G = map(int, input().split())
pc = []
for i in range(D):
    pc.append(list(map(int, input().split())))

pc = pc[::-1]
flg = 0
score = 0
count = 0
idx = D
for i in pc:
    tmp_score = score
    p, c = i
    tmp_score = 100*p*idx + c
    if tmp_score+score <= G:
        score += tmp_score
        count += p
        flg = 1
    else:
        if flg == 0:
            continue
        break
    idx -= 1

if flg == 0:
    p, c = pc[-1]
    tmp_score = score
    while(score < G):
        score += 100*idx
        count += 1
        if count == p:
            score += c
    print(count)
else:
    pc = pc[D-idx:]

    for i in pc:
        p, c = i
        ct = 0
        while(score < G):
            score += 100*idx
            count += 1
            ct += 1
            if ct == p:
                score += c
                break
        idx -= 1
    print(count)


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | D, G = map(int, input().split())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'D' [-Wimplicit-int]
main.c:1:4: error: type defaults to 'int' in declaration of 'G' [-Wimplicit-int]
    1 | D, G = map(int, input().split())
      |    ^
main.c:1:8: error: implicit declaration of function 'map' [-Wimplicit-function-declaration]
    1 | D, G = map(int, input().split())
      |        ^~~
main.c:1:12: error: expected expression before 'int'
    1 | D, G = map(int, input().split())
      |            ^~~
main.c:2:1: error: expected ',' or ';' before 'pc'
    2 | pc = []
      | ^~
Language: C++

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

#define FOR(i, s, e) for (int (i) = (s); (i) < (e); (i)++)

int main() {
    int D, G; cin >> D >> G;
    int p[11], c[11];
    FOR(i, 0, D) {
        cin >> p[i] >> c[i]; 
        p[i] = 101 - p[i];
    }
    int A[11]; FOR(i, 0, D) A[i] = (i + 1) * 100 * p[i] + c[i];
    tuple<int, int, int> t[11];
    FOR(i, 0, D) t[i] = make_tuple(A[i], p[i], i);

    sort(t, t + D);
    reverse(t,t + D);
    FOR(i, 0, D) get<1>(t[i]) =101 - get<1>(t[i]);
    
    int ans = 0;
    int a, b;
    for(int i = 0; ; i++) {
        G -= get<0>(t[i]);
        ans += get<1>(t[i]);

        if (G <= 0) {
            G += get<0>(t[i]);
            ans += get<1>(t[i]);
            a =get<1>(t[i]);
            b =get<2>(t[i]);
            break;
        }
    }

    for(int i = 1; i <= a; i ++) {
        G += a * 100 * (b + 1);
        ans ++;

        if (G <= 0) {
            printf("%d\n", ans);
            break;
        }
        if (G > 0 && i = a {
            printf("%d\n", ans);
        }
    }


}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:19: error: lvalue required as left operand of assignment
   46 |         if (G > 0 && i = a {
      |             ~~~~~~^~~~
a.cc:46:27: error: expected ')' before '{' token
   46 |         if (G > 0 && i = a {
      |            ~              ^~
      |                           )
a.cc:49:5: error: expected primary-expression before '}' token
   49 |     }
      |     ^
Language: C++

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

#define FOR(i, s, e) for (int (i) = (s); (i) < (e); (i)++)

int main() {
    int D, G; cin >> D >> G;
    int p[11], c[11];
    FOR(i, 0, D) {
        cin >> p[i] >> c[i]; 
        p[i] = 101 - p[i];
    }
    int A[11]; FOR(i, 0, D) A[i] = (i + 1) * 100 * p[i] + c[i];
    tuple<int, int, int> t[11];
    FOR(i, 0, D) t[i] = make_tuple(A[i], p[i], i);

    sort(t, t + D);
    reverse(t,t + D);
    FOR(i, 0, D) get<1>(t[i]) =101 - get<1>(t[i]);
    
    int ans = 0;
    int a, b;
    for(int i = 0; ; i++) {
        G -= get<0>(t[i]);
        ans += get<1>(t[i]);

        if (G <= 0) {
            G += get<0>(t[i]);
            ans += get<1>(t[i]);
            a =get<1>(t[i]));
            b =get<2>(t[i]));
            break;
        }
    }

    for(int i = 1; i <= a; i ++) {
        G += a * 100 * (b + 1);
        ans ++;

        if (G <= 0) {
            printf("%d\n", ans);
            break;
        }
        if (G > 0 && i =get<0>(t[i])) {
            printf("%d\n", ans);
        }
    }


}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:28: error: expected ';' before ')' token
   32 |             a =get<1>(t[i]));
      |                            ^
      |                            ;
a.cc:33:28: error: expected ';' before ')' token
   33 |             b =get<2>(t[i]));
      |                            ^
      |                            ;
a.cc:46:19: error: lvalue required as left operand of assignment
   46 |         if (G > 0 && i =get<0>(t[i])) {
      |             ~~~~~~^~~~
Language: C++

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

#define FOR(i, s, e) for (int (i) = (s); (i) < (e); (i)++)

int main() {
    int D, G; cin >> D >> G;
    int p[11], c[11];
    FOR(i, 0, D) {
        cin >> p[i] >> c[i]; 
        p[i] = 101 - p[i];
    }
    int A[11]; FOR(i, 0, D) A[i] = (i + 1) * 100 * p[i] + c[i];
    tuple<int, int, int> pa[11];
    FOR(i, 0, D) t[i] = make_tuple(A[i], p[i], i);

    sort(t, t + D);
    reverse(t,t + D);
    FOR(i, 0, D) get<1>(t[i]) =101 - get<1>(t[i]);
    
    int ans = 0;
    int a, b;
    for(int i = 0; ; i++) {
        G -= get<0>(t[i]);
        ans += get<1>(t[i]);

        if (G <= 0) {
            G += get<0>(t[i]);
            ans += get<1>(t[i]);
            a =get<1>(t[i]));
            b =get<2>(t[i]));
            break;
        }
    }

    for(int i = 1; i <= a; i ++) {
        G += (a * 100 * (b + 1);
        ans ++;

        if (G <= 0) {
            printf("%d\n", ans);
            break;
        }
        if (G > 0 && i =get<0>(t[i])) {
            printf("%d\n", ans);
        }
    }


}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:18: error: 't' was not declared in this scope
   17 |     FOR(i, 0, D) t[i] = make_tuple(A[i], p[i], i);
      |                  ^
a.cc:19:10: error: 't' was not declared in this scope
   19 |     sort(t, t + D);
      |          ^
a.cc:39:32: error: expected ')' before ';' token
   39 |         G += (a * 100 * (b + 1);
      |              ~                 ^
      |                                )
Language: C++

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
int main() {
	int D,G;
	cin>>D>>G;
	int ans=0;
	vector<int> veca(D);
	vector<int> vecb(D);
	vector<int> vecc(D);
	vector<int> vecd((D*(D-1))/2);
	vector<int> subb(pow(2,D));
	vector<int> sumb(pow(2,D));
	for(int i=0; i<D; i++){
		cin>>veca[i]>>vecb[i];
	}
	for(int i=0; i<D; i++){
		vecc=(i+1)*100*vea[i]+veb[i];
	}
	int k=0
	for(int i=0; i<D; i++){
		for(int j=0; j<i; j++){
		vecd[k]=(D-i)*100;
		k++
		}
	}
	int sum=0,sub=0;
	for(int bit=0;bit<pow(2,D);bit++){
		for(int i=0; i<D; i++){
		if(bit&(1<<i)){
			sum+=vec[i];
			sub+=vea[i];
		}
		}
		subb[bit]=sub;
		sumb[bit]=sum;
		sub=0;
		sum=0
	}
	for(int bit=0;bit<pow(2,D);bit++){
		ans=subb[i];
		if(ans<=G){
			
		}
		
		
		if(ans)
	}
}//途中

Compiler output:
a.cc: In function 'int main()':
a.cc:19:32: error: 'vea' was not declared in this scope; did you mean 'veca'?
   19 |                 vecc=(i+1)*100*vea[i]+veb[i];
      |                                ^~~
      |                                veca
a.cc:19:39: error: 'veb' was not declared in this scope; did you mean 'vecb'?
   19 |                 vecc=(i+1)*100*vea[i]+veb[i];
      |                                       ^~~
      |                                       vecb
a.cc:22:9: error: expected ',' or ';' before 'for'
   22 |         for(int i=0; i<D; i++){
      |         ^~~
a.cc:22:22: error: 'i' was not declared in this scope
   22 |         for(int i=0; i<D; i++){
      |                      ^
a.cc:32:30: error: 'vec' was not declared in this scope; did you mean 'vecd'?
   32 |                         sum+=vec[i];
      |                              ^~~
      |                              vecd
a.cc:33:30: error: 'vea' was not declared in this scope; did you mean 'veca'?
   33 |                         sub+=vea[i];
      |                              ^~~
      |                              veca
a.cc:39:22: error: expected ';' before '}' token
   39 |                 sum=0
      |                      ^
      |                      ;
   40 |         }
      |         ~             
a.cc:49:9: error: expected primary-expression before '}' token
   49 |         }
      |         ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i,a,b) for (ll i=(a);i<(ll)b; i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define INF 1000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll,ll> p;
const int MOD = 1000000007;

int D;//問題数
int G;//総合スコア
vector<ll> p,c;//問題数，ボーナス
//コンプリートボーナス: 100 i 点を付けられた 
//p i 問の問題すべてを解いたユーザーは、基本スコアと別にコンプリートボーナス c i 点を獲得します ( 1 ≤ i ≤ D ) 。


//全完する難易度帯を2^D通り決め打ちする
//それだけでG点に到達する場合はそれでOK
//それだけで到達しない場合は，Greedyに高い難易度からといて行く

//全完対象でないものを結果的に全完する場合は，全完すると決め打ちした場合で考慮サれるのでおｋ
int main(){
    cin>>D>>G;
    p.resize(D),c.resize(D);
    REP(i,D){
        cin>>p[i]>>c[i];
    }
    ll res = 1<<29;
    for(int bit = 0;bit<(1<<(D));bit++){
        ll sum = 0;
        ll 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--){
            //追加するbitを選ぶ
            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:15:12: error: 'std::vector<long long int> p' redeclared as different kind of entity
   15 | vector<ll> p,c;//問題数，ボーナス
      |            ^
a.cc:10:21: note: previous declaration 'typedef struct std::pair<long long int, long long int> p'
   10 | typedef pair<ll,ll> p;
      |                     ^
a.cc: In function 'int main()':
a.cc:27:6: error: expected unqualified-id before '.' token
   27 |     p.resize(D),c.resize(D);
      |      ^
a.cc:29:15: error: expected primary-expression before '[' token
   29 |         cin>>p[i]>>c[i];
      |               ^
a.cc:37:32: error: expected primary-expression before '[' token
   37 |                 sum += c[i] + p[i] * 100 * (i+1);
      |                                ^
a.cc:38:25: error: expected primary-expression before '[' token
   38 |                 num += p[i];
      |                         ^
a.cc:46:30: error: expected primary-expression before '[' token
   46 |             for(int j = 0;j<p[i];j++){
      |                              ^
Language: C++

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

int main(){
  int D,G; cin>>D>>G;
  vector<int>p(D,0);
  vector<int>c(D,0);
  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=(G-s+s1-1)/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:14:14: error: 'num' was not declared in this scope; did you mean 'enum'?
   14 |     int s=0; num=0,rest_max=-1;
      |              ^~~
      |              enum
a.cc:14:20: error: 'rest_max' was not declared in this scope
   14 |     int s=0; num=0,rest_max=-1;
      |                    ^~~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
  int D,G; cin>>D>>G;
  vector<int>p(D,0);
  vector<int>c(D,0);
  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=(G-s+s1-1)/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:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int>p(D,0);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int>p(D,0);
      |          ^~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int>c(D,0);
      |          ^~~
a.cc:9:10: error: 'p' was not declared in this scope
    9 |     cin>>p[i]>>c[i];
      |          ^
a.cc:9:16: error: 'c' was not declared in this scope
    9 |     cin>>p[i]>>c[i];
      |                ^
a.cc:13:14: 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:20: error: 'rest_max' was not declared in this scope
   13 |     int s=0; num=0,rest_max=-1;
      |                    ^~~~~~~~
a.cc:16:22: error: 'p' was not declared in this scope
   16 |         s+=100*(i+1)*p[i]+c[i];
      |                      ^
a.cc:16:27: error: 'c' was not declared in this scope
   16 |         s+=100*(i+1)*p[i]+c[i];
      |                           ^
a.cc:26:16: error: 'p' was not declared in this scope
   26 |       if(need>=p[rest_max]){
      |                ^
Language: C++

#include<iostream>
using namespace std;
const int INF = 100000;
int main () {
  int D, G;
  cin >> D >> G;
  int p[11];
  int c[11];
  for (int i = 0; i < D; i ++) cin >> p[i] >> c[i];
  bi[11];
  bi[0] = 1;
  for (int i = 0; i < 10; i ++) bi[i + 1] = bi[i] * 2;
  vector<int>ans(bi[D], 0);
  for (int i_ = 0; i_ < bi[D]; i_ ++) {
    int i = i_;
    int score;
    int f;
    for (int j = 0; j < D; j ++) {
      if (i % 2) {
        score = 100 * (j + 1) * p[j] + c[j];
        f = j;
        ans[i_] += p[j];
      }
      i /= 2;
    }
    if (score < G) ans[i_] = INF;
    else {
      if (score - c[f] - 100 * (f + 1) > G) {
        score -= c[f] + G;
        score /= 100;
        score = score / (f + 1);
        ans[i_] -= score;
      }
    }
  }
  int jun = ans[0];
  for (int i = 1; i < bi[D]; i ++) {
    if (jun > ans[i]) jun = ans[i];
  }
  cout << jun << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'bi' was not declared in this scope
   10 |   bi[11];
      |   ^~
a.cc:13:3: error: 'vector' was not declared in this scope
   13 |   vector<int>ans(bi[D], 0);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:13:10: error: expected primary-expression before 'int'
   13 |   vector<int>ans(bi[D], 0);
      |          ^~~
a.cc:22:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   22 |         ans[i_] += p[j];
      |         ^~~
      |         abs
a.cc:26:20: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |     if (score < G) ans[i_] = INF;
      |                    ^~~
      |                    abs
a.cc:32:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   32 |         ans[i_] -= score;
      |         ^~~
      |         abs
a.cc:36:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   36 |   int jun = ans[0];
      |             ^~~
      |             abs
Language: C++

#include<iostream>
using namespace std;
const int INF = 100000
int main () {
  int D, G;
  cin >> D >> G;
  int p[11];
  int c[11];
  for (int i = 0; i < D; i ++) cin >> p[i] >> c[i];
  bi[11];
  bi[0] = 1;
  for (int i = 0; i < 10; i ++) bi[i + 1] = bi[i] * 2;
  vector<int>ans(bi[D], 0);
  for (int i_ = 0; i_ < bi[D]; i_ ++) {
    int i = i_;
    int score;
    int f;
    for (int j = 0; j < D; j ++) {
      if (i % 2) {
        score = 100 * (j + 1) * p[j] + c[j];
        f = j;
        ans[i_] += p[j];
      }
      i /= 2;
    }
    if (score < G) ans[i_] = INF;
    else {
      if (score - c[f] - 100 * (f + 1) > G) {
        score -= c[f] + G;
        score /= 100;
        score = score / (f + 1);
        ans[i_] -= score;
      }
    }
  }
  int jun = ans[0];
  for (int i = 1; i < bi[D]; i ++) {
    if (jun > ans[i]) jun = ans[i];
  }
  cout << jun << endl;
}

Compiler output:
a.cc:4:1: error: expected ',' or ';' before 'int'
    4 | int main () {
      | ^~~
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];
        cin >> c[i];
    }
    int mincount = 100000;
    for(int bit=0;bit<(1<<D);++bit){
        int score = 0,count = 0;
        for(int i = 0;i<D;++i){
            if(bit & 1<<i){
                score += (p[i]*(i+1)*100+c[i]);
                count += p[i];
            }
        }
        int next = -1;
        for(int j = D-1;j >= 0;--j){
            if(bit & 1<<j){
                next = j;
                break;
            }
        }
        if(next!=-1){
            int restscore = G-score;
            int rest = (restscore + (next+1)*100-1)/((next+1)*100);
            if (rest > p[next]){
                break;
            }
            count += rest;
        }
        mincount = min{mincount,count};
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:20: error: cannot resolve overloaded function 'min' based on conversion to type 'int'
   37 |         mincount = min{mincount,count};
      |                    ^~~
Language: C++

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

int main()
{
    int D,generate_header;
    cin >> D >> G;
    int p[D],c[D];
    for(int i = 0;i<D;i++){
        cin >> p[i];
        cin >> c[i];
    }
    int mincount = 100000;
    for(int bit=0;bit<(1<<D);++bit){
        int score = 0,count = 0;
        for(int i = 0;i<D;++i){
            if(bit & 1<<i){
                score += (p[i]*(i+1)*100+c[i]);
                count += p[i];
            }
        }
        int next = -1;
        for(int j = D-1;j >= 0;--j){
            if(bit & 1<<j){
                next = j;
            }
        }
        if(next!=-1){
            int restscore = G-score;
            int rest = (restscore + (next+1)*100-1)/((next+1)*100);
            if (rest > p[j]){
                break;
            }
            count += rest;
        }
        mincount = min{mincount,count};
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'G' was not declared in this scope
    7 |     cin >> D >> G;
      |                 ^
a.cc:31:26: error: 'j' was not declared in this scope
   31 |             if (rest > p[j]){
      |                          ^
a.cc:36:20: error: cannot resolve overloaded function 'min' based on conversion to type 'int'
   36 |         mincount = min{mincount,count};
      |                    ^~~
Language: C++

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

int main()
{
    int D,generate_header;
    cin >> D >> C;
    int p[D],c[D];
    for(int i = 0;i<D;i++){
        cin >> p[i];
        cin >> c[i];
    }
    int mincount = 100000;
    for(int bit=0;bit<(1<<D);++bit){
        int score = 0,count = 0;
        for(int i = 0;i<D;++i){
            if(bit & 1<<i){
                score += (p[i]*(i+1)*100+c[i]);
                count += p[i];
            }
        }
        int next = -1;
        for(int j = D-1;j >= 0;--j){
            if(bit & 1<<j){
                next = j;
            }
        }
        if(j!=-1){
            restscore = G-score;
            rest = (restscore + (next+1)*100-1)/((next+1)*100);
            if (rest > p[j]){
                break;
            }
            count += rest;
        }
        mincount = min{mincount,count};
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'C' was not declared in this scope
    7 |     cin >> D >> C;
      |                 ^
a.cc:28:12: error: 'j' was not declared in this scope
   28 |         if(j!=-1){
      |            ^
a.cc:29:13: error: 'restscore' was not declared in this scope
   29 |             restscore = G-score;
      |             ^~~~~~~~~
a.cc:29:25: error: 'G' was not declared in this scope
   29 |             restscore = G-score;
      |                         ^
a.cc:30:13: error: 'rest' was not declared in this scope
   30 |             rest = (restscore + (next+1)*100-1)/((next+1)*100);
      |             ^~~~
a.cc:36:20: error: cannot resolve overloaded function 'min' based on conversion to type 'int'
   36 |         mincount = min{mincount,count};
      |                    ^~~
Language: C++

D,G = map(int,input().split())
b = []
c = []
for i in range(D):
    x,y = map(int,input().split())
    b.append(x)
    c.append(y)
res = 1e9
for i in range(1<<D):
    s = format(i,"0"+str(D)+"b")
    score = 0
    num = 0 
    for j in range(D):
        if s[j]=='1':
            num+=b[j]
            score += b[j]*(j+1)*100 + c[j]
    if score >= G:
        res = min(num,res)
    else:
        for j in range(D)[::-1]:
            if s[j] == '0':
                if score + (b[j]-1)*100*(j+1)>=G:
                    if (G-score)%(100*(j+1))==0:
                        num+= (G-score)//(100*(j+1))
                        score = G
                    else:
                        num+= (G-score)//(100*(j+1)) + 1
                        score = G
                    break
                else:
                    num+= b[j]-1
                    score += (b[j]-1)*100*(j+1)
        if score>=G:
            res = min(num,res)
print(res)


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

// https://atcoder.jp/contests/abc104/tasks/abc104_c

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

typedef long long ll;
#define EPS (1e-7)
#define INF (1e9)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()

// int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
//問題数、コンプリートボーナス、合計点
typedef tuple<int, int, int> mytuple;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int d, g, ans = INF;
    vector<mytuple> v;
    cin >> d >> g;

    for (int i = 1; i <= d; i++) {
        int p, c;
        cin >> p >> c;
        v.push_back(make_tuple(p, c, i * p * 100 + c));
    }
    //ビット探索で完答する組み合わせを求めてから難易度の高い問題から解く
    for (uint32_t i = 0; i < (1UL << d); i++) {
        int sumAns = 0, sumScore = 0;
        for (int j = 0; j < d; j++) {
            //ビットマスクして合計点と回答数を計算
            if (i & (1UL << j)) {
                sumAns += get<0>(v[j]);
                sumScore += get<2>(v[j]);
                //目標をクリアしたら、回答数が少ない方に更新
                if (sumScore >= g) {
                    ans = min(ans, sumAns);
                    break;
                }
            }
        }
        // 指定した難易度の問題を全て解いても目標点未満なら
        // 残った問題の難易度の高いもの1つのみを目標点を超えるまで解く
        bool endF = true;
        for (int j = d - 1; j >= 0 && endF; j--) {
            // 残った問題なら1問を残して解いて目標点を超えるか判定
            int bMask = (i & (1UL << j));
            // cout << i << ":" << (1UL << j) << ":" << bMask << endl;
            if (bMask == 0) {
                endF = false;
                for (int k = 0; k < get<0>(v[j]) - 1; k++) {
                    sumAns++;
                    sumScore += (j + 1) * 100;
                    //目標をクリアしたら、回答数が少ない方に更新
                    if (sumScore >= g) {
                        ans = min(ans, sumAns);
                        break;
                    }
                }
            }
        }
    }
    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:10: error: 'uint32_t' was not declared in this scope
   32 |     for (uint32_t i = 0; i < (1UL << d); i++) {
      |          ^~~~~~~~
a.cc:7:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    6 | #include <vector>
  +++ |+#include <cstdint>
    7 | using namespace std;
a.cc:32:26: error: 'i' was not declared in this scope
   32 |     for (uint32_t i = 0; i < (1UL << d); i++) {
      |                          ^
Language: C

#include <stdio.h>
  
int main(){
    int d,g;scanf("%d %d",&d,&g);
    int sum=0,ans[d]=0;
    int a=0;
    int p[d],c[d];
    for(int i=d-1;i>=0;i--){
        scanf("%d %d",&p[i],&c[i]);
        while(sum<g&&ans[i]<p[i]){
            sum+=100*i;
            ans[i]+=1;
        }   
        a+=ans[i]
        if(sum>g) break;
    }   
    printf("%d",a);
    return 0;
}  

Compiler output:
main.c: In function 'main':
main.c:5:22: error: variable-sized object may not be initialized except with an empty initializer
    5 |     int sum=0,ans[d]=0;
      |                      ^
main.c:14:18: error: expected ';' before 'if'
   14 |         a+=ans[i]
      |                  ^
      |                  ;
   15 |         if(sum>g) break;
      |         ~~
Language: C++

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

int d, g;
long ans = 1e9;

// bool dfs(int score, int cnt, vector<int> p, vector<int> c, int i) {
//   if (score >= g) {
//     ans = min(ans, cnt);
//     return true;
//   }

//   if (i == d) return true;

//   dfs(score + p[i] * (i + 1) + c[i], cnt + p[i], p, c, i + 1);  // compの場合

//     int j = d-1;
//     int k = 0 ;
//     while(true){
//     if(dfs(score + j * (d - i), cnt + j, p, c, i + 1)) break;
//     }
// }

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

  cin >> d >> g;
  g /= 100;

  vector<int> p(d), c(g);

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

  dfs(0, 0, p, c, 0);

  cout << ans << '\n';
}

for (int i = 0; i < 1 << d; i++) {
  int cnt = 0;
  int score = 0;

  for (int j = 0; j < d; j++) {  // compする場合
    if (i >> j & 1) {
      cnt += p[j];
      score += p[j] * (j + 1);
      score += c[j];
    }
  }
  for (int j = d - 1; j >= 0;
       j--) {  // compしない場合点数が大きいものから加算する
    if (~i >> j & 1) {
      for (int k = 0; k < p[j] && score < g; k++) {
        score += j + 1;
        cnt++;
      }
    }
  }
  if (score >= g) {
    ans = min(ans, cnt);
  }
}

cout << ans << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:3: error: 'dfs' was not declared in this scope
   41 |   dfs(0, 0, p, c, 0);
      |   ^~~
a.cc: At global scope:
a.cc:46:1: error: expected unqualified-id before 'for'
   46 | for (int i = 0; i < 1 << d; i++) {
      | ^~~
a.cc:46:17: error: 'i' does not name a type
   46 | for (int i = 0; i < 1 << d; i++) {
      |                 ^
a.cc:46:29: error: 'i' does not name a type
   46 | for (int i = 0; i < 1 << d; i++) {
      |                             ^
a.cc:71:1: error: 'cout' does not name a type
   71 | cout << ans << '\n';
      | ^~~~
a.cc:72:1: error: expected declaration before '}' token
   72 | }
      | ^
Language: C++

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

int d, g;
int ans = 1e9;

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

  cin >> d >> g;
  G /= 100;

  vector<int> p(d), c(g);

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

  for (int i = 0; i < 1 << d; i++) {
    int cnt = 0;
    int score = 0;

    for (int j = 0; j < d; j++) {  // compする場合
      if (i >> j & 1) {
        cnt += p[j];
        score += p[j] * (j + 1);
        score += c[j];
      }
    }
    for (int j = d - 1; j >= 0;
         j--) {  // compしない場合点数が大きいものから加算する
      if (~i >> j & 1) {
        for (int k = 0; k < p[j] && score < g; k++) {
          score += j + 1;
          cnt++;
        }
      }
    }
    if (score >= g) {
      ans = min(ans, cnt);
    }
  }

  cout << ans << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: 'G' was not declared in this scope
   15 |   G /= 100;
      |   ^
Language: C++

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

int D, G;
int ans = 0;
void dfs(int score, int resolved) {
  if (socre >= G) {
    ans = min(ans, resolved);
  }

  p[0]
}

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

  cin >> D >> G;
  G /= 100;

  vector<int> p(D), c(D);

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

  for (int i = 0; i < 1 << d; i++) {
    int cnt = 0;
    int score = 0;

    for (int j = 0; j < d; j++) {  // compする場合
      if (i >> j & 1) {
        cnt += p[j];
        score += p[j] * (j + 1);
        score += c[j];
      }
    }
    for (int j = d - 1; j >= 0;
         j--) {  // compしない場合点数が大きいものから加算する
      if (~i >> j & 1) {
        for (int k = 0; k < p[j] && score < g; k++) {
          score += j + 1;
          cnt++;
        }
      }
    }
    if (score >= g) {
      ans = min(ans, cnt);
    }
  }

  cout << ans << '\n';
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:10:7: error: 'socre' was not declared in this scope; did you mean 'score'?
   10 |   if (socre >= G) {
      |       ^~~~~
      |       score
a.cc:14:3: error: 'p' was not declared in this scope
   14 |   p[0]
      |   ^
a.cc: In function 'int main()':
a.cc:31:28: error: 'd' was not declared in this scope
   31 |   for (int i = 0; i < 1 << d; i++) {
      |                            ^
a.cc:45:45: error: 'g' was not declared in this scope
   45 |         for (int k = 0; k < p[j] && score < g; k++) {
      |                                             ^
a.cc:51:18: error: 'g' was not declared in this scope
   51 |     if (score >= g) {
      |                  ^
Language: C++

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

int D, G;
int ans = 0;
void dfs(int score, int resolved) {
  if (socre >= G) {
    ans = min(ans, resolved);
  }

  p[0]
}

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

  cin >> D >> G;
  G /= 100;

  vector<int> p(D), c(D);

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

  for (int i = 0; i < 1 << d; i++) {
    int cnt = 0;
    int score = 0;

    for (int j = 0; j < d; j++) { //compする場合
      if (i >> j & 1) {
        cnt += p[j];
        score += p[j] * (j + 1); 
        score += c[j];
      }
    }
    for (int j = d - 1; j >= 0; j--) { //compしない場合点数が大きいものから加算する
      if (~i >> j & 1) {
        for (int k = 0; k < p[j] && score < g; k++) {
          score += j + 1;
          cnt++;
        }
      }
    }
    if (score >= g) {
      ans = min(ans, cnt);
    }
  }
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:10:7: error: 'socre' was not declared in this scope; did you mean 'score'?
   10 |   if (socre >= G) {
      |       ^~~~~
      |       score
a.cc:14:3: error: 'p' was not declared in this scope
   14 |   p[0]
      |   ^
a.cc: In function 'int main()':
a.cc:31:28: error: 'd' was not declared in this scope
   31 |   for (int i = 0; i < 1 << d; i++) {
      |                            ^
a.cc:44:45: error: 'g' was not declared in this scope
   44 |         for (int k = 0; k < p[j] && score < g; k++) {
      |                                             ^
a.cc:50:18: error: 'g' was not declared in this scope
   50 |     if (score >= g) {
      |                  ^
Language: C++

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

using namespace std;

int Solve(vector<int>* res, int point) {
	sort(res->begin(), res->end(), greater<int>());
	int t = 0;
	for (int i = 0; point > 0; i++) {
		point -= res->at(i);
		t++;
	}
	return t;
}

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 pmin = INT_MAX;
	for (int i = 0; i < (1 << D); i++) {
		int sp = G;
		int sw = 0;
		vector<int>res;
		for (int j = 0; j < D; j++) {
			if ((i&(1 << j)) != 0) {
				sp -= 100 * (j + 1) * p[j] + c[j];
				sw += p[j];
			}
			else {
				for (int k = 0; k < p[j]; k++)
					res.push_back(100 * (j + 1));
			}
		}
		if (sp <= 0)
			pmin = min(pmin, sw);
		else {
			pmin = min(pmin, sw + Solve(&res, sp));
		}
	}

	cout << pmin << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:20: error: 'INT_MAX' was not declared in this scope
   31 |         int pmin = INT_MAX;
      |                    ^~~~~~~
a.cc:9:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    8 | #include <set>
  +++ |+#include <climits>
    9 |
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>

#include <sstream>
#include <istream>

using namespace std;

//typedef pair<int,int> P;
typedef long long ll;

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 = 1000000;
	for(int mask=0; mask<(1<<D); i++){
		int s = 0;
		int num = 0;
		int 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 = (G - s + s1 - 1) / 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:27:38: error: 'i' was not declared in this scope
   27 |         for(int mask=0; mask<(1<<D); i++){
      |                                      ^
Language: C++

#include <iostream>
#include<iomanip>
#include <cmath>
#include <climits>
#include <algorithm>
#include <stdio.h>
#include <vector>
#include <queue>
#include <tuple>
#include <map>
#include <list>
#include <string>
using namespace std;

//long long A[100000];
//int stand_bit_num[40];

//int t[1000000];
//long long d[100000];

int p[100];
int c[100];

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

    int ans = accumulate(p, p + D, 0);
    for(int comp_set = 0; comp_set < (1 << 10); comp_set ++){
        int cur_score = 0;
        int ans_num = 0;
        for(int i = 0; i < 10; i++){
            if(((comp_set >> i) & 1) == 1){
                cur_score += (i + 1) * p[i] + c[i] / 100;
                ans_num += p[i];
            }
        }
        if(cur_score >= G / 100){
            ans = min(ans, ans_num);
            continue;
        }

        int left_score = G / 100- cur_score;
        for(int i = D - 1; i >= 0; i--){
            if(((comp_set >> i) & 1) == 0){
                if(left_score <= (p[i] - 1) * (i + 1)){
                    if(left_score % (i + 1) == 0){
                        ans_num += left_score / (i + 1);
                    } else {
                        ans_num += left_score / (i + 1) + 1;
                    }
                    ans = min(ans, ans_num);
                    break;
                } else {
                    left_score -= (p[i] - 1) * (i + 1);
                    ans_num += p[i] - 1;
                }
            }
        }

    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:15: error: 'accumulate' was not declared in this scope
   31 |     int ans = accumulate(p, p + D, 0);
      |               ^~~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<sstream>
#include<string>
#include<numeric>
#include <algorithm>
#include<math.h>
#include<cstdio>
#include<string.h>
#include<unistd.h>
#include <array>
#include <map> 




using namespace std;
typedef long long ll;
struct point{
  int x;
  int y;

};
int gcd(int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	// ユークリッドの方法
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}//gcd
int lcm( int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//lcm
int input(){
  int x;
  cin>>x;
  return x;
}

int moji(char in)
{
    int ans = (int)in-(int)'a';
    if((ans < 0) || (ans > 25)){
        ans = 26;
    }
    return ans;
}
const int VV=10;//場合に応じてVVの値のみ変更する必要あり
//dijkstra(s)sがスタート地点でそこからの最短距離を配列dで表す。正の重みのみ使用可能
int cost[VV][VV];
int d[VV];
bool used[VV];
void dijkstra(int s){
  fill(d,d+VV,100000);
  fill(used,used+VV,false);
  d[s]=0;
  while(true){
    int v=-1;
    for(int u=0;u<VV;u++){
      if(!used[u]&&(v==-1||d[u]<d[v]))v=u;
    }
    if(v==-1)break;
    used[v]=true;
    for(int u=0;u<VV;u++){
      d[u]=min(d[u],d[v]+cost[v][u]);
    }
  }

}

int compare_int(const void *a, const void *b)//qsort(quick sort利用時に使用)
{
    return *(int*)a - *(int*)b;
}

int binary_searchh(long long x,long long k[],int n){
  int l=0;
  int r=n;
  while(r-l>=1){
    int i=(l+r)/2;
    if(k[i]==x)return i;
    else if(k[i]<x)l=i+1;
    else r=i;
  }
  return -1;
}

struct File {
    int aa;
    int bb;

    File(const int& aa, const int& bb)
        : aa(aa), bb(bb) {}
};

bool operator<(const File& a, const File& b)
{
    // ファイル種別、ファイル名の順番で優先順位を付けて比較
    return std::tie(a.aa, a.bb) < std::tie(b.aa, b.bb);
}




int main(){
  int D;
  long long G;
  vector<long long>p,c;
  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; //2^29までもつ2しんすうで
  for(int bit=0;bit<(a<<D);bit++){//2^Dまで2進数でforでbitをまわす
    long long sum=0;
    long long num=0;
    for(int i=0;i<D;i++){
      if(bit&(1<<i)){//bitのi行目が1のときに1を出力してif文が実行される。
        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: In function 'int main()':
a.cc:128:22: error: 'a' was not declared in this scope
  128 |   for(int bit=0;bit<(a<<D);bit++){//2^Dまで2進数でforでbitをまわす
      |                      ^
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 = (G - s + s1 - 1) / 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:31:25: error: expected '}' at end of input
   31 |     cout << ans << endl;
      |                         ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

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

int D, G;
int p[10], c[10];
int all[10];
vector<int> ans;

void dfs(string used, int score, int solved, int count)
{
  if (G <= score)
  {
    ans.push_back(solved);
    return;
  }
  if (count == D)
  {
    set<int> st;
    for (int i = 0; i < used.length(); i++)
    {
      if (used[i] != ':')
        st.insert(used[i] - '0');
    }
    for (int i = D - 1; i >= 0; i--)
    {
      if (st.find(i) == st.end())
      {
        int sub = i;
        for (int j = 0; j < p[sub] - 1; j++)
        {
          score += (sub + 1) * 100;
          solved++;
          if (G <= score)
          {
            ans.push_back(solved);
            return;
          }
        }
      }
    }
    return;
  }
  dfs(used + ":" + to_string(count), score + all[count], solved + p[count], count + 1);
  dfs(used, score, solved, count + 1);
}

int main()
{
  cin >> D >> G;
  for (int i = 0; i < D; i++)
    cin >> p[i] >> c[i];
  for (int i = 0; i < D; i++)
    all[i] = (i + 1) * 100 * p[i] + c[i];
  dfs("", 0, 0, 0);
  sort(ans.begin(), ans.end());
  cout << ans[0] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   57 |   sort(ans.begin(), ans.end());
      |   ^~~~
      |   short
Language: C++

#include <iostream>
#include <vector>
using namespace std;
using ll=long long int;
struct Q{
  ll p;
  ll c;
};
int main(){
  ll N,G;
  cin>>D>>G;
  vector<Q> qs;
  for(int i=1;i<=D;i++){
    ll p,c;
    cin>>p>>c;
    qs.push_back({p,c});
  }
  ll result=0;
  for(int i=D-1;i>=0;i--){
    if(G > i*100 * qs[i].p + qs[i].c){
      result -= i*100 * qs[i].p + qs[i].c;
    }else{
      if(G>=i*100 * qs[i].p){
        result += qs[i].p;
      }else{
        result += (G + (i*100) - 1) / (i*100) - 1;
      }
      break;
    }
  }
  cout<<result<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 'D' was not declared in this scope
   11 |   cin>>D>>G;
      |        ^
Language: C++

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/tag_and_trait.hpp>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0)
#define END return EXIT_SUCCESS
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR(I,0,N)
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) std::cin>>(P)
#define IN2(P1,P2) std::cin>>(P1)>>(P2)
#define IN3(P1,P2,P3) std::cin>>(P1)>>(P2)>>(P3)
#define INS(I,N,V) UP(I,0,N) std::cin>>V[I]
#define OUT(P) std::cout<<P<<std::endl
#define OUT2(P1,P2) std::cout<<P1<<" "<<P2<<std::endl
#define OUT3(P1,P2,P3) std::cout<<P1<<" "<<P2<<" "<<P3<<std::endl
#define OUTS(I,N,V) UP(I,0,N) std::cout<<V[i]<<std::endl
#define ALL(C) (C).begin(),(C).end()
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
using namespace std;
using namespace __gnu_pbds;
int D,G;
int p[11],c[11];
int i,j,k;
int ans=INT_MAX;
int mask,num,s,rest_max,s1,need;
inline void solve(){
  IN(D,G);
  REP(i,D)IN2(p[i],c[i]);
  for(mask=0;mask<(1<<D);++mask){
    s=0,num=0,rest_max=-1;
    REP(i,D){
      if(mask>>i&1){
        s+=100*(i+1)*p[i]+c[i];
        num+=p[i];
      }else{
        rest_max=i;
      }
    }
    if(s<G){
      s1=100*(rest_max+1);
      need=(G-s+s1-1)/s1;
      if(need>=p[rest_max]){
        continue;
      }
      num+=need;
    }
    ans=min(ans,num);
  }
  OUT(ans);
}

int main(int argc,char**argv){
  BEGIN;
  solve();
  END;
}


Compiler output:
a.cc:37:9: error: macro "IN" passed 2 arguments, but takes just 1
   37 |   IN(D,G);
      |         ^
a.cc:11:9: note: macro "IN" defined here
   11 | #define IN(P) std::cin>>(P)
      |         ^~
a.cc: In function 'void solve()':
a.cc:37:3: error: 'IN' was not declared in this scope
   37 |   IN(D,G);
      |   ^~
Language: C++

#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <array>
#include <list>
#include <set>
#include <map>
#include <cmath>
#include <iterator>
using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++);

typedef long long ll;

int main() {
    int n, g;
    cin >> n >> g;
    vector<int> p(n), c(n);
    rep (i, n) {
        cin >> p[i] >> c[i];
    }
    int ans = 0;
    rep(i, 1 << n) {
        int sum = 0, solved = 0, notComp = -1;
        int t = i;

        rep(j, n) {
            if (t % 2) {
                sum += c[j];
                sum += p[j] * (j + 1) * 100;
                solved += p[j];
            } else {
                notComp = j;
                t /= 2;
            }
        }

        if (sum >= g) {
            ans = min(ans, solved);
        } else {
            for (int j = 0; j < p[notComp] && sum < g; j++) {
                sum += (notComp + 1) * 100;
                solved++;
            }
            if (sum >= g) {
                ans = min(ans, solved);
            }
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:18: error: 'i' was not declared in this scope
   22 |         cin >> p[i] >> c[i];
      |                  ^
a.cc:27:17: error: 'i' was not declared in this scope
   27 |         int t = i;
      |                 ^
a.cc:31:26: error: 'j' was not declared in this scope
   31 |                 sum += c[j];
      |                          ^
a.cc:35:27: error: 'j' was not declared in this scope
   35 |                 notComp = j;
      |                           ^