Language: C++

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define INF 100000000
using namespace std;
const int mod = 1000000007;

int main() {

    int D,G,fans=100;
    cin>>D>>G;
    vector<tuple<int,int,int>> A(D);
    for(int i=0; i<N; i++){
      cin>>get<0>(A[i])>>get<1>(A[i]);
      get<2>(A[i])=(i+1)*100*get<0>A[i]+get<1>A[i];
    }
  for (int i = 0; i < (1 << 10); i++) {
    bitset<10> s(i);
    int sum=0,firstscore=-1,ans=0;
    for(int j=0;j<10;j++){
      if(s.test(N-j-1)){
        sum+=get<2>(A[j]);
        ans+=get<0>A[j];
        if(firstscore==-1)firstscore=j;}}
    if(((G-sum)/(j+1)*100)>=get<0>A[j])ans-=get<0>A[j];
    else ans-=(G-sum)/(j+1)*100);
    fans=min(fans,ans);
}
    cout << fans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: 'N' was not declared in this scope
   12 |     for(int i=0; i<N; i++){
      |                    ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant: In instantiation of 'struct std::variant_alternative<0, std::variant<> >':
/usr/include/c++/14/variant:106:11:   required by substitution of 'template<long unsigned int _Np, class _Variant> using std::variant_alternative_t = typename std::variant_alternative::type [with long unsigned int _Np = 0; _Variant = std::variant<>]'
  106 |     using variant_alternative_t =
      |           ^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/variant:1748:5:   required from here
 1748 |     get(const variant<_Types...>&& __v)
      |     ^~~
/usr/include/c++/14/variant:100:25: error: static assertion failed
  100 |       static_assert(_Np < sizeof...(_Types));
      |                     ~~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/variant:100:25: note: the comparison reduces to '(0 < 0)'
In file included from /usr/include/c++/14/bits/stl_pair.h:62,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/utility.h: In instantiation of 'struct std::_Nth_type<0>':
/usr/include/c++/14/variant:102:13:   required from 'struct std::variant_alternative<0, std::variant<> >'
  102 |       using type = typename _Nth_type<_Np, _Types...>::type;
      |             ^~~~
/usr/include/c++/14/variant:106:11:   required by substitution of 'template<long unsigned int _Np, class _Variant> using std::variant_alternative_t = typename std::variant_alternative::type [with long unsigned int _Np = 0; _Variant = std::variant<>]'
  106 |     using variant_alternative_t =
      |           ^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/variant:1748:5:   required from here
 1748 |     get(const variant<_Types...>&& __v)
      |     ^~~
/usr/include/c++/14/bits/utility.h:237:13: error: '__type_pack_element' index is out of range
  237 |     { using type = __type_pack_element<_Np, _Types...>; };
      |             ^~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
                 from /usr/include/c++/14/string:68,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/tuple: In instantiation of 'struct std::tuple_element<0, std::tuple<> >':
/usr/include/c++/14/bits/utility.h:84:11:   required by substitution of 'template<long unsigned int __i, class _Tp> using std::__tuple_element_t = typename std::tuple_element::type [with long unsigned int __i = 0; _Tp = std::tuple<>]'
   84 |     using __tuple_element_t = typename tuple_element<__i, _Tp>::type;
      |           ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/tuple:2466:5:   required from here
 2466 |     get(const tuple<_Elements...>&& __t) noexcept
      |     ^~~
/usr/include/c++/14/tuple:2422:25: error: static assertion failed: tuple index must be in range
 2422 |       static_assert(__i < sizeof...(_Types), "tuple index must be in range");
      |                     ~~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/tuple:2422:25: note: the comparison reduces to '(0 < 0)'
a.cc:14:30: error: use of deleted function 'constexpr std::__enable_if_t<(__i >= sizeof... (_Types))> std::get(const tuple<_Elements ...>&) [with long unsigned int __i = 0; _Elements = {}; __enable_if_t<(__i >= sizeof... (_Types))> = void]'
   14 |       get<2>(A[i])=(i+1)*100*get<0>A[i]+get<1>A[i];
      |                              ^~~~~~
/usr/include/c++/14/tuple:2476:5: note: declared here
 2476 |     get(const tuple<_Elements...>&) = delete;
      |     ^~~
a.cc:14:30: error: use of deleted function 'constexpr std::__enable_if_t<(__i >= sizeof... (_Types))> std::get(const tuple<_Elements ...>&) [with long unsigned int __i = 0; _Elements = {}; __enable_if_t<(__i >= sizeof... (_Types))> = void]'
   14 |       get<2>(A[i])=(i+1)*100*get<0>A[i]+get<1>A[i];
      |                              ^~~~~~
/usr/include/c++/14/tuple:2476:5: note: declared here
 2476 |     get(const tuple<_Elements...>&) = delete;
      |     ^~~
a.cc:14:29: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator*'
   14 |       get<2>(A[i])=(i+1)*100*get<0>A[i]+get<1>A[i];
      |                    ~~~~~~~~~^~~~~~~
      |                         |    |
      |                         int  <unresolved overloaded function type>
a.cc:20:17: error: 'N' was not declared in this scope
   20 |       if(s.test(N-j-1)){
      |                 ^
a.cc:22:14: error: use of deleted function 'constexpr std::__enable_if_t<(__i >= sizeof... (_Types))> std::get(const tuple<_Elements ...>&) [with long unsigned int __i = 0; _Elements = {}; __enable_if_t<(__i >= sizeof... (_Types))> = void]'
   22 |         ans+=get<0>A[j];
      |              ^~~~~~
/usr/include/c++/14/tuple:2476:5: note: declared here
 2476 |     get(const tuple<_Elements...>&) = delete;
      |     ^~~
a.cc:22:14: error: use of deleted function 'constexpr std::__enable_if_t<(__i >= sizeof... (_Types))> std::get(const tuple<_Elements ...>&) [with long unsigned int __i = 0; _Elements = {}; __enable_if_t<(__i >= sizeof... (_Types))> = void]'
   22 |         ans+=get<0>A[j];
      |              ^~~~~~
/usr/include/c++/14/tuple:2476:5: note: declared here
 2476 |     get(const tuple<_Elements...>&) = delete;
      |     ^~~
a.cc:22:12: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   22 |         ans+=get<0>A[j];
      |         ~~~^~~~~~~~
a.cc:22:12: error: invalid conversion from 'std::__enable_if_t<true, void> (*)(const std::tuple<>&)' {aka 'void (*)(const std::tuple<>&)'} to 'int' [-fpermissive]
   22 |         ans+=get<0>A[j];
      |         ~~~^~~~~~~~
      |            |
      |            std::__enable_if_t<true, void> (*)(const std::tuple<>&) {aka void (*)(const std::tuple<>&)}
a.cc:22:20: error: expected ';' before 'A'
   22 |         ans+=get<0>A[j];
      |                    ^
      |                    ;
a.cc:24:18: error: 'j' was not declared in this scope
   24 |     if(((G-sum)/(j+1)*100)>=get<0>A[j])ans-=get<0>A[j];
      |                  ^
a.cc:24:35: error: expected ')' before 'A'
   24 |     if(((G-sum)/(j+1)*100)>=get<0>A[j])ans-=get<0>A[j];
      |       ~                           ^
      |                                   )
a.cc:24:45: error: use of deleted function 'constexpr std::__enable_if_t<(__i >= sizeof... (_Types))> std::get(const tuple<_Elements ...>&) [with long unsigned int __i = 0; _Elements = {}; __enable_if_t<(__i >= sizeof... (_Types))> = void]'
   24 |     if(((G-sum)/(j+1)*100)>=get<0>A[j])ans-=get<0>A[j];
      |                                             ^~~~~~
/usr/include/c++/14/tuple:2476:5: note: declared here
 2476 |     get(const tuple<_Elements...>&) = delete;
      |     ^~~
a.cc:24:45: error: use of deleted function 'constexpr std::__enable_if_t<(__i >= sizeof... (_Types))> std::get(const tuple<_Elements ...>&) [with long unsigned int __i = 0; _Elements = {}; __enable_if_t<(__i >= sizeof... (_Types))> = void]'
   24 |     if(((G-sum)/(j+1)*100)>=get<0>A[j])ans-=get<0>A[j];
      |                                             ^~~~~~
/usr/include/c++/14/tuple:2476:5: note: declared here
 2476 |     get(const tuple<_Elements...>&) = delete;
      |     ^~~
a.cc:24:43: error: invalid operands of types 'int' and 'std::__enable_if_t<true, void> (*)(const std::tuple<>&)' {aka 'void (*)(const std::tuple<>&)'} to binary 'operator-'
   24 |     if(((G-sum)/(j+1)*100)>=get<0>A[j])ans-=get<0>A[j];
      |                                        ~~~^~~~~~~~
a.cc:24:43: note:   in evaluation of 'operator-=(int, std::__enable_if_t<true, void> (*)(const class std::tuple<>&) {aka void (*)(const class std::tuple<>&)})'