criyle/codenet-compile-errors huggingface dataset:
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)))
signed main(){
  int N,M; cin>>N>>M;
  vector<pii> A(N);
  rep(i,0,N) cin>>A[i].first>>A[i].second;
  int ans=0;
  sort(ALL(A));
  int memo=0;
  vi B;
  vi C(N),D(N);
  rep(i,0,N){
    C[i]=A[i].first;
    D[i]=A[i].second;
    }
  C.push_back(MOD);
  REP(i,1,M){
    rep(j,dislow(C,i),disup(C,i)){
      B.push_back(D[j]);
      }
    sort(ALL(B));
    if(B.size()>0){
      ans+=B[B.size()-1];
      B.pop();
      }
    }
  cout<<ans<<endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:35:9: error: 'class std::vector<long long int>' has no member named 'pop'
   35 |       B.pop();
      |         ^~~
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)))
signed main(){
  int N,M; cin>>N>>M;
  vector<pii> A(N);
  rep(i,0,N) cin>>A[i].first>>A[i].second;
  int ans=0;
  sort(ALL(A));
  int memo=0;
  vi B;
  vi C(N),B(N);
  rep(i,0,N){
    C[i]=A[i].first;
    D[i]=A[i].second;
    }
  C.push_back(MOD);
  REP(i,1,M){
    rep(j,dislow(C,i),disup(C,i)){
      B.push_back(D[j]);
      }
    sort(ALL(B));
    if(B.size()>0){
      ans+=B[B.size()-1];
      B.pop();
      }
    }
  cout<<ans<<endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:22:11: error: redeclaration of 'std::vector<long long int> B'
   22 |   vi C(N),B(N);
      |           ^
a.cc:21:6: note: 'std::vector<long long int> B' previously declared here
   21 |   vi B;
      |      ^
a.cc:25:5: error: 'D' was not declared in this scope
   25 |     D[i]=A[i].second;
      |     ^
a.cc:30:19: error: 'D' was not declared in this scope
   30 |       B.push_back(D[j]);
      |                   ^
a.cc:35:9: error: 'class std::vector<long long int>' has no member named 'pop'
   35 |       B.pop();
      |         ^~~
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 n,m;
  cin>>n>>m;
  priority_queue<pll, vector<pll>, greater<pll>> p;
  rep(i,n){
    ll a,b;
    cin>>a>>b;
    pll o=mp(a,b);
    p.pu(o);
  }
  stack<pll> s;
  ll ans=0;
  rep(i,n){
    if(!p.empty()){
      pll k=p.top();
    }
    else k=mp(100000000,8889);
    if(i+1<k.F){
      if(!s.empty()){
        pll h=s.top();
        s.pop();
        ans+=h.S;
      }
    }
    else{
      s.push(k);
      p.pop();
    }
  }
  COUT(ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:10: error: 'k' was not declared in this scope
   52 |     else k=mp(100000000,8889);
      |          ^
a.cc:53:12: error: 'k' was not declared in this scope
   53 |     if(i+1<k.F){
      |            ^
Language: C++

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

int main(){
  long long n, m; cin >> n >> m;
  vector<pair<long long>> ab(n);
  for(int i = 0; i < n; i++){
    cin >> ab.at(i).first >> ab.at(i).second;
  }
  sort(ab.begin(), ab.end());
  long long out;
  priority_queue<long long> que;
  int ind = 0;
  for(int i = 1; i < m + 1; i++){
    for(int j = ind; j < n; j++){
      if(ab.at(j).first <= i){
        que.push(ab.at(j).second);
        if(j == n - 1) ind = n;
      }else{
        ind = j;
        break;
      }
    }
    if(!que.empty()){
      out += que.top();
      que.pop();
    }
  }
  cout << out;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:20: error: wrong number of template arguments (1, should be 2)
    6 |   vector<pair<long long>> ab(n);
      |                    ^~~~
In file included 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,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:89:12: note: provided for 'template<class _T1, class _T2> struct std::pair'
   89 |     struct pair;
      |            ^~~~
a.cc:6:24: error: template argument 1 is invalid
    6 |   vector<pair<long long>> ab(n);
      |                        ^~
a.cc:6:24: error: template argument 2 is invalid
a.cc:8:15: error: request for member 'at' in 'ab', which is of non-class type 'int'
    8 |     cin >> ab.at(i).first >> ab.at(i).second;
      |               ^~
a.cc:8:33: error: request for member 'at' in 'ab', which is of non-class type 'int'
    8 |     cin >> ab.at(i).first >> ab.at(i).second;
      |                                 ^~
a.cc:10:11: error: request for member 'begin' in 'ab', which is of non-class type 'int'
   10 |   sort(ab.begin(), ab.end());
      |           ^~~~~
a.cc:10:23: error: request for member 'end' in 'ab', which is of non-class type 'int'
   10 |   sort(ab.begin(), ab.end());
      |                       ^~~
a.cc:16:13: error: request for member 'at' in 'ab', which is of non-class type 'int'
   16 |       if(ab.at(j).first <= i){
      |             ^~
a.cc:17:21: error: request for member 'at' in 'ab', which is of non-class type 'int'
   17 |         que.push(ab.at(j).second);
      |                     ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define REP(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

#define ALL(x) (x).begin(),(x).end()
typedef long long ll;

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev


int main(){
  int N,M;
  cin >> N >> M;
  vector<int> *v = new vector<int>[M+1];
  REP(i,N){
    int a,b;
    cin >> a >> b;
    v[a].push_back(b);
  }

  priority_queue<int> pq;
  int ans = 0;
  REP(i,1,M+1){
    for(auto x : v[i]) pq.push(x);
    if(pq.empty()) continue;
    ans += pq.top();
    pq.pop();
  }

  cout << ans << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:38:23: error: expected '}' at end of input
   38 |   cout << ans << endl;
      |                       ^
a.cc:19:11: note: to match this '{'
   19 | int main(){
      |           ^
Language: C++

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

int main() {
 int n , m;
  cin >> n >> m;
  pair<int,int> c[100010];
  
  int a[100010],b[100010];
  
  for(int i=0;i<n;i++){
    
    cin >> a[i] >> b[i];
    
    c[i] = make_pair(a[i],b[i]);
    
  }
  
  sort(c,c+n);
  
  
  priority_queue<int> p;
  
  int res=0,ans=0;
  
  for(int i=1;i< =m;i++){
    while(c[res].first<=i){
      p.push(c[res].second);
      res++;
    }
    if(!p.empty()){
      ans+=p.top();
      p.pop();
    }
  }
  cout << ans << endl;
}
  
  
  
    


Compiler output:
a.cc: In function 'int main()':
a.cc:28:18: error: expected primary-expression before '=' token
   28 |   for(int i=1;i< =m;i++){
      |                  ^
Language: C++

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

int main() {
 int n , m;
  cin >> n >> m;
  
  int a[100010],b[100010];
  
  for(int i=0;i<n;i++){
    
    cin >> a[i] >> b[i];
    
    c[i] = make_pair(a[i],b[i]);
    
  }
  
  sort(c,c+n);
  
  
  priority_queue<int> p;
  
  int res=0,ans=0;
  
  for(int i=1;i< =m;i++){
    while(c[res].first<=i){
      p.push(c[t].second);
      res++;
    }
    if(!p.empty()){
      ans+=p.top();
      p.pop();
    }
  }
  cout << ans << endl;
}
  
  
  
    

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'c' was not declared in this scope
   16 |     c[i] = make_pair(a[i],b[i]);
      |     ^
a.cc:20:8: error: 'c' was not declared in this scope
   20 |   sort(c,c+n);
      |        ^
a.cc:27:18: error: expected primary-expression before '=' token
   27 |   for(int i=1;i< =m;i++){
      |                  ^
a.cc:29:16: error: 't' was not declared in this scope
   29 |       p.push(c[t].second);
      |                ^
Language: C++

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

int main(){
  int n,m;
  cin >> n >> m;
  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>=1;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:19:3: error: 'priority_queue' was not declared in this scope
   19 |   priority_queue<int> q;
      |   ^~~~~~~~~~~~~~
a.cc:4:1: note: 'std::priority_queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
    3 | #include<vector>
  +++ |+#include <queue>
    4 | #include<algorithm>
a.cc:19:18: error: expected primary-expression before 'int'
   19 |   priority_queue<int> q;
      |                  ^~~
a.cc:23:7: error: 'q' was not declared in this scope
   23 |       q.push(b);
      |       ^
a.cc:25:9: error: 'q' was not declared in this scope
   25 |     if(!q.empty()){
      |         ^
Language: C++

#include <queue>
#include <iostream>

using namespace std;
typedef long long ll;
typedef pair<ll,ll> Pair;

bool compare_pair_by_first(Pair a, Pair b) {
    return a.first < b.first;
}

bool operator<(Pair &a, Pair &b) {
    return a.second < b.second;
}

int main() {
    long long n,m; cin >> n >> m;
    vector<Pair> pairs(n);
    for(ll i = 0; i < n; i++) {
        ll tmpa, tmpb;
        cin >> tmpa >> tmpb;
        pairs[i] = make_pair(tmpa,tmpb);
    }
    sort(pairs.begin(), pairs.end(), compare_pair_by_first);
    priority_queue<Pair> pq;
    // for(auto p: pairs) {
    //     cout << p.first << " " << p.second << endl;
    // }
    int current = 0;
    ll ans = 0;
    for(ll i = 0; i <= m; i++) {
        for(auto it = pairs.begin() + current; it != pairs.end(); it++) {
            if(it->first > i) {
                current = it - pairs.begin();
                break;
            }
            pq.push(*it);
        }
        if(!pq.empty()) {
            ans += pq.top().second;
            pq.pop();
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   24 |     sort(pairs.begin(), pairs.end(), compare_pair_by_first);
      |     ^~~~
      |     short
Language: C++

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

int main(){
  int n,m;
  cin >> n >> m;
  vector<int> jobs[m];
  rep(i,n){
    int a,b;
    cin >> a >> b;
    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);
    }
    while(!q.empty()){
      ans += q.top(); q.pop();
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: 'priority_queue' was not declared in this scope
   17 |   priority_queue<int> q;
      |   ^~~~~~~~~~~~~~
a.cc:4:1: note: 'std::priority_queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
    3 | #include<vector>
  +++ |+#include <queue>
    4 | #define rep(i,n) for(int i=0;i<n;i++)
a.cc:17:18: error: expected primary-expression before 'int'
   17 |   priority_queue<int> q;
      |                  ^~~
a.cc:21:7: error: 'q' was not declared in this scope
   21 |       q.push(b);
      |       ^
a.cc:23:12: error: 'q' was not declared in this scope
   23 |     while(!q.empty()){
      |            ^
Language: C++

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

int main(){
  int n,m;
  cin >> n >> m;
  vector<int> jobs[m];
  rep(i,n){
    int a,b;
    cin >> a >> b;
    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);
    }
    ans += q.top(). q.pop();
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: 'priority_queue' was not declared in this scope
   17 |   priority_queue<int> q;
      |   ^~~~~~~~~~~~~~
a.cc:4:1: note: 'std::priority_queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
    3 | #include<vector>
  +++ |+#include <queue>
    4 | #define rep(i,n) for(int i=0;i<n;i++)
a.cc:17:18: error: expected primary-expression before 'int'
   17 |   priority_queue<int> q;
      |                  ^~~
a.cc:21:7: error: 'q' was not declared in this scope
   21 |       q.push(b);
      |       ^
a.cc:23:12: error: 'q' was not declared in this scope
   23 |     ans += q.top(). q.pop();
      |            ^
Language: C++

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

int main(){
    int N, M;
    cin >> N >> M;
    vector<vector <int>> jobs(M);
    for(int i = 0; i < N; i++){
        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:22:20: error: 'q' was not declared in this scope
   22 |             ans += q.top();
      |                    ^
Language: C++

#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
#define vpush(a,x) a.push_back(x);
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define INF 2e9
int fact(int n){
  int m;
  if (n == 0)
      return 1;
  m = fact(n - 1);    
  return n * m;       
}
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n,m;
  cin>>n>>m;
  vector<int> bit[100100];
  rep(i,n){
      int a,b;
      cin>>a>>b;
      bit[a].push_back(b);
  }
  priority_queue<int> que;
  int ans=0;
  for(int i=1;i<=m;i++){
      for(auto v:g[i]){
	  que.push(v);
      }
      if(!que.empty()){
	  int res=que.top();
	  que.pop();
	  ans+=res;
      }
  }
  cout<<ans<<'\n';
  return(0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:56:18: error: 'g' was not declared in this scope
   56 |       for(auto v:g[i]){
      |                  ^
Language: C++

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

int main(){
  int n,m;
  cin>>n>>m;
  vector<vector<int>>jobs(m)//二重配列、m日後まで
  rep(i,n){
    int a,b;
    cin>>a>>b;
    if(a>m)continue;//m日後までに終わらなければ、対象外
    jobs[m-a].push_back(b);//期限までの余裕日数毎に分類し、報酬を入力
  }
  priority_queue<int>q;//プライオリティ・キューで報酬の最大値を出力
  ll ans=0;//long longなので注意
  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:2:18: error: expected ',' or ';' before 'for'
    2 | #define rep(i,n) for(int i=0;i<n;++i)
      |                  ^~~
a.cc:10:3: note: in expansion of macro 'rep'
   10 |   rep(i,n){
      |   ^~~
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   rep(i,n){
      |       ^
a.cc:2:30: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0;i<n;++i)
      |                              ^
Language: C++

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

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;j>=0;--i){
    for(int b:jobs[i]){
      q.puth(b);
    }
    if (!q.empty()){
      ans+=q.top();
      q.pop();
    }
  }  

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'j' was not declared in this scope
   18 |   for(int i=m-1;j>=0;--i){
      |                 ^
a.cc:20:9: error: 'class std::priority_queue<int>' has no member named 'puth'; did you mean 'push'?
   20 |       q.puth(b);
      |         ^~~~
      |         push
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:15: error: statement cannot resolve address of overloaded function
   15 |     jobs[m-a].push_back;
      |     ~~~~~~~~~~^~~~~~~~~
Language: C++

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

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> p;
  ll ans = 0;
  for(int i=m-1;i>=0;i++){
    for(int j : jobs[i]){
      p.push(j);
    }
    if(!p.empty()){
      ans += p.top();
      p.pop();
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: no matching function for call to 'std::vector<std::vector<int> >::push_back(int&)'
   15 |     jobs[m-a].push_back(b);
      |     ~~~~~~~~~~~~~~~~~~~^~~
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:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; value_type = std::vector<int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'int' to 'const std::vector<std::vector<int> >::value_type&' {aka 'const std::vector<int>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; value_type = std::vector<int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::vector<int> >::value_type&&' {aka 'std::vector<int>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:20:23: error: cannot convert 'std::vector<int>' to 'int' in initialization
   20 |     for(int j : jobs[i]){
      |                       ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: 'priprity_queue' was not declared in this scope
   17 |   priprity_queue<int> p;
      |   ^~~~~~~~~~~~~~
a.cc:17:18: error: expected primary-expression before 'int'
   17 |   priprity_queue<int> p;
      |                  ^~~
a.cc:21:7: error: 'p' was not declared in this scope
   21 |       p.push(j);
      |       ^
a.cc:23:9: error: 'p' was not declared in this scope
   23 |     if(!p.empty()){
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef double D;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
 
#define rd(x) scanf("%d",&x)
#define rd2(x,y) scanf("%d %d",&x,&y)
#define rl(x) scanf("%lld",&x)
#define rl2(x,y) scanf("%lld %lld",&x,&y)
#define wd(x) printf("%d" ,x)
#define wd2(x,y) printf("%d %d",x,y)
#define wl(x) printf("%lld",x)
#define wl2(x,y) printf("%lld %lld",x,y)
#define PC(x) putchar(x)
#define GC() getchar()
#define NL printf("\n")
#define SP printf(" ")
 
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a,value) memset(a, value, sizeof(a))

#define F first
#define S second
#define MP make_pair
#define PB push_back

#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)
#define fr(i,s,e) for(int i=s;i<e;i++)
#define frl(i,s,e) for(ll i=s;i<e;i++)
#define frr(i,s,e) for(int i=s-1;i>=e;i--)
#define frv(i,a) for(int i = 0;i<(int)a.size();i++)
#define frvr(i,a) for(int i = a.size()-1;i>=0;i--)
#define tr(i,a) for(typeof(a.begin()) i = a.begin(); i != a.end();i++)

#define mod 1000000007
#define maxn 100009
#define maxr 100009
int main(){
	//sstd::ios::sync_with_stdio(false); cin.tie(NULL);
	ll n,m;
	cin>>n
	vector<PLL> arr;
	priority_queue<PLL> q;

	fr(i,0,n)
	{
		ll x,y;
		//rl2(x,y);
		cin>>x>>y;
		arr.PB(MP(x,y));
		q.push(MP(y,x));
	}
	sort(ALL(arr));
	ll ans=0;
	map<ll,ll> mp;
	int flag=1;
	// fr(i,0,n)
	// {
	// 	if(arr[i].F>m)
	// 		break;
	// 	if(!mp.count(arr[i].F))
	// 	{
	// 		ans+=arr[i].S;
	// 		mp[arr[i].F]=arr[i].S;
	// 	}
	// 	else
	// 	{
	// 		if(arr[i].S>mp[arr[i].F])
	// 		{
	// 			ans-=mp[arr[i].F];
	// 			mp[arr[i].F]=arr[i].S;
	// 			ans+=arr[i].S;
	// 		}
	// 	}
	// }
	int i=0;
	while(i<m)
	{
		PLL pr=q.top();
		q.pop();
		if(pr.S<=m)
		{
			
			// if(pr.S==m)
			// {
			// 	if(flag)
			// 		ans+=pr.F;
			// }
			// else
			// 	ans+=pr.F;
			// if(pr.S==m)
			// {
			// 	flag=0;
			// }
			if(mp[pr.S]<m-pr.S+1)
			{
				mp[pr.S]++;
				ans+=pr.F;
				i++;
			}
		}
		if(q.empty())
			break;
	}
	wl(ans);
	NL;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:15: error: expected ';' before 'vector'
   50 |         cin>>n
      |               ^
      |               ;
   51 |         vector<PLL> arr;
      |         ~~~~~~ 
a.cc:59:17: error: 'arr' was not declared in this scope; did you mean 'frr'?
   59 |                 arr.PB(MP(x,y));
      |                 ^~~
      |                 frr
a.cc:62:18: error: 'arr' was not declared in this scope; did you mean 'frr'?
   62 |         sort(ALL(arr));
      |                  ^~~
a.cc:25:16: note: in definition of macro 'ALL'
   25 | #define ALL(a) a.begin(), a.end()
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
	int n,m,a,b;
	long long ans=0;
	vector<pair<int,int>> c;
	vector<pair<int,int>> c1;
	cin>>n>>m;
	for(int i=0;i<n;i++){
		cin>>a>>b;
		c.emplace_back(make_pair(a,b));
		c1.emplace_back(make_pair(b,a));
	}
	sort(c.begin(),c.end());
	sort(c1.begin(),c1.end());
	for(int t=n-1;t>=0;t--){
		cout<<c[t].first<<" "<<c[t].second<<endl;
	}
	for(int t=n-1;t>=0;t--){
		cout<<c1[t].second<<" "<<c1[t].first<<endl;
	}
	for(int k=0;k<m;k++){
		bool escape=false;
		for(int l=n-1;l>=0;l--){
			if(c[l].first+k==m-???){
				ans+=c[l].second;
				escape=true;
				break;
			}
		}
		if(escape==true)continue;
		for(int j=n-1;j>=0;j--){
			if(c1[j].second+k<=m){
			ans+=c1[j].first;
			c1[j].second=1000000;
			break;
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}
		
			



Compiler output:
a.cc:25:45: warning: trigraph ??) ignored, use -trigraphs to enable [-Wtrigraphs]
   25 |                         if(c[l].first+k==m-???){
a.cc: In function 'int main()':
a.cc:25:44: error: expected primary-expression before '?' token
   25 |                         if(c[l].first+k==m-???){
      |                                            ^
a.cc:25:45: error: expected primary-expression before '?' token
   25 |                         if(c[l].first+k==m-???){
      |                                             ^
a.cc:25:46: error: expected primary-expression before '?' token
   25 |                         if(c[l].first+k==m-???){
      |                                              ^
a.cc:25:47: error: expected primary-expression before ')' token
   25 |                         if(c[l].first+k==m-???){
      |                                               ^
a.cc:25:47: error: expected ':' before ')' token
   25 |                         if(c[l].first+k==m-???){
      |                                               ^
      |                                               :
a.cc:25:47: error: expected primary-expression before ')' token
a.cc:25:47: error: expected ':' before ')' token
   25 |                         if(c[l].first+k==m-???){
      |                                               ^
      |                                               :
a.cc:25:47: error: expected primary-expression before ')' token
a.cc:25:47: error: expected ':' before ')' token
   25 |                         if(c[l].first+k==m-???){
      |                                               ^
      |                                               :
a.cc:25:47: error: expected primary-expression before ')' token
Language: C

include<stdio.h>
int main(void){
	int n,m,i,j,k;
	if (scanf("%d", &n) == 1) {
	} else {
        printf("Failed to read integer.\n");
    }
    if (scanf("%d", &m) == 1) {
	} else {
        printf("Failed to read integer.\n");
    }
	int a[100000]={0};
	int b[100000]={0};
	int c[100000]={0};
	int max[100000]={0};
	int num=0;
    for(i=1;i<=n;i++){
    	if (scanf("%d", &a[i]) == 1) {
		} else {
        	printf("Failed to read integer.\n");
    	}
    	if (scanf("%d", &b[i]) == 1) {
		} else {
        	printf("Failed to read integer.\n");
    	}
    }
    int mm=0;
    for(i=0;i<m;i++){
    	for(j=1;j<=n;j++){
   			if(a[j] <= i+1){
          if(max[i]<b[j]){
   				 max[i]=b[j];
   				 num=j;
   			  }
   		   }
      }
      a[num]=100000;
      mm+=max[i];
      //printf("%d ", max[i]);
    }
    printf("%d",mm);
    return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C++

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

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:23:20: error: expected ';' before ')' token
   23 |       ans +=q.top());
      |                    ^
      |                    ;
Language: C++

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

int main(){
  int n,m;
  cin >> n >> m;
  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;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: expected unqualified-id before '<<' token
    9 |   vector<<int>> jobs[m];
      |         ^~
a.cc:15:5: error: 'jobs' was not declared in this scope
   15 |     jobs[m-a].push_back(b);
      |     ^~~~
a.cc:20:17: error: 'jobs' was not declared in this scope
   20 |     for(int b : jobs[i]){
      |                 ^~~~
Language: C++

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

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);
  }
  priprity_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:17:3: error: 'priprity_queue' was not declared in this scope
   17 |   priprity_queue<int> q;
      |   ^~~~~~~~~~~~~~
a.cc:17:18: error: expected primary-expression before 'int'
   17 |   priprity_queue<int> q;
      |                  ^~~
a.cc:21:7: error: 'q' was not declared in this scope
   21 |       q.push(b);
      |       ^
a.cc:23:8: error: 'q' was not declared in this scope
   23 |     if(q.empty()){
      |        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
vector<int>ve[100005];
int mian()
{
	int n,m;
	int a,b;
	cin>>n>>m;
	for(int i=0;i<n;i++)
	{
		cin>>a>>b;
		if(a>m)	continue;
		ve[m-a+1].push_back(b);
	}
	priority_queue<int>q;
	int sum=0;
	for(int i=m;i>=1;i--)
	{
		for(int v:ve[i])
		q.push(v);
		sum+=q.top();
		q.pop();
	}
	cout<<sum;
	return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

#include<bits/stdc++.h>
using namespace std;
vector<int>ve[100005];
int mian()
{
	int n,m;
	int a,b;
	cin>>n>>m;
	for(int i=0;i<n;i++)
	{
		cin>>a>>b;
		if(a>m)	continue;
		ve[m-a+1].push_back(b);
	}
	priority_queue<int>q;
	int sum=0;
	for(int i=m;i>=1;i--)
	{
		for(int v:ve[i])
		q.push(v);
		sum+=q.top();
		q.pop();
	}
	cout<<sum;
	return 0;
}

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

#include <iostream>
#include <algorithm>
#include <set>

bool compare(const int &lhs, const int &rhs)
{
    return lhs > rhs;
}

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

    std::vector< std::vector<int> > vec(100010);
    int x, y;
    for (int i = 0; i < n; ++i)
    {
        std::cin >> x >> y;
        vec[x].push_back(y);
    }

    std::multiset<int> taken;

    for (int i = m; i > 0; --i)
    {
        std::sort(vec[i].begin(), vec[i].end(), compare);

        int maxSize = m - i + 1;
        for (int j = 0; j < vec[i].size(); ++j)
        {
            if (taken.size() < maxSize)
                taken.insert(vec[i][j]);
            else
            {
                if (*(taken.begin()) < vec[i][j])
                {
                    taken.erase(taken.begin());
                    taken.insert(vec[i][j]);
                }
            }
        }
    }

    int ans = 0;
    for (auto it : taken)
    {
        ans += it;
    }

    std::cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: 'vector' is not a member of 'std'
   15 |     std::vector< std::vector<int> > vec(100010);
      |          ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <set>
  +++ |+#include <vector>
    4 | 
a.cc:15:23: error: 'vector' is not a member of 'std'
   15 |     std::vector< std::vector<int> > vec(100010);
      |                       ^~~~~~
a.cc:15:23: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:15:30: error: expected primary-expression before 'int'
   15 |     std::vector< std::vector<int> > vec(100010);
      |                              ^~~
a.cc:20:9: error: 'vec' was not declared in this scope
   20 |         vec[x].push_back(y);
      |         ^~~
a.cc:27:19: error: 'vec' was not declared in this scope
   27 |         std::sort(vec[i].begin(), vec[i].end(), compare);
      |                   ^~~
Language: C++

#include <bits/stdc++.h>
//#include <iostream>
//#include <algorithm>
//#include <vector>
//#include <prqueue>

using namespace std;

const int maxn=1e6+10;
const int inf=0x3f3f3f3f;

vector<int> ve[maxn];

int main()
{
//	freopen("input.txt","r",stdin);
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	
	int n,k;
	cin>>n>>k;
	int a,b;
	for(int i=0;i<n;i++) 
	{
		cin>>a>>b;
		if(a>k) continue;
		ve[k-a+1].push_back(b);
	}
	priority_queue<int> q;
	ll earn=0;
	for(int i=k;i>=1;i--)
	{
		for(int v:ve[i]) q.push(v);
		if(!q.empty())
		{
			earn+=q.top();
			q.pop();
		}
	}
	cout<<earn;
	
	
	return 0;
 } 
 
 //以相同天数，但权值最大的数先挑选。
 //为什么是k-a+1天之前？	 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: 'll' was not declared in this scope
   31 |         ll earn=0;
      |         ^~
a.cc:37:25: error: 'earn' was not declared in this scope
   37 |                         earn+=q.top();
      |                         ^~~~
a.cc:41:15: error: 'earn' was not declared in this scope
   41 |         cout<<earn;
      |               ^~~~
Language: C

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

struct node{
	int x,y;
}a[100009];

bool cmp(node x,node y)
{
	if(x.y !=y.y) return x.y >y.y ;
	else return x.x>y.x ;
}

int main()
{
	int m,n;
	cin>>n>>m;
	for(int i=0;i<n;i++)
	{
		cin>>a[i].x>>a[i].y ;
	}
	sort(a,a+n,cmp);
	int j=m;
	int sum=0;
	for(int i=0;i<n;i++)
	{
		if(j>=a[i].x )
		{
			sum=sum+a[i].y ;
			j--;
		}
	}
	cout<<sum<<endl;
	return 0;
} 

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

#include <queue>
 
using namespace std;
 
#define MAX_A 100000
 
priority_queue<int> getMoneyJob;
 
int main()
{
	const int MAX_N = 100000;
	int n, m;
	cin >> n >> m;
 
// i日後に支払われるのかでまとめる。
vector<int> salary[MAX_A] = {};
	for (int i = 0; i < n; i++)
	{
		int _a, _b;
		cin >> _a >> _b;
		salary[_a].push_back(_b);
	}
 
 
	int answer = 0;
 
	// 期限まで1日前からはじめて、報酬を得られる仕事を追加していく。
	// 行った仕事は削除していく
	for (int i = 1; i <= m; i++)
	{
		// 報酬取得可能な仕事の追加
		int iSize = salary[i].size();
		if (iSize > 0)
		{
			for (int j = 0; j < iSize; j++)
				getMoneyJob.push(salary[i][j]);
		}
 
		// 最も高額なものを取り出す
		if (!getMoneyJob.empty())
		{
			answer += getMoneyJob.top();
			getMoneyJob.pop();
		}
	}
 
	cout << answer;
 
 
	return 0;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'cin' was not declared in this scope
   13 |         cin >> n >> m;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <queue>
  +++ |+#include <iostream>
    2 | 
a.cc:47:9: error: 'cout' was not declared in this scope
   47 |         cout << answer;
      |         ^~~~
a.cc:47:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C

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

#define REP(i, n) for(int (i) = 0; (i) < (n); (i)++)

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

  vector<pair<int, int>> work(n);

  int a, b;
  REP(i, n){
    cin >> a >> b;
    work[i] = make_pair(a, b);
  }

  sort(work.begin(), work.end());

  /*
  REP(i, n){
    cout << work[i].first << " " << work[i].second << endl;
  }
  */

  priority_queue<int> queue;

  int start = 0, ans = 0;
  for(int i = 1; i <= m; i++){
    for(int j = start; j < n; j++){
      if(work[j].first <= i){
        //cout << work[j].second << endl;
        queue.push(work[j].second);
      }else{
        start = j;
        break;
      }
    }

    if(!queue.empty()){
      ans += queue.top();
      queue.pop();
    }
  }

  cout << ans << endl;

  return 0;
}


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

#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int acs(const void *a, const void *b) { return *(int *)a - *(int *)b; } /* 1,2,3,4.. */
int des(const void *a, const void *b) { return *(int *)b - *(int *)a; } /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b)
{
	return *(char *)a - *(char *)b;
} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b)
{
	return strcmp(*(const char **)a, *(const char **)b);
} /* aaa,aab.. */
#define min(a, b) (a < b ? a : b)
#define max(a, b) (a > b ? a : b)
#define rep(i, n) for (int i = 0; i < n; i++)
#define MAX 100001

typedef struct
{
	long long int pri;
	long long int val;
} que;

que pq[MAX];
int pq_size = 0;

void PQadd(long long int pri, long long int val)
{
	int last = ++pq_size;
	que new;
	new.pri = pri;
	new.val = val;
	pq[pq_size] = new;

	while (last > 1 && pq[last].pri > pq[last / 2].pri)
	{
		que temp;
		temp = pq[last];
		pq[last] = pq[last / 2];
		pq[last / 2] = temp;
		last /= 2;
	}
	return;
}

que PQget(void)
{
	que root = pq[1];
	pq[1] = pq[pq_size--];

	int last = 1, bigger_child;
	while (last * 2 <= pq_size)
	{
		if (last * 2 == pq_size)
			bigger_child = last * 2;
		else
			bigger_child = pq[last * 2].pri > pq[last * 2 + 1].pri ? last * 2 : last * 2 + 1;

		if (pq[last].pri < pq[bigger_child].pri)
		{
			que temp;
			temp = pq[last];
			pq[last] = pq[bigger_child];
			pq[bigger_child] = temp;
			last = bigger_child;
		}
		else
			break;
	}
	return root;
}

int main(void)
{
	int n, m;
	scanf("%d %d", &n, &m);

	int ab[n][2];
	int i, j, k;
	for (i = 0; i < n; i++)
		scanf("%d %d", &ab[i][0], &ab[i][1]);

	qsort(ab, n, sizeof(*ab), acs);

	int ans = 0;
	i = 0;
	for (j = 1; j <= m; j++)
	{
		while (i < n && ab[i][0] <= j)
		{
			PQadd(ab[i][1], 0);
			i++;
		}
		if (pq_size != 0)
			ans += PQget().pri;
	}

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

	return 0;
}


Compiler output:
a.cc: In function 'void PQadd(long long int, long long int)':
a.cc:35:13: error: expected unqualified-id before 'new'
   35 |         que new;
      |             ^~~
a.cc:36:12: error: expected type-specifier before '.' token
   36 |         new.pri = pri;
      |            ^
a.cc:37:12: error: expected type-specifier before '.' token
   37 |         new.val = val;
      |            ^
a.cc:38:26: error: expected type-specifier before ';' token
   38 |         pq[pq_size] = new;
      |                          ^
Language: C++

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

typedef long long ll;
typedef pair<ll,int> pli;

const int N = 1e5;

vector<int> vi;
int par[N+5];
int n,m;

int find_par(int x){
	if(par[x] == x) return x;
	return par[x] = find_par(par[x]);
}

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> m;
	for(int i=1;i<=m;i++) par[i] = i;
	for(int i=1;i<=n;i++){
		int u; ll v;
		cin >> u >> v;
		vi.push_back(make_pair(v,u));
	}
	sort(vi.begin(),vi.end());
	reverse(vi.begin(),vi.end());
	ll ans = 0ll;
	for(int i=0;i<vi.size();i++){
		int tmp = vi[i].second;
		int jadi = m - tmp;
		jadi = find_par(jadi);
		if(jadi == 0) continue;
		ans+=vi[i].first;
		par[jadi] = jadi-1;
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:29: error: no matching function for call to 'std::vector<int>::push_back(std::pair<long long int, int>)'
   25 |                 vi.push_back(make_pair(v,u));
      |                 ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
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:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'std::pair<long long int, int>' to 'const std::vector<int>::value_type&' {aka 'const int&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'std::pair<long long int, int>' to 'std::vector<int>::value_type&&' {aka 'int&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:31:33: error: request for member 'second' in 'vi.std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   31 |                 int tmp = vi[i].second;
      |                                 ^~~~~~
a.cc:35:28: error: request for member 'first' in 'vi.std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   35 |                 ans+=vi[i].first;
      |                            ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
struct qwq{
	int a,b;
	inline bool operator<(const qwq &x)const
	{
	   return a<x.a;
	}
} x[100005];
priority_queue<int>q;
int main()
{
	int n, m, i, j=1, s=0;
	cin>>n>>m
	for(i=1;i<=n;++i)
	   cin>>x[i].a>>x[i].b;
	sort(x+1, x+n+1);
	for(i=1;i<=m;++i)
	{
		for(;x[j].a==i&&j<=n;++j)
		   q.push(x[j].b);
		if(!q.empty())
		{
		   s += q.top();
		   q.pop();
		}
	}
	cout<<s;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: expected ';' before 'for'
   14 |         cin>>n>>m
      |                  ^
      |                  ;
   15 |         for(i=1;i<=n;++i)
      |         ~~~       
a.cc:15:25: error: expected ';' before ')' token
   15 |         for(i=1;i<=n;++i)
      |                         ^
      |                         ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
struct qwq{
	int a,b;
	inline bool operator<(const qwq &x)const{
	   return a<x.a;
	}
}x[100005];
priority_queue<int> q;
int main(){
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	int n,m;
	cin>>n>>m;
	for(int i=1;i<=n;i++){
		cin>>x[i].a>>x[i].b;
	}
	sort(x+1,x+n+1);
	for(int i=1;i<=m;i++){
		for(int j=0;x[j].a>=i&&j<=n;j++){
			q.push(x[j].b);
			if(!q.empty()){
				s+=q.top();
				q.pop();
			}
		}
	}
	cout<<s<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:33: error: 's' was not declared in this scope
   23 |                                 s+=q.top();
      |                                 ^
a.cc:28:15: error: 's' was not declared in this scope
   28 |         cout<<s<<endl;
      |               ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
 
int main(){
    int n,m;
    cin>>n>>m;
    int a[n],b[n];
    rep(i,n)cin>>a[i]>>b[i];
    multiset<pair<int,int>> yet;
    rep(i,n)yet.insert({a[i],b[i]});
    ll ans = 0;
    priority_queue<int> pq;
    REP(i,1,m+1){
        auto itr = yet.begin();
        while(itr!=yet.end()&&itr->first<=i){
            pq.push(itr->second);
            itr = yet.erase(itr);
        }
        if(pq.size()){
            ans+=pq.top();
            pq.pop();
        }
    }
    cout<<ans<<endl;
    return 0;
}
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main(){
    int n,m;
    cin>>n>>m;
    int a[n],b[n];
    rep(i,n)cin>>a[i]>>b[i];
    multiset<pair<int,int>> yet;
    rep(i,n)yet.insert({a[i],b[i]});
    ll ans = 0;
    priority_queue<int> pq;
    REP(i,1,m+1){
        auto itr = yet.begin();
        while(itr!=yet.end()&&itr->first<=i){
            pq.push(itr->second);
            itr = yet.erase(itr);
        }
        if(pq.size()){
            ans+=pq.top();
            pq.pop();
        }
    }
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc:68:11: error: redefinition of 'const int inf'
   68 | const int inf=1e9+7;
      |           ^~~
a.cc:21:11: note: 'const int inf' previously defined here
   21 | const int inf=1e9+7;
      |           ^~~
a.cc:69:10: error: redefinition of 'const ll longinf'
   69 | const ll longinf=1LL<<60 ;
      |          ^~~~~~~
a.cc:22:10: note: 'const ll longinf' previously defined here
   22 | const ll longinf=1LL<<60 ;
      |          ^~~~~~~
a.cc:70:10: error: redefinition of 'const ll mod'
   70 | const ll mod=1e9+7 ;
      |          ^~~
a.cc:23:10: note: 'const ll mod' previously defined here
   23 | const ll mod=1e9+7 ;
      |          ^~~
a.cc:72:5: error: redefinition of 'int main()'
   72 | int main(){
      |     ^~~~
a.cc:25:5: note: 'int main()' previously defined here
   25 | int main(){
      |     ^~~~