Language: C++

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

int main()
{
    ll n, k;
    cin >> n >> k;

    vector<int, int> ab;
    rep(i, 0, n)
    {
        int a, b;
        cin >> a >> b;
        ab.emplace_back(a, b);
    }
    sort(ab.begin(), ab.end());

    int now = -1;
    for (int i = 0; i < ab.size() and k > 0; i++)
    {
        now = ab[i].first;
        k -= ab[i].second;
    }
    cout << now << endl;
    return 0;
}

Compiler output:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'struct std::_Vector_base<int, int>':
/usr/include/c++/14/bits/stl_vector.h:428:11:   required from 'class std::vector<int, int>'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
a.cc:11:22:   required from here
   11 |     vector<int, int> ab;
      |                      ^~
/usr/include/c++/14/bits/stl_vector.h:87:28: error: 'int' is not a class, struct, or union type
   87 |         rebind<_Tp>::other _Tp_alloc_type;
      |                            ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:89:9: error: 'int' is not a class, struct, or union type
   89 |         pointer;
      |         ^~~~~~~
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'class std::vector<int, int>':
a.cc:11:22:   required from here
   11 |     vector<int, int> ab;
      |                      ^~
/usr/include/c++/14/bits/stl_vector.h:518:20: error: '_M_allocate' has not been declared in 'std::vector<int, int>::_Base'
  518 |       using _Base::_M_allocate;
      |                    ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:519:20: error: '_M_deallocate' has not been declared in 'std::vector<int, int>::_Base'
  519 |       using _Base::_M_deallocate;
      |                    ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:521:20: error: '_M_get_Tp_allocator' has not been declared in 'std::vector<int, int>::_Base'
  521 |       using _Base::_M_get_Tp_allocator;
      |                    ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33:
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_Vector_impl() [with _Tp = int; _Alloc = int]':
a.cc:11:22:   required from here
   11 |     vector<int, int> ab;
      |                      ^~
/usr/include/c++/14/bits/stl_vector.h:136:24: error: 'int' is not a class, struct, or union type
  136 |         _Vector_impl() _GLIBCXX_NOEXCEPT_IF(
      |                        ^~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:16:12: error: 'class std::vector<int, int>' has no member named 'emplace_back'
   16 |         ab.emplace_back(a, b);
      |            ^~~~~~~~~~~~
a.cc:18:13: error: 'class std::vector<int, int>' has no member named 'begin'
   18 |     sort(ab.begin(), ab.end());
      |             ^~~~~
a.cc:18:25: error: 'class std::vector<int, int>' has no member named 'end'
   18 |     sort(ab.begin(), ab.end());
      |                         ^~~
a.cc:23:17: error: no match for 'operator[]' (operand types are 'std::vector<int, int>' and 'int')
   23 |         now = ab[i].first;
      |                 ^
a.cc:24:16: error: no match for 'operator[]' (operand types are 'std::vector<int, int>' and 'int')
   24 |         k -= ab[i].second;
      |                ^
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_Vector_impl() [with _Tp = int; _Alloc = int]':
/usr/include/c++/14/bits/stl_vector.h:314:7:   required from here
  314 |       _Vector_base() = default;
      |       ^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:141:26: error: 'int' is not a class, struct, or union type
  141 |         : _Tp_alloc_type()
      |                          ^