Language: C++

#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
const int INF= 1e9+5;
typedef long long ll;
  priority_queue<ll>Q;
  vector<ll>data[100010];
int main(){
  ll n,m;cin>>n>>m;
  for(int i=0;i<n;i++){
    ll a,b; cin>>a>>b;
    data[a].push_back(b);
  }
  ll ans=0;
  for(int i=1;i<=m;i++){
    
    for(auto t:data[i]){
      Q.push(t);
    }
    if(!Q.empty()){
      sum+=Q.top();
      Q.pop();
    }
  }
  cout<<sum<<endl;
  return 0;
}
      
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: reference to 'data' is ambiguous
   12 |     data[a].push_back(b);
      |     ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:2:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:7:13: note:                 'std::__debug::vector<long long int, std::allocator<long long int> > data [100010]'
    7 |   vector<ll>data[100010];
      |             ^~~~
a.cc:17:16: error: reference to 'data' is ambiguous
   17 |     for(auto t:data[i]){
      |                ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:7:13: note:                 'std::__debug::vector<long long int, std::allocator<long long int> > data [100010]'
    7 |   vector<ll>data[100010];
      |             ^~~~
a.cc:21:7: error: 'sum' was not declared in this scope
   21 |       sum+=Q.top();
      |       ^~~
a.cc:25:9: error: 'sum' was not declared in this scope
   25 |   cout<<sum<<endl;
      |         ^~~