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

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (in i = 0; i < (in)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
const in INF=1<<30;
#define vec2(a,y,x) vector<vector<int>> a(y,vector<int>(x))
#define vec1(a,n) vector<in> a(n);rep(i,n)cin>>a[i]

int main(){
 in d,g;
  cin>>d>>g;
  g /=100ll;
  vector<in> p(d),c(d);
  rep(i,d) cin>>p[i]>>c[i];
  in max_point,cnt,total_point;
  in ans =INF;
  
for (in tmp = 0ll; tmp < (1 << d); tmp++) {
  bitset<10> s(tmp);
  max_point=0ll;cnt=0ll;total_point=0ll;
 rep(i,d){
   if(s.test(i)){
      cnt +=p[i];
     total_point += p[i]*(i+1ll);
     total_point += c[i]/100ll;
   }
   else{
      max_point =max(i+1ll,max_point);
   }
   
 }//rep
  if(max_point*p[max_point-1ll]+total_point<=g) continue;
   if(total_point>=g){ans =min(ans,cnt);continue;}
  in x=g-total_point;
  if(x%max_point==0) cnt += x/max_point;
  else cnt += x/max_point+1ll;
  ans =min(ans,cnt);
  
}//bit
cout<<ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:21: error: no matching function for call to 'max(long long int, in&)'
   32 |       max_point =max(i+1ll,max_point);
      |                  ~~~^~~~~~~~~~~~~~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:32:21: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'in' {aka 'long int'})
   32 |       max_point =max(i+1ll,max_point);
      |                  ~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303: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:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:32:21: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   32 |       max_point =max(i+1ll,max_point);
      |                  ~~~^~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (in i = 0; i < (in)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
const in INF=1<<30;
#define vec2(a,y,x) vector<vector<int>> a(y,vector<int>(x))
#define vec1(a,n) vector<in> a(n);rep(i,n)cin>>a[i]

int main(){
 in d,g;
  cin>>d>>g;
  g /=100ll;
  vector<in> p(d),c(d);
  rep(i,d) cin>>p[i]>>c[i];
  in max_point=0;
  in cnt=0;
  in total_point=0;
  in ans =INF;
  
for (in tmp = 0ll; tmp < (1 << d); tmp++) {
  bitset<10> s(tmp);
  max_point=0ll;cnt=0ll;total_point=0ll;
 rep(i,d){
   if(s.test(i)){
      cnt +=p[i];
     total_point += p[i]*(i+1ll);
     total_point += c[i]/100ll;
   }
   else{
      max_point =max(i+1ll,max_point);
   }
   
 }//rep
  if(max_point*p[max_point-1ll]+total_point<=g) continue;
   if(total_point>=g){ans =min(ans,cnt);continue;}
  in x=g-total_point;
  if(x%max_point==0) cnt += x/max_point;
  else cnt += x/max_point+1ll;
  ans =min(ans,cnt);
  
}//bit
cout<<ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:21: error: no matching function for call to 'max(long long int, in&)'
   34 |       max_point =max(i+1ll,max_point);
      |                  ~~~^~~~~~~~~~~~~~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:34:21: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'in' {aka 'long int'})
   34 |       max_point =max(i+1ll,max_point);
      |                  ~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303: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:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:34:21: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   34 |       max_point =max(i+1ll,max_point);
      |                  ~~~^~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (in i = 0; i < (in)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
const in INF=1<<30;
#define vec2(a,y,x) vector<vector<int>> a(y,vector<int>(x))
#define vec1(a,n) vector<in> a(n);rep(i,n)cin>>a[i]

int main(){
 int d,g;
  g /=100;
  cin>>d>>g;
  vector<int> p(d),c(d);
  rep(i,d) cin>>p[i]>>c[i];
  int max_point=0;
  int cnt=0;
  int total_point=0;
  int ans =1000000;
  
for (int tmp = 0; tmp < (1 << d); tmp++) {
  bitset<10> s(tmp);
 rep(i,d){
   if(s.test(i)){
      cnt +=p[i];
     total_point += p[i]*(i+1);
   }
   else{
      max_point =max(i+1,max_point);
   }
   
 }//rep
  if(max_point*p[max_point-1]+total_point<=g) continue;
   if(total_point>=g){ans =min(ans,cnt);continue;}
  int x=g-total_point;
  if(x%max_point==0) cnt += x/max_point;
  else cnt += x/max_point+1;
  ans =min(ans,cnt);
}//bit
cout<<cnt;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:21: error: no matching function for call to 'max(in, int&)'
   32 |       max_point =max(i+1,max_point);
      |                  ~~~^~~~~~~~~~~~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:32:21: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   32 |       max_point =max(i+1,max_point);
      |                  ~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303: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:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:32:21: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   32 |       max_point =max(i+1,max_point);
      |                  ~~~^~~~~~~~~~~~~~~
Language: C++

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

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

	int d, g;
	int p[11], c[11];
	cin >> d >> g;
	rep(i,10) cin >> p[i] >> c[i];

	int ans,point;
	for(int i=9; i>=0; --i){
		for(int j=1; j<=i; ++i){
			point += p[i];
			ans++;
			if(j==i) point += c[i], ans++;

		}
		
	}
	if(point >= g) cout << ans << "\n";



}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'i' was not declared in this scope
   13 |         rep(i,10) cin >> p[i] >> c[i];
      |             ^
a.cc:13:9: error: 'rep' was not declared in this scope
   13 |         rep(i,10) cin >> p[i] >> c[i];
      |         ^~~
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  ll d,g;
  cin>>d>>G;
  vll p(d),c(d);
  rep(i,d) cin>>p[i]>>c[i];
  ll ans=INF;
  for(int bit=0;bit<(1<<d);bit++){
    ll cu=0;
    ll k=0;
    ll o=0;
    for(int i=0;i<d;i++){
      if(bit&(1<<i)){
        cu+=p[i];
        k+=i*100*p[i]+c[i];
      }
      if(bit&(1<<i)!=1){
        o=i;
      }
    }
    if(k>=g){
      ans=min(cu,ans);
    }
    else if(o*100*p[o]>g-k){
      cu+=(g-k+o*100-1)/(o*100);
      ans=min(ans,cu);
    }
  }
  COUT(ans);
}

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

D, G = map(int, input().split())
G = G // 100
sumn = 0
ns = [0] * (D + 1)
cs = [0] * (D + 1)
cache = [{} for _ in range(D + 1)]
for i in range(1, D + 1):
    n, c = map(int, input().split())
    ns[i] = n
    cs[i] = c // 100
    sumn += n

minn = [0] * (D + 1)
for i in range(1, D + 1):
    minn[i] = min(ns[1:i+1])

def f(i, rn):
    if i == 1:
        if ns[1] < rn:
            return -1
        p = rn
        if ns[0] == rn:
            p += cs[1]
        return p
    if rn < minn[i]:
        p = 0
        for j in range(i, 0, -1):
            n = min((ns[j], rn))
            p += i * n
            if n == rn:
                break
            rn -= n
        return p
    maxp = 0
    for n in range(min((ns[i], rn)) + 1):
        p = i * n
        if n == ns[i]:
            p += cs[i]
        nn = rn - n
        cch = cache[i - 1]
        np = cch.get(nn)
        if not np:
            np = f(i - 1, nn)
            cch[nn] = np
        if np >= 0:
            p += np
            if maxp < p:
                maxp = p
    return maxp

mn = 1
mx = sumn
while mn < mx:
    x = mn + ((mx - mn) // 2)
    if G <= f(D, x):
        mx = x
    else:
        mn = x + 1
print(mn)


Compiler output:
a.cc:1:1: error: 'D' does not name a type
    1 | D, G = map(int, input().split())
      | ^
a.cc:6:13: error: expected unqualified-id before 'for'
    6 | cache = [{} for _ in range(D + 1)]
      |             ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
signed main(){
  int D,G; cin>>D>>G;
  vector<pii> P(D);
  rep(i,0,N) cin>>P[i].first>>P[i].second;
  int ans=MOD;
  rep(i,0,(1<<D)){
    bitset<10> B(i);
    int sum=0;
    int count=0;
    rep(j,0,D){
      if(B.test(j)){
        sum+=P[j].first*(j+1)*100+P[j].second;
        count+=P[j].first;
      }
    }
    for(int j=D-1;0<=j&&sum<G;j--){
      if(B.test(j)) continue;
      int K=G-sum;
      K/=100;
      K/=(j+1);
      K=min(K,P[j].first-1);
      sum+=(j+1)*100*K;
      count+=K;
    }
    if(sum>=G)
      ans=min(ans,count);
  }
  cout<<ans<<endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: 'N' was not declared in this scope
   18 |   rep(i,0,N) cin>>P[i].first>>P[i].second;
      |           ^
a.cc:3:47: note: in definition of macro 'rep'
    3 | #define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
      |                                               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
signed main(){
  int D,G; cin>>D>>G;
  vector<pii> P(N);
  rep(i,0,N) cin>>P[i].first>>P[i].second;
  int ans=MOD;
  rep(i,0,(1<<D)){
    bitset<10> B(i);
    int sum=0;
    int count=0;
    rep(j,0,D){
      if(B.test(j)){
        sum+=P[j].first*(j+1)*100+P[j].second;
        count+=P[j].first;
      }
    }
    for(int j=D-1;0<=j&&sum<G;j--){
      if(B.test(j)) continue;
      int K=G-sum;
      K/=100;
      K/=(j+1);
      K=min(K,P[j].first-1);
      sum+=(j+1)*100*K;
      count+=K;
    }
    if(sum>=G)
      ans=min(ans,count);
  }
  cout<<ans<<endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'N' was not declared in this scope
   17 |   vector<pii> P(N);
      |                 ^
Language: C++

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

#include <bits/stdc++.h>

using namespace std;

#define REP(i,n)   for(int i=0; i<(int)(n); i++)
#define FOR(i,b,e) for(int i=(b); i<=(int)(e); i++)
#define DUMP(a, n) REP(_i, n) printf("%d%c", a[_i], _i + 1 == n ? '\n' : ' ')
#define DUMP2D(a, n, m) REP(_i, n) REP(_j, m) printf("%d%c", a[_i][_j], _j + 1 == m ? '\n' : ' '); puts("")

const int D_MAX = 10;
const int P_I_MAX = 100;
const int C_I_MAX = 1e6;
const int INF = 1e9;

int D, G;
int p[D_MAX];
int c[D_MAX];

int v[D_MAX];

void solve() {
  REP(i, D) v[i] = (i + 1) * 100;
  int ans = INF;
  REP(s, 1 << D) {
    // printf("s: %d\n", s);
    int pb = 0;
    int sc = 0;
    REP(i, D) if (s >> i & 1) {
      pb += p[i];
      sc += v[i] * p[i] + c[i];
      // printf("  v: %d, pb: %d, sc:%d \n", v[i], p[i], v[i] * p[i] + c[i]);
    }a
    for (int i = D - 1; i >= 0; i--) if (!(s >> i & 1)) {
      if (sc >= G) break;
      int r = G - sc;
      int pb2 = min((r - 1) / v[i] + 1, p[i] - 1);
      pb += pb2;
      sc += v[i] * pb2;
      // printf("  v: %d, pb: %d, sc:%d \n", v[i], pb2, v[i] * pb2);
    }
    // printf("pb: %d, sc:%d \n", pb, sc);
    if (sc >= G) ans = min(ans, pb);
  }
  printf("%d\n", ans);
}

void input() {
  scanf("%d%d", &D, &G);
  REP(i, D) scanf("%d%d", p + i, c + i);
}

int main() {
  input();
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:34:6: error: 'a' was not declared in this scope
   34 |     }a
      |      ^
a.cc:35:25: error: 'i' was not declared in this scope
   35 |     for (int i = D - 1; i >= 0; i--) if (!(s >> i & 1)) {
      |                         ^
Language: C++

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

int main() {
  int depth, g;
  cin >> depth >> g;
  vector<int> problems(depth), completes(depth);

  // 入力受付
  for (int i = 0; i < depth; i++)
    cin >> problems[i] >> completes[i];
  
  int ans = 1e9; // 十分大きい値

  // bit全探索
  for (int bit = 0; bit < (1 << depth); bit++) {
    int score = 0, count = 0, m = -1;

    for (int iter_problem = 0; iter_problem < depth; iter_problem++){
      if (1 & (bit >> iter_problem)) {
        score += 100 * (iter_problem + 1) * problems[iter_problem] + completes[iter_broblem];
        count += problems[iter_problem];
      } else {
        m = iter_problem;
      }

      if (score < g) {
        int rest = 100 * (m + 1);
        int need = (g - score + rest - 1) / rest;
        if (need >= problems[m]){
          continue;
        }
        count += need;
      }
      ans = min(ans, count);
    }
  }

  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:80: error: 'iter_broblem' was not declared in this scope; did you mean 'iter_problem'?
   22 |         score += 100 * (iter_problem + 1) * problems[iter_problem] + completes[iter_broblem];
      |                                                                                ^~~~~~~~~~~~
      |                                                                                iter_problem
Language: C++

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


int main(){
  ll D, G;
  cin >> D >> G;
  vector<ll> p(D+1), c(D+1);
  for(int i=1; i<=D; i++) cin >> p.at(i) >> c.at(i);

  int ans = 1001001;
  //コンプリートする問題をbit全探索する
  vector<ll> comp_solve(D+1);
  for(int i=1; i<=D; i++) comp_solve[i] = 100*i*p[i] + c[i];
  
  for(int i=0; i<(1<<D);i++){//2^D回(最大1024回)ループ
    vector<bool> is_solve(D+1,false);
    int score = 0;
    int num_solve = 0;
    bool is_ok = false;//目標点を越えたらtrue
    for(int j=1; j<=D ; j++){//j*100点問題を解くか解かないのか?のD回ループ     
      if(i & (1<<(j-1))){//j*100点の問題を解くなら...
        //score += comp_solve[j];
        score += 100*j*p[j] + c[j]
        num_solve += p[j];
        is_solve[j] = true;
        //cout << " i: "<<i<<" j: "<<j <<" score: "<<score<<" num_solve: "<<num_solve<< endl;
        if(score >= G){
          is_ok = true;
          ans = min(ans, num_solve);
          //cout << "yah1" <<endl;
          break;//jループを抜ける
        }
      }
    }
    if(is_ok) continue;//iループを次へすすめる
    /*for(int j=D; j>=1; j--){
      cout << "is_solve["<<j<<"]: " << is_solve[j] << " ";
    } cout << endl;*/
    for(int j=D; j>=1; j--){//コンプリートしてない問題で一番得点の高い問題を数問解く(全完しない)
      if(is_solve[j]==true) continue;
      int left_score = G - score;
      int num = ceil( (double)left_score / (100*j));//切り上げ!!int同士の計算だと切り下げになるからdoubleにキャスト
      if(num <= p[i]){
        num_solve += num;
        score += num_solve* 100*j;
      }
      //cout << " left_score: " << left_score<<" num: " <<num<<endl;
      if(score >= G) ans = min(ans, num_solve);
      break;//コンプリートしない問題は１種類だけなのでjループを抜ける
    }
  }
  
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:35: error: expected ';' before 'num_solve'
   26 |         score += 100*j*p[j] + c[j]
      |                                   ^
      |                                   ;
   27 |         num_solve += p[j];
      |         ~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
const int MOD = 1000000007;
const int INF = numeric_limits<int>::max() / 2;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int D, G;
    cin >> D >> G;
    pair<pair<int,int>, int> P[D];
    rep(i,D){
      P[i].first.first = (i+1) * 100;
      cin >> P[i].first.second >> P[i].second;
    }
    reverse(P, P+D);
    int ans = INF;
    for(int i=0;i<(1<<D);i++){
      int sum = 0;
      int cou1 = 0;
      for(int j=0;j<D;j++){
        if((1<<j) & i){
          sum += P[j].first.first * P[j].first.second;
          sum += P[j].second;
          cou1 += P[j].first.second;
        }
      }
      if(sum >= G){
        ans = min(ans, cou1);
        continue;
      }
      for(int j=0;j<D;j++){
        if(((1<<j) & i) == 0){
          if(G <= sum + (P[j].first.first * (P[j].first.second-1))){
            cou1 += (G-sum)/P[j].first.first;
            ans = min(ans, cou1);
            continue;
          }
          else{
            sum += P[j].first.first * (P[j].first.second-1);
            cou1 += P[j].first.second-1;
          }
        }
      }
    }
    cout << ans << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:49:25: error: expected '}' at end of input
   49 |     cout << ans << endl;
      |                         ^
a.cc:8:14: note: to match this '{'
    8 | signed main(){
      |              ^
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  ll d,g;
  cin>>d>>g;
  vll p(d),c(d);
  rep(i,d) cin>>p[i]>>c[i];
  ll ans=INF;
  for(int bit=0;bit<(1<<d);bit++){
    ll cu=0;
    ll cc=0;
    ll k=0;
    for(int i=0;i<d;i++){
      if(bit&(1<<i)){
        cu+=100*(i+1)*p[i]+c[i];
        cc+=p[i];
      }
      else{
        k=i;
      }
    }
    if(cu<g){
      ll j=(g-cu+100*(i+1)-1)/(100*(i+1));
      if(j<p[i]){
        cc+=j;
        ans=min(cc,ans);
      }
    }
    else{
      ans=min(cc,ans);
    }
  }
  COUT(ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:23: error: 'i' was not declared in this scope
   58 |       ll j=(g-cu+100*(i+1)-1)/(100*(i+1));
      |                       ^
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  ll d,g;
  cin>>d>>g;
  vll p(d),c(d);
  rep(i,d) cin>>p[i]>>c[i];
  ll ans=INF;
  for(int bit=0;bit<(1<<d);bit++){
    ll cu=0;
    ll c=0;
    ll k=0;
    for(int i=0;i<d;i++){
      if(bit&(1<<i)){
        cu+=100*(i+1)*p[i]+c[i];
        c+=p[i];
      }
      else{
        k=i;
      }
    }
    if(cu<g){
      ll j=(g-cu+100*(i+1)-1)/(100*(i+1));
      if(j<p[i]){
        c+=j;
        ans=min(c,ans);
      }
    }
    else{
      ans=min(c,ans);
    }
  }
  COUT(ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:29: error: invalid types 'long long int[int]' for array subscript
   50 |         cu+=100*(i+1)*p[i]+c[i];
      |                             ^
a.cc:58:23: error: 'i' was not declared in this scope
   58 |       ll j=(g-cu+100*(i+1)-1)/(100*(i+1));
      |                       ^
Language: C++

#include <iostream>
#include <sstream>
#include <regex>
#include <cstdio>
#include <cmath>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include <iomanip>
#include  <cassert>
#include <fstream>
#include <codecvt>
#include <bitset>
#include <cassert>
#include <cstdint>

using namespace std;
using ll = long long int;
using ullong = unsigned long long;
#define rep(i,n) for(int i = 0; i < n; i++)
#define FOR(i, a, b)  for(int i = (a); i < (b) ; i++)
#define pb push_back
#define SORT(v,n) sort(v, v+n)
#define ALL(x) (x).begin(),(x).end()
#define debug(x) cerr << #x << ": " << x << '\n'
#define elif else if
//#define llint
#ifdef llint
#define int ll
static const int INF = LLONG_MAX;
#else
static const int INF = INT_MAX;
#endif // llint
static const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
int dx[8] = { 1, 0, -1, 0, 1, -1, -1, 1 };
int dy[8] = { 0, 1, 0, -1, 1, 1, -1, -1 };

signed main() {
	ios::sync_with_stdio(true);
	
	int d, g;
	cin >> d >> g;
	vector<int> p(15);
	vector<int> c(15);
	int ans = INF;
	rep(i, d) {
		cin >> p[i] >> c[i];
	}

	rep(bit, (1 << d)) {
		int sum = 0;
		int numSolve = 0;
		rep(i, d) {
			if (bit & (1 << i)) {
				numSolve += p[i];
				sum += c[i];
				auto x = p[i] * (i + 1) * 100;
				sum += x;
			}
		}
		if (sum >= g) {
			if (ans > numSolve)
				ans = numSolve;
		}else {
			int ld = d;
			vector<int> ns(15, 0);
			int unsolved = 0;
			rep(i,d){
				if (!(bit & (1 << i))) {
					unsolved = i;
				}
			}
			rep(i, p[unsolved] - 1) {
				sum += (unsolved + 1) * 100;
				numSolve++;
				if (sum >= g) {
					if (ans > numSolve)
						ans = numSolve;
					break;
				}
			}
		}
	}

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc:39:24: error: 'INT_MAX' was not declared in this scope
   39 | static const int INF = INT_MAX;
      |                        ^~~~~~~
a.cc:23:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   22 | #include <cstdint>
  +++ |+#include <climits>
   23 |
Language: C++

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

int main() {
  int d,g;
  cin >> d >> g;
  vector<int> num(d), point(d);
  for (int i=0;i<d;i++) {
    cin >> num.at(i) >> point.at(i);
  }
  
  int ans=1e9;
  for (int check; check < (1 << d); check++) {
    int sum=0, count=0, rest=-1;
    for (int i=0;i<d;i++) {
      if((check >> i) & 1) {
        sum+=100*(i+1)*num.at(i)*+point.at(i);
        count+=num.at(i);
      }
      else {
        rest=i;
      }
    }
    if(sum<g) {
      int temp_sum=100*(rest+1);
      int need=(g-sum+temp_sum-1)/temp_sum;
      if(need > count.at(rest)) {
        continue;
      }
      count+=need;
    }
    ans=min(ans,count);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:23: error: request for member 'at' in 'count', which is of non-class type 'int'
   27 |       if(need > count.at(rest)) {
      |                       ^~
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);
  int m=1005; //解く問題の最小数
  for(int i=0;i<(1<<d);i++){
    int sum=0; //合計点
    int cnt=0; //解いた問題の数
    for(int j=0;j<d;j++){
      if(i>>j & 1){
        sum+=c[j];
        cnt+=p[j];
      }
    }
    while(sum<g){
      for(int k=d-1;k>=0;k--){
        if(i>>k & 1){
          break;
        }
        else{
          for(int l=1;l=<p[k];l++){
            sum+=100*(k+1);
            cnt++;
            if(sum>=g){
              goto end;
            }
          }
        }
      }
    }
    end:
    m=min(m,cnt);
  }
  cout << m << endl;
            
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:25: error: expected primary-expression before '<' token
   26 |           for(int l=1;l=<p[k];l++){
      |                         ^
Language: C++

d,g=map(int,input().split())
g=g//100
pc=[list(map(int,input().split())) for i in range(d)]
P=0
C=0#合計
for i in range(d):
    pc[i][1]=pc[i][1]//100
    C=(C+pc[i][1]+pc[i][0]*(i+1))
    P+=pc[i][0]
dp=[10000000]*(C+1)
for i in range(d):
    dp_sub=[10000000]*(C+1)
    for j in range(C+1):
        if j==0:
            for k in range(1,pc[i][0]+1):
                if k!=pc[i][0]:
                    dp_sub[k*(i+1)]=k
                else:
                    dp_sub[k*(i+1)+pc[i][1]]=k
        elif dp[j]!=10000000:
            for k in range(1,pc[i][0]+1):
                if k!=pc[i][0]:
                    dp_sub[j+k*(i+1)]=min(dp[j]+k,dp_sub[j+k*(i+1)])
                else:
                    dp_sub[j+k*(i+1)+pc[i][1]]=min(dp[j]+k,dp_sub[j+k*(i+1)+pc[i][1]])

    for j in range(C+1):
        if dp_sub[j]!=0:
            dp[j]=min(dp[j],dp_sub[j])
m=P
for i in range(g,C+1):
    if dp[i]!=0:
        m=min(m,dp[i])
print(m)


Compiler output:
a.cc:5:4: error: stray '#' in program
    5 | C=0#合計
      |    ^
a.cc:1:1: error: 'd' does not name a type
    1 | d,g=map(int,input().split())
      | ^
Language: C++

						sum += 100*(i+1);
						++ num;
					}
			}
			res = min(res, num);
		}
	}
	cout << res << endl;
}


Compiler output:
a.cc:1:49: error: 'sum' does not name a type
    1 |                                                 sum += 100*(i+1);
      |                                                 ^~~
a.cc:2:49: error: expected unqualified-id before '++' token
    2 |                                                 ++ num;
      |                                                 ^~
a.cc:3:41: error: expected declaration before '}' token
    3 |                                         }
      |                                         ^
a.cc:4:25: error: expected declaration before '}' token
    4 |                         }
      |                         ^
a.cc:5:25: error: 'res' does not name a type
    5 |                         res = min(res, num);
      |                         ^~~
a.cc:6:17: error: expected declaration before '}' token
    6 |                 }
      |                 ^
a.cc:7:9: error: expected declaration before '}' token
    7 |         }
      |         ^
a.cc:8:9: error: 'cout' does not name a type
    8 |         cout << res << endl;
      |         ^~~~
a.cc:9:1: error: expected declaration before '}' token
    9 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
 
const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;
ll gcd(ll x, ll y){
  if(y==0) return x;
  else return gcd(y, x%y);
}
ll lcm(ll x,ll y){
  ll g=gcd(x,y);
  return x/g*y;
}

int main(){
  int d,g;
  cin >> d >> g;
  vector<int>p(d);
  vector<int>c(d);
  rep(i,d) cin >> p[i] >> c[i];
    
  ll ans = INFL;
  for(int bit = 0;bit < (1<<d); bit++){
    ll sum = 0,num = 0,rest_max = -1;
    rep(i,d){
      if(bit & (1<<i)){
        sum += c[i]+p[i]*100*(i+1);　//ボーナスポイント含めて決め打ち
        num += p[i];
      }   
      else rest_max = i;
    }
    if(sum<g){
      int sum1 = 100*(rest_max+1);
      int need = (g-sum+sum1-1)/sum1; //最低個数は繰り上がりなので
      if(need>=p[rest_max]) continue; //超えたらbit選定からやり直し
      num += need;
    }
    ans = min(ans,num);
  }
  cout << ans << endl;
  
}


Compiler output:
a.cc:31:36: error: extended character 　 is not valid in an identifier
   31 |         sum += c[i]+p[i]*100*(i+1);　//ボーナスポイント含めて決め打ち
      |                                    ^
a.cc: In function 'int main()':
a.cc:31:36: error: '\U00003000' was not declared in this scope
   31 |         sum += c[i]+p[i]*100*(i+1);　//ボーナスポイント含めて決め打ち
      |                                    ^~
Language: C++

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

int main(){
  int n,g,p[11],c[11]; cin>>n>>g;
  for(int i=0;i<n;i++){
    cin>>p[i]>>c[i];
  }int ans=100000000;
  for(int bit=0;bit<(1<<n);bit++){
    int sum=0,num=0,rest_max;
    for(int i=0;i<n;i++){
      if(bit &(1<<i)){
        sum+=100*(i+1)*p[i]+c[i];
        num+=p[i];
      }else rest_max=i;
    }
    if(s<g){
      int s=100*(rest_max+1);
      int x=(g-sum+s-1)/s;
      if(x>=p[rest_max]){
        continue;
      }num+=x;
    }else{
      ans=min(ans,num);
    }
  }cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:8: error: 's' was not declared in this scope
   17 |     if(s<g){
      |        ^
a.cc:18:11: error: redeclaration of 'int s'
   18 |       int s=100*(rest_max+1);
      |           ^
a.cc:17:8: note: '<typeprefixerror>s' previously declared here
   17 |     if(s<g){
      |        ^
Language: C++

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

int main(){
  int N,G; cin>>N>>G;
  vector<int> num(N),bonus(N);
  for(int i=0;i<N;i++){
    cin>>num[i]>>bonus[i];
  }vector<vector<int>> ans(1200,vector<int>);
  int count=0,minnum=1000000000;
  for(int bit=1;bit<(1<<N);bit++){
    long long sum=0,problem=0;
    for(int i=0;i<N;i++){
      if(bit & (1<<i)){
        ans[count].push_back(bonus[i]);
        sum+=bonus[i];
        problem+=num[i];
      }
    }if(sum>=G){
      if(minnum>problem){
        minnum=problem;
      }
    }
    count++;
  }
  if(minnum!=1000000000){
    cout<<minnnum<<endl;
  }else{
    int x=0,i=N-1,y=0;
    while(x<G){
      y++;
      x+=(i+1)*100;
      num[i]--;
      if(num[i]==0){
        x+=bonus[i];
        i--;
      }
    }cout<<y<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:44: error: expected primary-expression before ')' token
    9 |   }vector<vector<int>> ans(1200,vector<int>);
      |                                            ^
a.cc:27:11: error: 'minnnum' was not declared in this scope; did you mean 'minnum'?
   27 |     cout<<minnnum<<endl;
      |           ^~~~~~~
      |           minnum
Language: C++

#include<iostream>
#include<sstream>
#include<cstring>
#include<math.h>
using namespace std;

int main(){

    int d,g, i,j;
    int *p, *c, *p_cp;
    int sum = 0;
    int probNum = 0;
    int minProbNum = 0;

    scanf("%d", &d);
    scanf("%d", &g);
    p = new int[d];
    p_cp = new int[d];
    c = new int[d];
    for(i = 0; i < d; i++){
        scanf("%d", &p[i]);
        scanf("%d", &c[i]);
        p_cp[i] = p[i];
        minProbNum += p[i];
    }

    for(i = 0; i < (int)pow(2, d); i++){

        sum = 0;
        probNum = 0;
        for(j = 0; j < d; j++){
            p_cp[j] = p[j];
        }

        for(j = 0; j < d; j++){
            if((1&(i>>j))==1){
                sum += (100*p_cp[j]*(j+1) + c[j]);
                probNum += p_cp[j];
                p_cp[j] = 0;
            }
        }


        for(j = d-1; j >= 0; j--){
            while((p_cp[j] > 1) && (sum < g)){
                sum += 100*(j+1);
                p_cp[j]--;
                probNum++;
            }
        }

        if(sum >= g){
            if(probNum < minProbNum){
                minProbNum = probNum;
            }
        }

    }

    printf("%d\n", minProbNum);

    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:62:14: error: expected '}' at end of input
   62 |     return 0;
      |              ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

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


int main(){
long long int a,b[15],c[15],d;
cin >> a >> d;

  for(int i=1;i<=a;i++){
    cin >> b[i] >> c[i];
  }
  for(int i=a;i>=1;i--){
    
    if(a <= i*100*b[i]){
      cout << a/(i*100) << endl;
      return 0;
    }
    a -=(i*100*b[i]-c[i]);
  }
  
  
 

Compiler output:
a.cc: In function 'int main()':
a.cc:19:4: error: expected '}' at end of input
   19 |   }
      |    ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <stdio.h>
#include <string>
#include <stdlib.h>
#include <cstdlib>

using namespace std;
typedef long long ll;

void calc(int D, ll G, int count, int &ans, ll sum, vector<vector<int>> vec, int i){
  if(sum >= G){
    if(count < ans){
      ans = count;
    }
    return ;
  }
  while(i < D){
    if(vec[0][i] > 0){
      sum += 100 * (i+1);
      count ++;
      vec[0][i] --;
      if(vec[0][i] == 0){
        sum += vec[1][i];
      }
      //cout << "i:" << i << " " << vec[0][0] << " " << vec[0][1] << " count:" << count << " ans:" << ans << " sum:" << sum <<endl;
      calc(D,G,count,ans,sum,vec,i);
      if(sum >= G){
        return;
      }
    }
    i++;
  }
  return ;
}

int answer(int D, ll G, int count, int &ans, ll sum, vector<vector<int>> vec, int i){
  while(i < D){
  calc(D,G,count,ans,sum,vec,i);
  i++;
}
  return ans;
}

int main(){
  int D;
  ll G;
  int count = 0, ans = 9999999, i = 0;
  ll sum = 0, ;
  cin >> D >> G;
  vector<vector<int>> vec(2, vector<int>(D));
  for(int i = 0; i < D; i++){
    cin >> vec[0][i] >> vec[1][i];
  }
  cout << answer(D,G,count,ans,sum,vec,i);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:15: error: expected unqualified-id before ';' token
   52 |   ll sum = 0, ;
      |               ^
Language: C++

#include<iostream>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
typedef long long ll;

int main(){
    int d, g;
    cin >> d >> g;
    int p[d], c[d];
    rep(i,d) cin >> p[i] >> c[i];
    int ans = 1000000000;

    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;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:26: error: expected ')' before ';' token
   31 |         ans = min(ans,num;)
      |                  ~       ^
      |                          )
a.cc:31:27: error: expected primary-expression before ')' token
   31 |         ans = min(ans,num;)
      |                           ^
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <stdio.h>
#include <string>
#include <stdlib.h>
#include <cstdlib>

using namespace std;
typedef long long ll;

int calc(int G, int D, vector<vector<int>> vec){
  int count = 0;
  int countP = 0;
  int M, Mi = 0;
  int M1, M2;
  int M1i, M2i;
  int P = 102;
  vector<bool> check(D);
  while(true){
    countP = count;
  for(int i = 0; i < D; i++){
    if(G - vec[3][i] >= 0){
      check[i] = true;
    }
    else{
      if(P > vec[0][i] + countP){
        P = vec[0][i] + countP;
      }
      check[i] = false;
    }
  }
  M1 = 0;
  M1i = 0;
  for(int i = 0; i < D; i++){
    if(M1 < vec[5][i] && check[i]){
      M1 = vec[5][i];
      M1i = i;
    }
  }
  M2 = 0;
  M2i = 0;
  for(int i = 0; i < D; i++){
    if(M2 < vec[4][i]){
      M2 = vec[4][i];
      M2i = i;
    }
  }
  if(M1 > M2){
    M = M1;
    Mi = M1i;
    G -= vec[3][Mi];
    count += vec[0][Mi];
    vec[3][Mi] = 0;
    vec[4][Mi] = 0;
    vec[5][Mi] = 0;
    }
  }
  else{
    M = M2;
    Mi = M2i;
    while(G > 0){
      G -= M;
      count ++;
    }
    return min(count, P);
  }
}
}

int main(){
  int D,G;
  cin >> D >> G;
  vector<vector<int>> vec(6, vector<int>(D));
  for(int i = 0; i < D; i++){
    cin >> vec[0][i] >> vec[1][i];
  }
  for(int i = 0; i < D; i++){
      vec[2][i] = 100*(i+1)*vec[0][i];
      vec[3][i] = 100*(i+1)*vec[0][i] + vec[1][i];
      vec[4][i] = (i+1)*100;
      vec[5][i] = (100 * (i+1) * vec[0][i] + vec[1][i])/vec[0][i];
    }
    /*for(int i = 0; i < 6; i++){
        cout << vec[i][0] << " " << vec[i][1] << " " << vec[i][2] << " " << vec[i][3] << " " << vec[i][4] <<endl;
      }*/
  cout << calc(G, D, vec) <<endl;


}


Compiler output:
a.cc: In function 'int calc(int, int, std::vector<std::vector<int> >)':
a.cc:61:3: error: 'else' without a previous 'if'
   61 |   else{
      |   ^~~~
a.cc: At global scope:
a.cc:71:1: error: expected declaration before '}' token
   71 | }
      | ^
Language: C++

#include<bits/stdc++.h>
#include<iostream>
using namespace std;
 
template <class T> using V = vector<T>;
 
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
 
using ll = long long;
using vll = V<ll>;


/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  int d,g;
    cin>>d>>g;
  vll A(d);
  vll B(d);
  FOR(i,0,d){
    ll a,b;
      cin>>a>>b;
    A[i]=100*a*(i+1)+b;//全完したら何点か
    B[i]=a;//何回か
  }
  
  int ans=100000;
  
  //bit全探索
  for(int bit=0;bit<(1<<d);bit++){
      int now=0;//今の時点での合計点
      int count=0;//今の時点での回数
      int half=0;//中途半端に解く問題の点数
      bool b=true;

    for(int i=d-1;i>=0;i--){

      if(bit&(1<<i)){
        now+=A[i];
        count+=B[i];
      }//全完するのを選ぶ

      else if(b){
        half=i;
        b=false;
      }//中途半端に解くのを選ぶ
    }
      int n=B[half];
    for(int j=0;j<=n;j++){
      if(now>=g){
         chmin(ans,count);
         break;
      }

      else{
        now+=(half+1)*100;
        count++;
      }
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:7: error: 'i' was not declared in this scope
   31 |   FOR(i,0,d){
      |       ^
a.cc:31:3: error: 'FOR' was not declared in this scope
   31 |   FOR(i,0,d){
      |   ^~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;


int main() {
  int d, g;
  cin >> d;
  cin >> g;

  vector<int> p(d);
  vector<int> c(d);
  int totalProblems = 0;
  for (int i = 0; i < d; i++) {
    int t;
    cin >> t;
    p[i] = t;
    totalProblems += t;

    cin >> t;
    c[i] = t;
  }

  int result = totalProblems;
  for (int pat = 1; pat < (1 << d); pat++) {
    // cout << pat << endl;
    int score = 0;
    int problems = 0;
    int rest_max = -1;
    for (int i = 0; i < d; i++) {
      if (!(pat & (1 << i))) {
	continue;
      } else {
	rest_max = i;
      }

      problems += p[i];
      score += p[i] * 100 * (i + 1) + c[i];
    }

    // cout << score << endl;
    if (score < g) {
      int rest = g - score;
      if (100 * (rest_max + 1) < rest)
      int need = ceil((float)rest / (100 * (rest_max + 1)));
      problems += need;
    }

    result = min(result, problems);
  }

  cout << result << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:48:19: error: 'need' was not declared in this scope
   48 |       problems += need;
      |                   ^~~~
Language: C++

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

int min_number(vector<vector<int>> &score, int g, int sum, int cnt){
  
  if (
}

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);
  
  vector<vector<int>> score(d);
  for (int i=0; i<d; i++){
    for (int j=0; j<p.at(i); j++){
      if (j==0)
        score.at(i).push_back((i+1)*100);
      else if (j==p.at(i)-1)
        score.at(i).push_back((i+1)*100+score.at(i).at(j-1)+c.at(i));
      else
        score.at(i).push_back((i+1)*100+score.at(i).at(j-1));
    }
  }
  /* こんな感じの雰囲気の二次元配列
     100 200 300 400 900         // 100 100 100 100 500
     200 400 600 1500            // 200 200 200 900
     300 1200                    // 300 900
     400 800 1200 1600 2000 3200 // 400 400 400 400 400 1200
     5000                        // 5000
  */
  
  int sum = 0;
  int cnt = 9999;
  cout << min_number(score, g, sum, cnt) <<endl;
}


Compiler output:
a.cc: In function 'int min_number(std::vector<std::vector<int> >&, int, int, int)':
a.cc:7:1: error: expected primary-expression before '}' token
    7 | }
      | ^
a.cc:6:7: error: expected ')' before '}' token
    6 |   if (
      |      ~^
      |       )
    7 | }
      | ~      
a.cc:7:1: error: expected primary-expression before '}' token
    7 | }
      | ^
a.cc:7:1: warning: no return statement in function returning non-void [-Wreturn-type]
Language: C++

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

int point(const std::vector<std::vector<int>>& p, const std::vector<int>& a)
{
  int s = 0;
  for (int i = 0; i < a.size(); i++) {
    s += p[i][a[i]];
  }

  return s;
}

int solve(const std::vector<std::vector<int>>& p, int G, const std::vector<int>& a)
{
  int count = std::accumulate(std::begin(a), std::end(a), 0);
  int po = point(p, c, a);
  if (po < G) return 10000000;

  int min_sc = count;
  for (int i = 0; i < a.size(); i++) {
    if (a[i] == 0) continue;

    std::vector<int> b = a;
    b[i]--;
    
    int sc = solve(p, G, a);
    if (sc < min_sc) {
      min_sc = sc;
    }
  }

  return min_sc;
}

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

  std::vector<std::vector<int>> p(D);
  std::vector<int> c(D);

  for (int i = 0; i < D; i++) {
    int cc;
    std::cin >> c[i];
    std::cin >> cc;

    for (int j = 0; j <= c[i]; j++) {
      int pc = i * 100;
      if (j == c[i]) pc += cc;
      p[i].push_back(pc);
    }
  }

  int ans = solve(p, G, c);
  std::cout << ans << std::endl;

  return 0;
}

Compiler output:
a.cc: In function 'int solve(const std::vector<std::vector<int> >&, int, const std::vector<int>&)':
a.cc:19:21: error: 'c' was not declared in this scope
   19 |   int po = point(p, c, a);
      |                     ^