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

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

int main () {
  int n, m; cin >> n >> m;
  vector<pair<int, int>> x;
  for (int i=0;i<n;i++) {
    int a, b;
    cin >> a >> b;
    x.push_back(make_pair(a, b));
  }
  sort(x.begin(), x.end());
  reverse(x.begin(), x.end());
  int sum = 0;
  for (auto i:x) {
    int y = m+1;
    if (x.first <= y) {
      sum += x.second;
      y--;
    }
  }
  cout << sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: 'class std::vector<std::pair<int, int> >' has no member named 'first'
   17 |     if (x.first <= y) {
      |           ^~~~~
a.cc:18:16: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   18 |       sum += x.second;
      |                ^~~~~~
Language: C++

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

int main () {
  int n, m; cin >> n >> m;
  for (int i=0;i<n;i++) {
    int a, b;
    cin >> a >> b;
    vector<pair<int, int>> x;
    x.push_back(make_pair(a, b));
  }
  sort(x.begin(), x.end());
  reverce(x.begin(), x.end());
  int sum = 0;
  for (int i:x) {
    int y = m+1;
    if (x <= y) {
      sum += x.second;
      y--
    }
  }
  cout << sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:8: error: 'x' was not declared in this scope
   12 |   sort(x.begin(), x.end());
      |        ^
a.cc:13:3: error: 'reverce' was not declared in this scope
   13 |   reverce(x.begin(), x.end());
      |   ^~~~~~~
a.cc:19:10: error: expected ';' before '}' token
   19 |       y--
      |          ^
      |          ;
   20 |     }
      |     ~
Language: C++

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

int main () {
  int n, m; cin >> n >> m;
  for (int i=0;i<n;i++) {
    int a, b;
    cin >> a >> b;
    x = make_pair(a, b);
  }
  sort(x.begin(), x.end());
  reverce(x.begin(), x.end());
  int sum = 0;
  for (int i:x) {
    int y = m+1;
    if (x.first <= y) {
      sum += x.second;
      y--
    }
  }
  cout << sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'x' was not declared in this scope
    9 |     x = make_pair(a, b);
      |     ^
a.cc:11:8: error: 'x' was not declared in this scope
   11 |   sort(x.begin(), x.end());
      |        ^
a.cc:12:3: error: 'reverce' was not declared in this scope
   12 |   reverce(x.begin(), x.end());
      |   ^~~~~~~
a.cc:18:10: error: expected ';' before '}' token
   18 |       y--
      |          ^
      |          ;
   19 |     }
      |     ~
Language: C++

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

int main () {
  int n, m; cin >> n >> m;
  int a, b, x;
  for (int i=0;i<n;i++) {
    cin >> a >> b;
    x = make_pair(a, b);
  }
  sort(x.begin(), x.end());
  reverce(x.begin(), x.end());
  int sum = 0;
  for (int i:x) {
    int y = m+1;
    if (x.first <= y) {
      sum += x.second;
      y--
    }
  }
  cout << sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: cannot convert 'std::pair<int, int>' to 'int' in assignment
    9 |     x = make_pair(a, b);
      |         ~~~~~~~~~^~~~~~
      |                  |
      |                  std::pair<int, int>
a.cc:11:10: error: request for member 'begin' in 'x', which is of non-class type 'int'
   11 |   sort(x.begin(), x.end());
      |          ^~~~~
a.cc:11:21: error: request for member 'end' in 'x', which is of non-class type 'int'
   11 |   sort(x.begin(), x.end());
      |                     ^~~
a.cc:12:13: error: request for member 'begin' in 'x', which is of non-class type 'int'
   12 |   reverce(x.begin(), x.end());
      |             ^~~~~
a.cc:12:24: error: request for member 'end' in 'x', which is of non-class type 'int'
   12 |   reverce(x.begin(), x.end());
      |                        ^~~
a.cc:12:3: error: 'reverce' was not declared in this scope
   12 |   reverce(x.begin(), x.end());
      |   ^~~~~~~
a.cc:14:14: error: 'begin' was not declared in this scope
   14 |   for (int i:x) {
      |              ^
a.cc:14:14: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:14:14: error: 'end' was not declared in this scope
   14 |   for (int i:x) {
      |              ^
a.cc:14:14: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
a.cc:16:11: error: request for member 'first' in 'x', which is of non-class type 'int'
   16 |     if (x.first <= y) {
      |           ^~~~~
a.cc:17:16: error: request for member 'second' in 'x', which is of non-class type 'int'
   17 |       sum += x.second;
      |                ^~~~~~
a.cc:18:10: error: expected ';' before '}' token
   18 |       y--
      |          ^
      |          ;
   19 |     }
      |     ~
Language: C++

// 1:10 -> 1:17
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
vector<int>v[100005];
int main (){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n,m;
	cin>>n>>m; 
	int x,y;
	for(int i=0;i<n;i++){
		cin>>x>>y;
		v[x].pb(y);
	}
	proirity_queue<int> pq;
	ll ans = 0;
	for(int i=m-1;i>=0;i--){
		for(auto x:v[m-i])pq.push(x);
		if(!pq.empty()){
			ans+=pq.top();
			pq.pop();
		}
	}
	cout<<ans<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'proirity_queue' was not declared in this scope
   18 |         proirity_queue<int> pq;
      |         ^~~~~~~~~~~~~~
a.cc:18:24: error: expected primary-expression before 'int'
   18 |         proirity_queue<int> pq;
      |                        ^~~
a.cc:21:35: error: 'pq' was not declared in this scope; did you mean 'pb'?
   21 |                 for(auto x:v[m-i])pq.push(x);
      |                                   ^~
      |                                   pb
a.cc:22:21: error: 'pq' was not declared in this scope; did you mean 'pb'?
   22 |                 if(!pq.empty()){
      |                     ^~
      |                     pb
Language: C++

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


template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
    vector.erase(vector.begin() + index);
}


int main(){
  int n, m;
  cin >> n >> m;
  vector<vector＜int>> jobs(m);
  rep(i,n){
    int a,b;
    cin >> a >> b;
    if (a > m)continue;
    jobs[m-a].push_back(b);
  }
  priority_queue<int> q;
  ll ans = 0;
  for(int i = m-1; i>= 0;--i){
    for(int b:jobs[i]){
      q.push(b);
    }
    if(!q.empty()){
      ans += q.top();
      q.pop();
    }

  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: 'vector\U0000ff1cint' was not declared in this scope
   17 |   vector<vector＜int>> jobs(m);
      |          ^~~~~~~~~~~
a.cc:17:10: error: template argument 1 is invalid
a.cc:17:10: error: template argument 2 is invalid
a.cc:17:21: error: expected unqualified-id before '>' token
   17 |   vector<vector＜int>> jobs(m);
      |                     ^~
a.cc:22:5: error: 'jobs' was not declared in this scope
   22 |     jobs[m-a].push_back(b);
      |     ^~~~
a.cc:27:15: error: 'jobs' was not declared in this scope
   27 |     for(int b:jobs[i]){
      |               ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define pf push_front

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define sz(x) int(x.size())
double pi = 3.141592653589793;
ll mod = 1000000007;
ll INF = 1000000001;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;


int main(){
	int n,m;
	cin>>n>>m;
	vi jobs(m);
	rep(i,n){
		int a,b;
		cin>>a>>b;
		if(a>m) continue;
		jobs[m-a].pb(b);
	}
	priority_queue<int> q;
	ll ans=0;
	for(int i=m-1; i>=0; --i){
		for (int b;jobs[i]){
			q.push(b);
		}
		if(!q.empty()){
			ans+=q.top();
			q.pop();
		}
	}
	cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:12: error: request for member 'push_back' in 'jobs.std::vector<int>::operator[](((std::vector<int>::size_type)(m - a)))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
    3 | #define pb push_back
      |            ^~~~~~~~~
a.cc:38:27: note: in expansion of macro 'pb'
   38 |                 jobs[m-a].pb(b);
      |                           ^~
a.cc:43:35: error: expected ';' before ')' token
   43 |                 for (int b;jobs[i]){
      |                                   ^
      |                                   ;
Language: C++

#include<bits/stdc++.h>
#define int long long
#define fi first
#define se second
#define PB push_back
using namespace std;
typedef pair<int, int> P1;
typedef pair<int, pair<int, int> > P2;
static const int INF = 1ll<<60;
static const int dx[] = { 1, -1, 0, 0, };
static const int dy[] = { 0, 0, 1, -1 };
static const int mod = 1000000007;

int N,M;
vector<P1> V;
priority_queue<P1,vector<P1> > que;
queue<P1> idq;

signed main(){
    cin>>N>>M;
    for(int i=0;i<N;++i){
        int a,b;
        cin>>a>>b;
        V.PB(P1(a,b));
    }
    sort(V.begin(),V.end());
    int left=0,right=0;
    if(N==1){
        idq.push(P1(0,0))
    }
    else{
        for(int i=1;i<N;++i){
            if(V[i].fi==V[i-1].fi)continue;
            right=i-1;
            idq.push(P1(left,right));
            left=right+1;
        }
    }
    right=N-1;
    idq.push(P1(left,right));
    int day=M-1;
    int ans=0;
    while(day>=0){
        P1 seg=idq.front();
        if(day+V[seg.fi].fi<=M){
            for(int i=seg.fi;i<=seg.se;++i){
                que.push(P1(V[i].se,V[i].fi));
            }
            idq.pop();
        }
        if(!que.empty()){
            P1 v=que.top();
            que.pop();
            ans+=v.fi;
        }
        day--;
    }
    cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:26: error: expected ';' before '}' token
   29 |         idq.push(P1(0,0))
      |                          ^
      |                          ;
   30 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll inf=1000000000000000;

ll min(ll a,ll b){
    if(a<b)return a;
    else return b;
}
ll max(ll a,ll b){
    if(a>b)return a;
    else return b;
}

ll node[1000000010];
ll cc;

void update(ll i){
    node[cc]=i;
    ll j=cc;
    ll a;
    while(j>0 && node[((j-1)-(j-1)%2)/2]<node[j]){
        a=node[((j-1)-(j-1)%2)/2];
        node[((j-1)-(j-1)%2)/2]=node[j];
        node[j]=a;
        j=((j-1)-(j-1)%2)/2;
    }
    cc++;
}

ll find(){
    ll a=node[0];
    if(cc==0)return 0;
    if(cc==1){
        node[0]=0;
        cc=0;
        return a;
    }
    node[0]=node[cc-1];
    node[cc-1]=0;
    cc--;
    ll j=0;
    ll b;
    while((node[2*j+1]!=0 || node[2*j+2]!=0) && (node[j]<node[2*j+1] || node[j]<node[2*j+2])){
        if(node[2*j+1]>=node[2*j+2]){
            b=node[2*j+1];
            node[2*j+1]=node[j];
            node[j]=b;
            j=2*j+1;
        }else{
            b=node[2*j+2];
            node[2*j+2]=node[j];
            node[j]=b;
            j=2*j+2;
        }
    }
    return a;
}


int main(){
    ll n,m;cin>>n>>m;
    ll a[n],b[n];
    vector<vector<ll>> job(m+1);
    for(ll i=0;i<n;i++){
        cin>>a[i]>>b[i];
        if(a[i]<=m) job[a[i]].push_back(b[i]);
    }
    ll ans=0;
    for(ll i=1;i<=m;i++){
        for(ll j=0;j<job[i].size();j++){
            update(job[i][j]);
        }
        ans+=find();
    }
    cout<<ans<<endl;
    return 0;
}



Compiler output:
/tmp/ccRW2Fr6.o: in function `update(long long)':
a.cc:(.text+0x4f): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccRW2Fr6.o
a.cc:(.text+0x6d): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccRW2Fr6.o
a.cc:(.text+0x1f2): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccRW2Fr6.o
a.cc:(.text+0x1fd): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccRW2Fr6.o
/tmp/ccRW2Fr6.o: in function `find()':
a.cc:(.text+0x216): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccRW2Fr6.o
a.cc:(.text+0x22c): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccRW2Fr6.o
a.cc:(.text+0x244): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccRW2Fr6.o
a.cc:(.text+0x258): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccRW2Fr6.o
a.cc:(.text+0x27d): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccRW2Fr6.o
a.cc:(.text+0x29f): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccRW2Fr6.o
a.cc:(.text+0x2aa): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll inf=1E17;

ll min(ll a,ll b){
    if(a<b)return a;
    else return b;
}
ll max(ll a,ll b){
    if(a>b)return a;
    else return b;
}

//優先度付き待ち行列

ll node[1000000010];
ll cc=0;

void update(ll i){
    node[cc]=i;
    ll j=cc;
    ll a;
    while(j>0 && node[((j-1)-(j-1)%2)/2]<node[j]){
        a=node[((j-1)-(j-1)%2)/2];
        node[((j-1)-(j-1)%2)/2]=node[j];
        node[j]=a;
        j=((j-1)-(j-1)%2)/2;
    }
    cc++;
}

ll find(){
    ll a=node[0];
    if(cc==0)return 0;
    if(cc==1){
        node[0]=0;
        cc=0;
        return a;
    }
    node[0]=node[cc-1];
    node[cc-1]=0;
    cc--;
    ll j=0;
    ll b;
    while((node[2*j+1]!=0 || node[2*j+2]!=0) && (node[j]<node[2*j+1] || node[j]<node[2*j+2])){
        if(node[2*j+1]>=node[2*j+2]){
            b=node[2*j+1];
            node[2*j+1]=node[j];
            node[j]=b;
            j=2*j+1;
        }else{
            b=node[2*j+2];
            node[2*j+2]=node[j];
            node[j]=b;
            j=2*j+2;
        }
    }
    return a;
}


int main(){
    ll n,m;cin>>n>>m;
    ll a[n],b[n];
    vector<vector<ll>> job(m+1);
    for(ll i=0;i<n;i++){
        cin>>a[i]>>b[i];
        if(a[i]<=m) job[a[i]].push_back(b[i]);
    }
    ll ans=0;
    for(ll i=1;i<=m;i++){
        for(ll j=0;j<job[i].size();j++){
            update(job[i][j]);
        }
        ans+=find();
    }
    cout<<ans<<endl;
    return 0;
}



Compiler output:
/tmp/ccTUjWpA.o: in function `update(long long)':
a.cc:(.text+0x4f): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccTUjWpA.o
a.cc:(.text+0x6d): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccTUjWpA.o
a.cc:(.text+0x1f2): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccTUjWpA.o
a.cc:(.text+0x1fd): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccTUjWpA.o
/tmp/ccTUjWpA.o: in function `find()':
a.cc:(.text+0x216): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccTUjWpA.o
a.cc:(.text+0x22c): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccTUjWpA.o
a.cc:(.text+0x244): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccTUjWpA.o
a.cc:(.text+0x258): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccTUjWpA.o
a.cc:(.text+0x27d): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccTUjWpA.o
a.cc:(.text+0x29f): relocation truncated to fit: R_X86_64_PC32 against symbol `cc' defined in .bss section in /tmp/ccTUjWpA.o
a.cc:(.text+0x2aa): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)

using namespace std;

namespace mp = boost::multiprecision;
using Bint = mp::cpp_int;

using ll = long long;
ll mod = pow(10, 9) + 7;

template <typename T> void output(T, ll);
ll gcd(ll, ll);
ll lcm(ll, ll);
Bint comb(Bint, Bint);
void prime_map(map<ll, ll> &, ll);

bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    return a.second > b.second;
}

int main() {
    // source
    int n, m;
    cin >> n >> m;
    int a[n], b[n];
    rep(i, n) { cin >> a[i] >> b[i]; }

    vector<vector<int>> v(m + 1);
    rep(i, n) {
        if (a[i] <= m) {
            v[a[i]].push_back(b[i]);
        }
    }

    priority_queue<int> ans_vector = {};

    ll ans = 0;
    repd(i, 1, m + 1) {
        rep(j, v[i].size()) { ans_vector.push(v[i][j]); }
        if (ans_vector.size() != 0) {
            ans += ans_vector.top();
            ans_vector.pop();
        }
    }

    cout << ans << endl;

    return 0;
}

Bint comb(Bint a, Bint b) {
    Bint ans = 1;

    if (a < b) {
        return 0;
    }

    rep(i, b) {
        ans *= a - i;
        ans /= i + 1;
    }

    return ans;
}

template <typename T> void output(T a, int precision) {
    if (precision > 0) {
        cout << setprecision(precision) << a << "\n";
    } else {
        cout << a << "\n";
    }
}

template <typename T> T min(T a, T b) {

    if (a < b) {
        return a;
    } else {
        return b;
    }
}

ll gcd(ll a, ll b) {
    if (b == 0) {
        return a;
    }
    return gcd(b, a % b);
}

ll lcm(ll a, ll b) { return a * b / gcd(a, b); }

void prime_map(map<ll, ll> &m, ll num) {
    ll cache = num;
    repd(i, 2, sqrt(num) + 2) {
        if (num % i == 0) {
            if (m[i] == 0) {
                m[i] = 1;
            } else {
                m[i]++;
            }

            num /= i;
            break;
        }
    }

    if (cache == num) {
        if (m[num] == 0) {
            m[num] = 1;
        } else {
            m[num]++;
        }
        return;
    } else {
        prime_map(m, num);
    }
}


Compiler output:
a.cc:2:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
    2 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);++i)
using namespace std;
 
int main(){
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> vec(n);
  rep(i,n) cin >> vec.at(i).first >> vec.at(i).second;
  sort(vec.begin(), vec.end());
  int ans=0;
  priority_queue<int> que;
  rep(i,m){
    int pos=0;
    rep(j,n){
      if (j<pos) continue;
      if (vec.at(j).first == (i+1)) que.push(vec.at(j).second);
      if (vec.at(j).first > (i+1)){
        pos=j
        break;
      }
    }
    if (!que.empty()){
      ans+=que.top();
      que.pop();
    }

  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:14: error: expected ';' before 'break'
   19 |         pos=j
      |              ^
      |              ;
   20 |         break;
      |         ~~~~~
Language: C++

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

int main(){
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> vec(n);
  rep(i,n) cin >> vec.at(i).first >> vec.at(i).second;
  sort(vec.begin(), vec.end());
  int ans=0;
  vector<int> tmp;
  rep(i,m){
    
    rep(j,vec.size()){
      if (vec.at(j).first == (i+1)) tmp.push_back(vec.at(j).second);
      if (vec.at(j).first > (i+1)) break;
    }
    sort(tmp.begin(),tmp.end());
    ans+=tmp.end();
    tmp.pop_back();
    }
  }
  cout << ans << endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:20:8: error: no match for 'operator+=' (operand types are 'int' and 'std::vector<int>::iterator')
   20 |     ans+=tmp.end();
      |     ~~~^~~~~~~~~~~
a.cc: At global scope:
a.cc:24:3: error: 'cout' does not name a type
   24 |   cout << ans << endl;
      |   ^~~~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C++

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

int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> jobs(m);
  rep(i,n){
    int a, b;
    cin >> a >> b;
    if (a > m) continue;
    jobs[m-a].push_back(b);
  }
  priority_queue<int> q;
  ll ans =0;
  for(int i = m-1;i >=0; i--) {
    for(auto k : jobs[i]){
      q.push(k)
    }
    if (!q.empty()) {
      ans += q.top();
      q.pop();
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:16: error: expected ';' before '}' token
   22 |       q.push(k)
      |                ^
      |                ;
   23 |     }
      |     ~
Language: C++

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

int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> jobs(m);
  rep(i,n){
    int a, b;
    cin >> a >> b;
    if (a > m) continue;
    jobs[m-a].push_back(b);
  }
  priority_queue<int> q;
  ll ans =0;
  for(int i = m-1;i >=0; i--) {
    for(auto b : jobs[i]){
      q.push(b)
    }
    if (!q.empty()) {
      ans += q.top();
      q.pop();
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:16: error: expected ';' before '}' token
   22 |       q.push(b)
      |                ^
      |                ;
   23 |     }
      |     ~
Language: C++

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

int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int>> jobs(m);
  rep(i,n){
    int a, b;
    cin >> a >> b;
    if (a > m) continue;
    jobs[m-a].push_back(b);
  }
  priority_queue<int> q;
  ll ans =0;
  for(int i = m-1;i >=0; i--) {
    for(auto b : jobs[i]){
      q.push(b)
    }
    if (!q.empty()) {
      ans += q.top();
      q.pop;
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:16: error: expected ';' before '}' token
   22 |       q.push(b)
      |                ^
      |                ;
   23 |     }
      |     ~           
a.cc:26:9: error: invalid use of non-static member function 'void std::priority_queue<_Tp, _Sequence, _Compare>::pop() [with _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>]'
   26 |       q.pop;
      |       ~~^~~
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:771:7: note: declared here
  771 |       pop()
      |       ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
const ll INF=mod*mod;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(x) (x).begin(),(x).end()
ll min(ll a,ll b){
  if(a>b){
    return b;
    }
      else{
        return a;
      }
  }
  
  ll max(ll a,ll b){
    if(a>b){
      return a;
    }
    else{
      return b;
    }
  }

ll power(ll a,ll b){
 ll ans=1;
 for(ll i=1;i<=b;i++){
ans*=a;
  }
  return ans;
}

 ll gcd(ll m,ll n){
 	if(n==0){
       return m;
     }
   return gcd(n,m%n);
 }
ll lcm(ll a,ll b){
  ll g=gcd(a,b);
  return a/gcd(a,b)*b;
		

}
int main(){
  
   ll N,M;
  cin>>N>>M;
vector<pair<ll,ll>>C(N);
  priority_queue<ll>queue;
  
  rep(i,N){
    cin>>C[i].first>>C[i].second;
  }
  
  sort(all(C));
  
  
  
  rep(i,N){
    cin>>A[i]>>B[i];
  }
  ll ans=0;
  ll x=0;
  
  for(ll i=M-1;i>=0;i--){

    while(x<N){
      if(i+C[x].first<=M){
queue.push(C[x].second);
        x++;
      }
      else{
        break;
      }
    }
if(!queue.empty()){
  ans+=queue.top();
  queue.pop();//ここでまた空にする？
}
  }

  
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:62:10: error: 'A' was not declared in this scope
   62 |     cin>>A[i]>>B[i];
      |          ^
a.cc:62:16: error: 'B' was not declared in this scope
   62 |     cin>>A[i]>>B[i];
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int ans = 0;
    int n,m; cin >> n >> m;
    vector<pair <int , int>> ab;
    pair<int, int> tmp;

    while(n--){
    	cin >> tmp.first >> tmp.second;
    	ab.push_back(tmp);
    }

    sort(ab.begin(),ab.end());
    int day = 0;
    queue<int> q;
    for(int i=1; i<=m;i++){
    	while(i<n && ab[day].first == i){
    		q.push(ab[day].second);
    		day++;
    	}
    	if(q.size() > 0){
    		ans +=q.top();
    		q.pop();
    	}
    }

    cout << ans << endl;
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:25: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'?
   24 |                 ans +=q.top();
      |                         ^~~
      |                         pop
Language: C++

// review
#include <iostream>
#include <vector>
#include <queue>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int MAXN = 1e5+10;

int n, m;
int a[MAXN], b[MAXN];

void solve() {
  vector<P> v;
  for (int i=0;i<n;i++) {
    if (m >= a[i]) {
      v.push_back(P(m - a[i], b[i]));
    }
  }
  sort(v.begin(), v.end());
  ll sum = 0;
  int currentTime = m;
  int cur = v.size()-1;
  priority_queue<int> que;
  while (currentTime >= 0) {
    while(cur > 0 && v[cur].first == currentTime) {
      que.push(v[cur--].second);
    }
    currentTime--;
    if (!que.empty()) {
      sum += que.top();
      que.pop();
    }
  }
  cout << sum << endl;
}

int main() {
  cin >> n >> m;
  for (int i=0;i<n;i++) {
    cin >> a[i] >> b[i];
  }
  solve();
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:21:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   21 |   sort(v.begin(), v.end());
      |   ^~~~
      |   short
Language: Java

import java.util.*;

public class Summer_Vacation{
  public static void main(String[] args){
    PriorityQueue<Integer> pq = new PriorityQueue<Integer>(Collections.reverseOrder());
    Scanner sc = new Scanner(System.in);
    String[] s = sc.nextLine().split(" ");
    int n = Integer.parseInt(s[0]);
    int m = Integer.parseInt(s[1]);
    int sum = 0 ;
     //制限日数

    List<Integer> a = new ArrayList<Integer>();   //仕事にかかる時間(要素n)
    List<Integer> b = new ArrayList<Integer>();   //報酬(要素n)
    for(int i=0; i<n; i++){
      int aa = sc.nextInt();
      int bb = sc.nextInt();
      a.add(aa);
      b.add(bb);
    }
    //System.out.println("仕事にかかる時間:"+a);
    //System.out.println("      報酬:      "+b);
    for(int j=1; j<=m; j++){         //jは日数
      for(int k=0; k<a.size(); k++){
        if(a.get(k)<=j&&a.get(k)!=0){
          pq.add(b.get(k));
          a.remove(k);
          b.remove(k);
          a.add(k,0);
          b.add(k,0);
          //System.out.println(pq);
        }
      }
      try{
        sum += pq.poll();
      }
      catch(NullPointerException e){         //優先度付きキューのnull回避
        pq.add(0);
        sum += pq.poll();
      }
    }
    System.out.println(sum);
  }
}


Compiler output:
Main.java:3: error: class Summer_Vacation is public, should be declared in a file named Summer_Vacation.java
public class Summer_Vacation{
       ^
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(void)
{
    int N;
    int M;
    long long result;

    cin >> N;
    cin >>M;

    map<int,vector<int>> bites;

    int A;
    int B;

    int MaxM =0;

    for(int i=0;i<N;i++){
        cin >> A;
        cin >> B;
        bites[B].push_back(A);

        MaxM = max(MaxM,B);
    }

    for(int i=0;i<MaxM;i++){
        auto p = max_element(bites[i].begin(),bites[i].end());
        result +=*p;
        bites[i].erace(p);
        if(i != MaxM-1){
        bites[i+1].insert(bites[i+1].end(),bites[i].begin(),bites[i].end());
        }
    }

    cout<<result<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:18: error: 'std::map<int, std::vector<int> >::mapped_type' {aka 'class std::vector<int>'} has no member named 'erace'; did you mean 'erase'?
   32 |         bites[i].erace(p);
      |                  ^~~~~
      |                  erase
Language: C++

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

int main (){
  int n,m;
  cin>>n>>m;
  ll salary[m+1];
  int m=0;
  for (int i=0; i<m+1; i++)salary[i]=0;
  for (int i=0; i<n; i++){
    int a,b;
    cin>>a>>b;
    for(int j=0;j<max+1; j++){
      if(j+a<=m)salary[j+a]=max(salary[j+a],salary[j]+b);
      m+=a;
      if(max>=m)max=m;
    }
    cout<<salary[m];
    return 0;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: redeclaration of 'int m'
    9 |   int m=0;
      |       ^
a.cc:6:9: note: 'int m' previously declared here
    6 |   int n,m;
      |         ^
a.cc:14:22: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   14 |     for(int j=0;j<max+1; j++){
      |                   ~~~^~
a.cc:17:13: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>='
   17 |       if(max>=m)max=m;
      |          ~~~^~~
a.cc:17:21: error: overloaded function with no contextual type information
   17 |       if(max>=m)max=m;
      |                     ^
a.cc:21:4: error: expected '}' at end of input
   21 |   }
      |    ^
a.cc:5:12: note: to match this '{'
    5 | int main (){
      |            ^
Language: C++

#include <iostream>
#include <vector>
#include <priority_queue>

int main(){
	int n, m;
	cin >> n >> m;

	vector< vector<int> > jobs(m+1);
	for (int i = 0; i < n; i++){
		int a, b;
		cin >> a >> b;
		if (a > m) continue;
		jobs[a].push_back(b);
	}
	
	long ans = 0;
	priority_queue<int> q;
	for (int i = 1; i <= m; i++){
		for (auto j : jobs[i])
			q.push(j);
		if (q.empty()) continue;
		ans += q.top();
		q.pop();
	}

	cout << ans << endl;
}



Compiler output:
a.cc:3:10: fatal error: priority_queue: No such file or directory
    3 | #include <priority_queue>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main(){
	int N, deadline;
	cin >> N >> deadline;
	vector<pair<int, int>> work(N);
	for(int i = 0; i < N; i++){
		cin >> work[i].first >> work[i].second;
	}
	sort(work.begin(), work.end());
	reverse(work.begin(), work.end());
	int income = 0;
	for(int i = 0; i < N; i++){
		if(work[i].first < M){
			income += work[i].second;
			M--;
		} else {
			break;
		}
	}
	
	cout << income << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:36: error: 'M' was not declared in this scope
   15 |                 if(work[i].first < M){
      |                                    ^
Language: C

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
struct Data {
  int A, B;
  Data(int A, int B) : A(A), B(B){}
  bool operator< (const Data& d) const {
    return A < d.A;
  } 
};
 
int main() {
  int N, M;
  cin >> N >> M;
  priority_queue<int> q;
  int A, B;
  vector<Data> d;
  for (int i = 0; i < N; i++) {
    cin >> A >> B;
    d.push_back(Data(A, B));
  }
  sort(d.begin(), d.end());
  int c = 0;
  int idx = 0;
  for (int i = 1; i <= M; i++) {
    while (idx < N && d[idx].A <= i) {
      q.push(d[idx].B);
      idx++;
    }
    if (!q.empty()) {
      c += q.top();
      q.pop();
    }
  }
  cout << c << "\n";
  return 0;
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef double db;
typedef vector <ll> vll;
typedef pair <ll, ll> pll;
#define pb push_back
#define mp make_pair
#define MAX 1000000
#define mod 1000000007
#define all(_) _.begin(), _.end()
#define F first
#define S second
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);
    ll n, m, ans = 0, i;
    cin >> n >> m;
    vector <pll> a(n);
    for(i = 0; i < n; i++)
        cin >> a[i].F >> a[i].S;
    sort(all(a), c, greater <pll>());
    vll day(m + 1, 0);
    set <ll> s;
    for(i = 1; i <= m; i++)
        s.insert(i);
    for(auto x : a)
    {
        if(s.size() == 0)
            break;
        if(x.F <= m)
        {
            if(!day[(m + 1 - x.F)])
                day[(m + 1 - x.F)] = x.S, s.erase(m + 1 - x.S);
            else
            {
                auto it = s.lower_bound(m + 1 - x.F);
                if(it != s.begin())
                    it--;
                else
                    continue;
                day[*it] = x.S;
                s.erase(it);   
            }
        }
    }
    for(i = 1; i <= m; i++)
        ans += day[i];
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:18: error: 'c' was not declared in this scope
   27 |     sort(all(a), c, greater <pll>());
      |                  ^
Language: C++

#include <stdio.h>
#include <stdlib.h>

typedef struct kyuuryou{
    int xday;
    int mon;
} part;

int main(){
    int N,M,i,j;
    scanf("%d %d",&N,&M);
    part *data;
    data=(part*)malloc(N*sizeof(part));
    for(i=0;i<N,i++){
        scanf("%d %d",&data[i].xday,&data[i].mon);
        data[i].xday+=i;
    }
    int sum=0;
    for(i=0;i<N;i++){
        for(j=0;j<M;j++){
            data[j].xday--;
            if(data[j].xday==0)sum+=data[j].mon;
        }
    }
    printf("%d",sum);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: expected ';' before ')' token
   14 |     for(i=0;i<N,i++){
      |                    ^
      |                    ;
Language: C++

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

#define int long long

signed main() {
	int n,m,a,b;
	cin >> n >> m;
	vector<pair<int,int> > v;
	priority_queue<int> p;
	for(int i = 0; i < m; i++) {
		cin >> a >> b;
		if(a<=m) v.push_back({a,b});
	}
	if(v.empty()) {
		cout << '0' << endl;
	}
	else {
		sort(v.begin(),v.end());
		int j = 0;
		int ans = 0;
		for(int i = 1; i <= m; i++) {
			for(j; j < n; j++) {
				int x = v[j].first;
				int y = v[j].second;
				if(x>i) break;
				p.push(y);
			}
			if(!p.empty()) {
				int z = p.front();
				ans += z;
				p.pop();
			}
		}	
	}
	cout << ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:43: error: 'class std::priority_queue<long long int>' has no member named 'front'
   30 |                                 int z = p.front();
      |                                           ^~~~~
a.cc:36:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   36 |         cout << ans;
      |                 ^~~
      |                 abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define MD 1000000007
#define INF 1ll<<60
typedef pair<ll, ll> P;
template <typename T>
std::string tostr(const T &t){std::ostringstream os;os << t;return os.str();}
int dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1};

int main(){
    int n,m,pos=0;
    cin>>n>>m;
    vector<pair<int,int>> pa(n);
    for(int i=0;i<n;i++){
        int a,b;
        cin>>a>>b;
        pa[i]={a,b};
    }
    sort(pa.begin(),pa.end());
    int ans=0;
    for(int i=1;i<=m;i++){
        priority_queue<int> que;
        while(pa[pos].first==i){
            que.push(pa[pos].second);
            pos++;
        }
        ans+=queue.top();
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:19: error: missing template arguments before '.' token
   28 |         ans+=queue.top();
      |                   ^
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int[][] ab = new int[n][2];
        int sum = 0;
        List<Integer> candidate = new ArrayList<Integer>();

        for (int i = 0; i < n; i++) {
            ab[i][0] = scanner.nextInt();
            ab[i][1] = scanner.nextInt();
        }

        Arrays.sort(ab, Comparator.comparingInt(a -> a[0]));

        int j = 0;
        for (int i = 1; i <= m; i++) {
            while (j < n && ab[j][0] == i) {
                candidate.add(ab[j][1]);
                j++;
            }

            if (candidate.size() != 0) {
                int tmp = Collections.max(candidate);
                sum += tmp
                candidate.remove((Integer) tmp);
            }
        }
        System.out.println(sum);

    }

}



Compiler output:
Main.java:28: error: ';' expected
                sum += tmp
                          ^
1 error
Language: Java

mport java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		int m = sc.nextInt();
		
		int day[] = new int[n];
		int money[] = new int[n];
		
		ArrayList<Integer[]> ar_shigoto = new ArrayList<>();
		for (int i = 0 ; i < n ; i ++) {
			day[i] = sc.nextInt();
			money[i] = sc.nextInt();
			if (day[i] <= m) {
				Integer[] temp = {day[i], money[i]};
				ar_shigoto.add(temp);
			}
			
		}
		int kane = 0;
		
		for (int nokori_nissuu = 1 ; nokori_nissuu <= m ; nokori_nissuu ++) {
			
			int best_nittou=0;
			int shouka_shigoto = 0;
			boolean get_shigoto = false;
			for (int i = 0 ; i <ar_shigoto.size() ; i++) {
				
				if (ar_shigoto.get(i)[0] <= nokori_nissuu) {
					get_shigoto = true;
					if (best_nittou < ar_shigoto.get(i)[1]) {
						best_nittou =  ar_shigoto.get(i)[1];
						shouka_shigoto  = i ;
					}
				}
			}
			
			if (get_shigoto) {
				//System.out.println("yattashigoto" + shouka_shigoto);
				ar_shigoto.remove(shouka_shigoto);
				kane += best_nittou;
			}	
		}
		System.out.println(kane);
	}
}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.ArrayList;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.Scanner;
^
2 errors
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		int m = sc.nextInt();
		
		int day[] = new int[n];
		int money[] = new int[n];
		
		ArrayList<Integer[]> ar_shigoto = new ArrayList<>();
		for (int i = 0 ; i < n ; i ++) {
			day[i] = sc.nextInt();
			money[i] = sc.nextInt();
			if (day[i] <= m) {
				Integer[] temp = {day[i], money[i]};
				ar_shigoto.add(temp);
			}
			
		}
		int kane = 0;
		
		for (int nokori_nissuu = 1 ; nokori_nissuu <= m ; nokori_nissuu ++) {
			
			int best_nittou=0;
			int shouka_shigoto = 0;
			boolean get_shigoto = false;
			for (int i = 0 ; i <ar_shigoto.size() ; i++) {
				
				if (ar_shigoto.get(i)[0] <= nokori_nissuu) {
					get_shigoto = true;
					if (best_nittou < ar_shigoto.get(i)[1]) {
						best_nittou =  ar_shigoto.get(i)[1];
						shouka_shigoto  = i ;
					}
				}
			}
			
			if (get_shigoto) {
				//System.out.println("yattashigoto" + shouka_shigoto);
				ar_shigoto.remove(shouka_shigoto);
				kane += best_nittou;
			
			}
			
		}
		
		System.out.println(kane);
		
	}

Compiler output:
Main.java:55: error: reached end of file while parsing
	}
	 ^
1 error
Language: C

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
#include <queue>
using namespace std;

bool pair_compare(const pair<int, int>& a, const pair<int, int>& b)
{
  return a.first < b.first;
}

int
main(int argc, char *argv[])
{
  vector<pair<int,int> > data;
  int n, m, a, b;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    if (a <= m) data.push_back(make_pair(a, b));
  }

  sort(data.begin(), data.end(), pair_compare);

  int p = 1; int k = 0; int ans = 0;
  priority_queue<int> que;
  
  do {
    while (k < data.size() && data.at(k).first <= p) {
      que.push(data.at(k).second);
      k++;
    }
    if (!que.empty()) {
      ans += que.top();
      que.pop();
    }
    p++;
  } while (p <= m);

  cout << ans << endl;

  return 0;
}
    


Compiler output:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <functional>
#include<iostream>
#include <string>
using namespace std;
typedef long long ll;
#define pb pushback
#define fr(i,n) for(int i=0;i<n;i++)
#define fro(i,j,n) for(int i=j;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)


int main() {
    int n,m;
    ll ans =0;
	cin >> n>>m;
    long a[n];
    long b[n];
    vector<pair<long, long>> pairs(n);
    bool end = false;
    for(int i=0;i<n;i++){
     cin >> a[i];
     cin >> b[i];
     pairs[i] = make_pair(a[i], b[i]);
    }
    sort(pairs.begin(), pairs.end());
    
    int now = 0;
    priority_queue<int> c;
    for(int i=1;i<m+1;i++){
     if(c.size()<n){
      for(int j=now;j<n;j++){
        if(pairs[j].first>i){
          now=j;
          break;
        }
        c.push_back(pairs[j].second);
      } 
     }
     if(c.size()>0){
      ans+=c.top();
      c.pop();
     }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:11: error: 'class std::priority_queue<int>' has no member named 'push_back'
   39 |         c.push_back(pairs[j].second);
      |           ^~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <functional>
#include<iostream>
#include <string>
using namespace std;
typedef long long ll;
#define pb pushback
#define fr(i,n) for(int i=0;i<n;i++)
#define fro(i,j,n) for(int i=j;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)


int main() {
    int n,m;
    ll ans =0;
	cin >> n>>m;
    long a[n];
    long b[n];
    vector<pair<long, long>> pairs(n);
    bool end = false;
    for(int i=0;i<n;i++){
     cin >> a[i];
     cin >> b[i];
     pairs[i] = make_pair(a[i], b[i]);
    }
    sort(pairs.begin(), pairs.end());
    
    int now = 0;
    priority_que<int> c;
    for(int i=1;i<m+1;i++){
     if(c.size()<n){
      for(int j=now;j<n;j++){
        if(pairs[j].first>i){
          now=j;
          break;
        }
        c.push_back(pairs[j].second);
      } 
     }
     if(c.size()>0){
      ans+=c.top();
      c.pop();
     }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:5: error: 'priority_que' was not declared in this scope
   31 |     priority_que<int> c;
      |     ^~~~~~~~~~~~
a.cc:31:18: error: expected primary-expression before 'int'
   31 |     priority_que<int> c;
      |                  ^~~
a.cc:33:9: error: 'c' was not declared in this scope
   33 |      if(c.size()<n){
      |         ^
a.cc:42:9: error: 'c' was not declared in this scope
   42 |      if(c.size()>0){
      |         ^
Language: C++

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

int main(){
  int n,m;
  cin>>n>>m;
  vector<vector<int>> jobs(m);
  rep(i,n){
    int a,b;
    cin>>a>>b;
    if(a>m) continue;
    jons[m-a].push_back(b);
  }
  priority_queue<int> q;
  ll ans=0;
  for(int i=m-1;i>=0;++i){
    for(int b : jobs[i]){
      q.push(b);
    }
        if(!q.empty()){
          ans += q.top();
          q.pop();
        }
        }
        cout<<ans<<endl;
        }




Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'jons' was not declared in this scope; did you mean 'jobs'?
   15 |     jons[m-a].push_back(b);
      |     ^~~~
      |     jobs
Language: C++

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

int main(){
  int n,m;
  cin>>n>>m;
  vector<vector<int>> jobs(m);
  rep(i,n){
    int a,b;
    cin>>a>>b;
    if(a>m) continue;
    jons[m-a].push_back(b);
  }
  priority_queue<int> q;
  ll ans=0;
  for(int i=m-1;i>=0;++i){
    for(int b : jobs[i]{
      q.push(b);
    }
        if(!q.empty()){
          ans += q.top();
          q.pop();
        }
        }
        cout<<ans<ans<<endl;
        }




Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'jons' was not declared in this scope; did you mean 'jobs'?
   15 |     jons[m-a].push_back(b);
      |     ^~~~
      |     jobs
a.cc:20:24: error: expected ')' before '{' token
   20 |     for(int b : jobs[i]{
      |        ~               ^
      |                        )
a.cc:28:22: error: invalid operands of types 'll' {aka 'long long int'} and '<unresolved overloaded function type>' to binary 'operator<<'
   28 |         cout<<ans<ans<<endl;
      |                   ~~~^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
pair<long long,long long> p[100010];
int main()
{
	int n,m;
	cin>>n>>m;
	for(int i=0;i<n;i++)
	{
		cin>>p[i].first>>p[i].second;
	}
	sort(p,p+n);
	priority_queue<long long> q;
	long long cnt=0,ans=0;
	for(int j=0;j<m;j++)
	{
		while(cnt<n&&p[cnt].first<i)
		{
			q.push(p[cnt].second);
            cnt++;
		}
		if(!q.empty())
		{
			ans+=q.top();
			q.pop();
		}
	}
	cout<<ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:43: error: 'i' was not declared in this scope
   17 |                 while(cnt<n&&p[cnt].first<i)
      |                                           ^
Language: C++

#include <bits/stdc++.h>
int main()
{
  int N,M;std::cin>>N>>M;
  std::vector<std::vector<int>> W(M);
  for (int i=0;i<N;i++){
    int A,B;std::cin>>A>>B;
    if(A<=M){W[M-A].push_back(B);}
  }
  std::priority_queue<int> Q;
  int ans =0;
  for(int i=0;i<M;i++){
    for(const int b:W[i]){Q.push(b);}
    if(not Q.empty){ans+=Q.top(),Q.pop();}
  }
  std::cout<<ans<<std::endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: cannot convert 'std::priority_queue<int>::empty' from type 'bool (std::priority_queue<int>::)() const' to type 'bool'
   14 |     if(not Q.empty){ans+=Q.top(),Q.pop();}
      |              ^~~~~
a.cc:14:14: error: in argument to unary !
   14 |     if(not Q.empty){ans+=Q.top(),Q.pop();}
      |            ~~^~~~~