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

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

// 未AC

int main() {
  int N, M;
  cin >> N >> M;
  vector<int64_t> alist(N);
  for (int i = 0; i < N; i++) {
    cin >> alist.at(i);
  }
  sort(alist.begin(), alist.end());
  
  vector<pair<int64_t, int64_t>> cblist(M);
  for (int i = 0; i < M; i++) {
    cin >> cblist.at(i).second >> cblist.at(i).first;
  }
  sort(cblist.begin(), cblist.end());
  reverse(cblist.begin(), cblist.end());

  /*
  int bsum=0;
  for (int i = 0; i < M; i++) {
    bsum += cblist.at(i).second;
  }
  */
  
  int sansyou=0;
  for (int i = 0; i < N); i++) {
    if (cblist.at(sansyou).second<=0 && sansyou<M-1) sansyou++;
    if (cblist.at(sansyou).second<=0 && sansyou==M-1) break;
    if (cblist.at(sansyou).first >= alist.at(i)) {
      alist.at(i)=cblist.at(sansyou).first;
      cblist.at(sansyou).second--;
    }
    else break;
  }
  
  int64_t ans = 0;
  for (int i = 0; i < N; i++) {
    ans += alist.at(i);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:24: error: expected ';' before ')' token
   30 |   for (int i = 0; i < N); i++) {
      |                        ^
      |                        ;
a.cc:30:27: error: 'i' was not declared in this scope
   30 |   for (int i = 0; i < N); i++) {
      |                           ^
Language: C++

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

// 未AC

int main() {
  int N, M;
  cin >> N >> M;
  vector<int64_t> alist(N);
  for (int i = 0; i < N; i++) {
    cin >> alist.at(i);
  }
  sort(alist.begin(), alist.end());
  
  vector<pair<int64_t, int64_t>> cblist(M);
  for (int i = 0; i < M; i++) {
    cin >> cblist.at(i).second >> cblist.at(i).first;
  }
  sort(cblist.begin(), cblist.end());
  reverse(cblist.begin(), cblist.end());
  
  int bsum=0;
  for (int i = 0; i < M; i++) {
    bsum += cblist.at(i).second;
  }
  
  int sansyou=0;
  for (int i = 0; i < min(N, bsum); i++) {
    if (cblist.at(sansyou).second<=0 && sansyou<M-1) sansyou++;
    if (cblist.at(sansyou).second<=0 && sansyou=M-1) break;
    if (cblist.at(sansyou).first >= alist.at(i)) {
      alist.at(i)=cblist.at(sansyou).first;
      cblist.at(sansyou).second--;
    }
    else break;
  }
  
  int64_t ans = 0;
  for (int i = 0; i < N; i++) {
    ans += alist.at(i);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:38: error: lvalue required as left operand of assignment
   30 |     if (cblist.at(sansyou).second<=0 && sansyou=M-1) break;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
Language: C++

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<int64_t> alist(N);
  for (int i = 0; i < N; i++) {
    cin >> alist.at(i);
  }
  sort(alist.begin(), alist.end());
  
  vector<pair<int64_t, int64_t>> cblist(M);
  for (int i = 0; i < M; i++) {
    cin >> cblist.at(i).second >> cblist.at(i).first;
  }
  sort(cblist.begin(), cblist.end());
  reverse(cblist.begin(), cblist.end());
  
  int64_t bsum=0;
  for (int i = 0; i < M; i++) {
    bsum += cblist.at(i).second;
  }
  
  int64_t sansyou=0;
  for (int i = 0; i < min(N, bsum); i++) {
    if (cblist.at(sansyou).second<=0) sansyou++;
    if (cblist.at(sansyou).first > alist.at(i)) {
      alist.at(i)=cblist.at(sansyou).first;
      cblist.at(sansyou).second--;
    }
    else break;
  }
  
  int64_t ans = 0;
  for (int i = 0; i < N; i++) {
    ans += alist.at(i);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:26: error: no matching function for call to 'min(int&, int64_t&)'
   26 |   for (int i = 0; i < min(N, bsum); i++) {
      |                       ~~~^~~~~~~~~
In file included 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_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:26:26: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'int64_t' {aka 'long int'})
   26 |   for (int i = 0; i < min(N, bsum); i++) {
      |                       ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:26:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   26 |   for (int i = 0; i < min(N, bsum); i++) {
      |                       ~~~^~~~~~~~~
Language: C++

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

int main() { 
  int N, M;
  cin >> N >> M;
  vector<int64_t> a(0);
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    a.push_back(a);
  }
  vector<pair<int64_t, int64_t>> b(M);
  for (int i = 0; i < M; i++) {
    cin >> b.at(i).second >> b.at(i).first;
  }
  sort(b.begin(), b.end());
  reverse(b.begin(), b.end());
  for (int i = 0; i < M; i++) {
    for (int j = 0; j < b.at(i).second; j++) {
      a.push_back(b.at(i).first);
      if (a.size() >= 2*N) {
        break;
      }
    }
  }
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  int64_t ans = 0;
  for (int i = 0; i < N; i++) {
    ans += a.at(i);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: request for member 'push_back' in 'a', which is of non-class type 'int'
   11 |     a.push_back(a);
      |       ^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
int i,j;
int N;
int M;
cin >> N >> M;
int A,B,C;
priority_queue<int,vector<int>,greater<int>> q;
pair<int,int>[M] CB;
for(i=0;i<N;i++){
  cin >> A;
  q.push(A);}
for(i=0;i<M;i++){
  cin >> B >> C;
  CB[i]=make_pair(C,B);}
sort(CB,CB+M);
int count = 0;
for(j=N-1;j>=0;j--){
  tie(C,B)=CB[j];
  while(B!=0){
    q.push(C);
    B--;
    count++;
    if(count>=N)break;
  }
  if(count>=N)break;
}
long long int ans = 0;
for(i=0;i<N;i++){
    ans += q.top();
    q.pop();
 }
 cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: structured binding declaration cannot have type 'std::pair<int, int>'
   11 | pair<int,int>[M] CB;
      |              ^~~
a.cc:11:14: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:11:15: error: conflicting declaration 'auto M'
   11 | pair<int,int>[M] CB;
      |               ^
a.cc:7:5: note: previous declaration as 'int M'
    7 | int M;
      |     ^
a.cc:11:18: error: expected initializer before 'CB'
   11 | pair<int,int>[M] CB;
      |                  ^~
a.cc:17:3: error: 'CB' was not declared in this scope; did you mean 'C'?
   17 |   CB[i]=make_pair(C,B);}
      |   ^~
      |   C
a.cc:18:6: error: 'CB' was not declared in this scope; did you mean 'C'?
   18 | sort(CB,CB+M);
      |      ^~
      |      C
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
int i,j;
int N;
int M;
cin >> N >> M;
int A,B,C;
priority_queue<int,vector<int>,greater<int>> q;
vector<pair<int,int>> CB;
for(i=0;i<N;i++){
  cin >> A;
  q.push(A);}
for(i=0;i<M;i++){
  cin >> B >> C;
  CB.push_back(make_pair(C,B));}
sort(CB.begin(),CB.end());
int count = 0;
for(j=N-1;j>=0;j--){
  tie(C,B)=vector[j];
  while(B!=0){
    q.push(C);
    B--;
    count++;
    if(count>=N)break;
  }
  if(count>=N)break;
}
long long int ans = 0;
for(i=0;i<N;i++){
    ans += q.top();
    q.pop();
 }
 cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:18: error: missing template arguments before '[' token
   21 |   tie(C,B)=vector[j];
      |                  ^
Language: C++

include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
int main() {
  int n,m,cnt=0;
  scanf("%d %d",&n,&m);
  vector<int> v(2*n);
  vector<pair<int,int>> p(m);
  rep(i,n) scanf("%d",&v[i]);
  rep(i,m) scanf("%d %d",&p[i].second,&p[i].first);
  sort(p.begin(),p.end());
  for (int i = m-1; i >= 0 && cnt < n; --i)
     rep(j,p[i].second) {
         v[n + cnt++]=p[i].first;
         if(cnt==n) break;
     }
  sort(v.begin(),v.end(),greater<int>());
  long long ans=0;
  rep(i,n) ans+=v[i];
  cout<<ans;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'scanf' was not declared in this scope
    6 |   scanf("%d %d",&n,&m);
      |   ^~~~~
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> v(2*n);
      |   ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> v(2*n);
      |          ^~~
a.cc:8:10: error: 'pair' was not declared in this scope
    8 |   vector<pair<int,int>> p(m);
      |          ^~~~
a.cc:8:15: error: expected primary-expression before 'int'
    8 |   vector<pair<int,int>> p(m);
      |               ^~~
a.cc:9:24: error: 'v' was not declared in this scope
    9 |   rep(i,n) scanf("%d",&v[i]);
      |                        ^
a.cc:10:27: error: 'p' was not declared in this scope
   10 |   rep(i,m) scanf("%d %d",&p[i].second,&p[i].first);
      |                           ^
a.cc:11:8: error: 'p' was not declared in this scope
   11 |   sort(p.begin(),p.end());
      |        ^
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(p.begin(),p.end());
      |   ^~~~
      |   short
a.cc:14:10: error: 'v' was not declared in this scope
   14 |          v[n + cnt++]=p[i].first;
      |          ^
a.cc:17:8: error: 'v' was not declared in this scope
   17 |   sort(v.begin(),v.end(),greater<int>());
      |        ^
a.cc:17:26: error: 'greater' was not declared in this scope
   17 |   sort(v.begin(),v.end(),greater<int>());
      |                          ^~~~~~~
a.cc:17:34: error: expected primary-expression before 'int'
   17 |   sort(v.begin(),v.end(),greater<int>());
      |                                  ^~~
a.cc:20:3: error: 'cout' was not declared in this scope
   20 |   cout<<ans;
      |   ^~~~
Language: C++

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

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

const int MOD=1000000007;
const int INF=1001001001;


int main(){
  ll n,m;
  cin>>n>>m;
  vector <ll> a;
  vector <ll> t;
  vector <P> p;
  rep(i,n){
    ll a1;cin>>a1;
    a.emplace_back(a1);
  }
  rep(i,m){
    ll b,c;
    cin>>b>>c;
    P pnow(c,b);
    p.emplace_back(pnow);
  }
  sort(a.begin(),a.end());
  sort(p.begin(),p.end());
  ll now=0;
  rep(i,m){
    if (now>n) break;
    ll p1,p2;
    p1=p[i].first;p2=p[i].second;
    now+=p2;

    rep(j,p2){
      t.emplace_back(p1);

    }
  }
  reverse(t.begin(),t.end());
  rep(i,n){
    if (t[i]>a[i])a[i]=t[i];
  //  cout<<a[i]<<endl;}
    else break;
  }
  ll ans=0;
  rep(i,min(n,t.size()){
    ans+=a[i];
  //  cout<<ans<<endl;
}
cout<<ans;
}


Compiler output:
a.cc:54:2: error: unterminated argument list invoking macro "rep"
   54 | }
      |  ^
a.cc: In function 'int main()':
a.cc:49:3: error: 'rep' was not declared in this scope
   49 |   rep(i,min(n,t.size()){
      |   ^~~
a.cc:49:6: error: expected '}' at end of input
   49 |   rep(i,min(n,t.size()){
      |      ^
a.cc:12:11: note: to match this '{'
   12 | int main(){
      |           ^
Language: C++

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

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	
	ll N,M;
	cin>>N>>M;
    vector<ll> A(N);

    rep(i,N){
        cin>>A[i];
    }
    sort(A.begin(),A.end());
    typedef pair<ll,ll> P;
    vector<P> BC(M);
    ll b,c;
    rep(i,M){
        cin>>b>>c;
        // BC[i] = P{b,c};
        BC[i] = P{1,1}
    }
    sort(BC.begin(),BC.end(),[](P p1,P p2){return p1.second>=p2.second;});
    vector<ll> new_num(N);
    ll ind = 0;
    rep(i,M){
        b = BC[i].first;
        c = BC[i].second;
        rep(j,b){
            new_num[ind]=c;
            ++ind;
            if(ind==N) break;
        }
        if(ind==N) break;
    }
    ll ans = 0;
    rep(i,N){
        ans += A[i];
    }
    ll max_ans = ans;

    rep(i,N){
        ans -= A[i];
        ans += new_num[i];
        max_ans = max(ans,max_ans);
    }
    cout<<max_ans<<"\n";

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:23: error: expected ';' before '}' token
   24 |         BC[i] = P{1,1}
      |                       ^
      |                       ;
   25 |     }
      |     ~
Language: C++

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

#define rep(i, n) REP(i, 0, n)
#define repr(i, n) for (int i = (n); i >= 0; i--)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

bool compare_by_sec(pii a, pii b)
{
    if (a.second != b.second)
        return a.second > b.second; // if we change < for >, we can sort desc by second_key
    else
        return a.first < b.first;
}

ll a[500000];
int main()
{
    ll n, m;
    cin >> n >> m;

    rep(i, n) cin >> a[i];

    sort(a, a + n);

    vector<pll> t(m);
    rep(i, m) cin >> t[i].first >> t[i].second;

    sort(ALL(t), compare_by_sec);

    ll ind[n] = {}; //c[i]使う個数

    ll cnt = 0;

    rep(i, m)
    {
        ll d = upper_bound(a.begin() + cnt, a.end(), t[i].second) - a.begin() - cnt;
        ind[i] = min(d, t[i].first);
        cnt += ind[i];
    }

    ll sum = 0;
    rep(i, m) sum += t[i].second * ind[i];
    for (int i = cnt; i < n; i++)
        sum += a[i];

    OP(sum);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:30: error: request for member 'begin' in 'a', which is of non-class type 'll [500000]' {aka 'long long int [500000]'}
   45 |         ll d = upper_bound(a.begin() + cnt, a.end(), t[i].second) - a.begin() - cnt;
      |                              ^~~~~
a.cc:45:47: error: request for member 'end' in 'a', which is of non-class type 'll [500000]' {aka 'long long int [500000]'}
   45 |         ll d = upper_bound(a.begin() + cnt, a.end(), t[i].second) - a.begin() - cnt;
      |                                               ^~~
a.cc:45:71: error: request for member 'begin' in 'a', which is of non-class type 'll [500000]' {aka 'long long int [500000]'}
   45 |         ll d = upper_bound(a.begin() + cnt, a.end(), t[i].second) - a.begin() - cnt;
      |                                                                       ^~~~~
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<queue>
#define ll long long
#define rep(i,n) for (int i=0; i<(int)(n); i++)
using namespace std;
int main() {
	int n, m;
	cin >> n >> m;
	priority_queue<pair<int, int>>q;
	long long A[100000];
	long long B[100000];
	long long C[100000];
	rep(i, n) {
		q.push(make_pair(A[i], 1));
	}
	rep(i, m) {
		q.push(make_pair(C[i], B[i]));
	}
	long long ans = 0;
	rep(i, n) {
		auto p = q.top();
		q.pop;
		ans += p.first;
		if (p.second > 1) {
			p.second--;
			q.push(p);
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:19: error: invalid use of non-static member function 'void std::priority_queue<_Tp, _Sequence, _Compare>::pop() [with _Tp = std::pair<int, int>; _Sequence = std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >; _Compare = std::less<std::pair<int, int> >]'
   25 |                 q.pop;
      |                 ~~^~~
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_queue.h:771:7: note: declared here
  771 |       pop()
      |       ^~~
Language: C++

#include <iostream>
#include <queue>
#include <vector>
typedef long long ll;
using namespace std;

bool pairCompare(const pair<int, int>& firstElof, const pair<int, int>& secondElof) {
	return firstElof.second > secondElof.second;
}

int main() {
	int n, m;
	priority_queue<int, vector<int>, greater<int>> a;
	vector<pair<int, int>> b(100000);
	cin >> n >> m;

	int temp;
	for (int i = 0; i < n; i++) {
		cin >> temp;
		a.push(temp);
	}

	int tempb, tempc;
	for (int i = 0; i < m; i++) {
		cin >> tempb >> tempc;
		b[i] = make_pair(tempb, tempc);
	}

	sort(b.begin(), b.end(), pairCompare);

	for (int i = 0; i < m; i++) {
		while (a.top() < b[i].second && b[i].first) {
			a.pop();
			a.push(b[i].second);
			b[i].first--;
		}
	}

	ll sum = 0;
	while (!a.empty()) {
		sum += a.top();
		a.pop();
	}

	cout << sum << endl;
	return 0;
}

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

#include <iostream>
#include <queue>

using namespace std;

int main()
{
    int n, m;
    int b, c;
    vector<pair<int, int> > v;

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

    for (int i = 0;i < m;i++)
    {
        cin >> b >> c;
        v.push_back(make_pair(c, b));
    }

    sort(v.begin(), v.end());
    reverse(v.begin(), v.end());

    vector<int> aa;
    for (int i = 0;i < m;i++)
    {
        if (aa.size() + v[i].second >= n)
        {
            while(aa.size() < n)
            {
                aa.push_back(v[i].first);
            }
        }else
        {
            for (int j = 0;j < v[i].second;j++)
            {
                aa.push_back(v[i].first);
            }
        }
    }

    for (int i = 0;i < aa.size();i++)
    {
        a.push_back(aa[i]);
    }

    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());

    long long ans=0ll;
    for (int i = 0;i < n;i++)
    {
        ans += a[i];
    }
    cout << ans << endl;
}

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

#if 0

#endif

#include <bits/stdc++.h>
#define REP(i, n) for(int i=0;i<int(n);++i)
using namespace std;
template<class A>void p(A a){cout << (a) << endl;}
template<class A,class B>void p(A a,B b){cout << a << " "  ;p(b);}
template<class A,class B,class C>void p(A a,B b,C c){cout << a << " " ;p(b,c);}
template<class A,class B,class C,class D>void p(A a,B b,C c,D d){cout << a << " " ;p(b,c,d);}
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
int INF=numeric_limits<int>::max();
// for copy
// for(int i=0;i<N;++i) {

int main(void) {
  int N,M;cin>>N>>M;
  set<ll> A;
  REP(i,N) {
    ll c;
    cin>>c;
    A.insert(c);
  }
  REP(i,M) {
    int B,C;cin>>B>>C;
    REP(j,B) {
      ll beg = A.begin();
      if(beg<C) {
          A.erase(beg);
          A.insert(C);
      }
    }
  }
  ll s = 0;
  for(auto x : A) {
      s += x;
  }
  p(s);
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:30:23: error: cannot convert 'std::set<long long int>::iterator' {aka 'std::_Rb_tree<long long int, long long int, std::_Identity<long long int>, std::less<long long int>, std::allocator<long long int> >::const_iterator'} to 'll' {aka 'long long int'} in initialization
   30 |       ll beg = A.begin();
      |                ~~~~~~~^~
      |                       |
      |                       std::set<long long int>::iterator {aka std::_Rb_tree<long long int, long long int, std::_Identity<long long int>, std::less<long long int>, std::allocator<long long int> >::const_iterator}
Language: C++

#if 0

#endif

#include <bits/stdc++.h>
#define REP(i, n) for(int i=0;i<int(n);++i)
using namespace std;
template<class A>void p(A a){cout << (a) << endl;}
template<class A,class B>void p(A a,B b){cout << a << " "  ;p(b);}
template<class A,class B,class C>void p(A a,B b,C c){cout << a << " " ;p(b,c);}
template<class A,class B,class C,class D>void p(A a,B b,C c,D d){cout << a << " " ;p(b,c,d);}
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
int INF=numeric_limits<int>::max();
// for copy
// for(int i=0;i<N;++i) {

int main(void) {
  int N,M;cin>>N>>M;
  ll A[N];
  REP(i,N) {
    cin>>A[i];
  }
  sort(A,A+N);
  REP(i,M) {
    int B,C;cin>>B>>C;
    REP(j,B) {
      if(A[j]<C)
        A[j] = C;
    }
  }
  ll r = accumulate(A,A+N);
  p(r);
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:33:20: error: no matching function for call to 'accumulate(ll [N], ll*)'
   33 |   ll r = accumulate(A,A+N);
      |          ~~~~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/numeric:62,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_numeric.h:134:5: note: candidate: 'template<class _InputIterator, class _Tp> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp)'
  134 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:134:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_numeric.h:161:5: note: candidate: 'template<class _InputIterator, class _Tp, class _BinaryOperation> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation)'
  161 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:161:5: note:   candidate expects 4 arguments, 2 provided
Language: C++

#include <iostream>
#include <vector>

using namespace std;

long long int n;
long long int m;
long long int tmp1;
long long int tmp2;
long long int ans;
vector<long long int> cards;
vector<pair<long long int,long long int> > change_order;

int main(void){
    cin >> n;
    cin >> m;
    for(long long int i=0; i<n; i++){
        cin >> tmp1;
        cards.push_back(tmp1);
    }

    for(long long int i=0; i<m; i++){
        cin >> tmp1;
        cin >> tmp2;
        change_order.push_back( make_pair(tmp1, tmp2) );
    }

    //ソートする
    sort(cards.begin(), cards.end());
    for(int i=0; i<change_order.size(); i++){
        for(int j=0; j<change_order[i].first; j++ ){
            if(cards[j] < change_order[i].second ){
                cards[j]= change_order[i].second;
            }else{
                break;
            }
        }
        sort(cards.begin(), cards.end());
    }

    for(long long int i=0; i<n; i++){
        ans += cards[i];
    }
    cout << ans << endl;

    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main() {
	priority_queue<long long,vector<long long>,greater<long long>> A;
	int N, M,p,B,C;
	cin >> N >> M;
	long long ans=0;
	for (size_t i = 0; i < N; i++)
	{
		cin >> p;
		A.push(p);
	}
	for (size_t i = 0; i < M; i++)
	{
		cin >> B >> C;
		for (size_t i = 0; i < B; i++)
		{
			if (A.top() < C)
			{
				A.pop();
				A.push(C);
			}
			else break;
		}
	}
	while (!A.empty()) {
		ans += (long long(A.top()));
		A.pop();
	}
	cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:25: error: expected primary-expression before 'long'
   27 |                 ans += (long long(A.top()));
      |                         ^~~~
a.cc:27:25: error: expected ')' before 'long'
   27 |                 ans += (long long(A.top()));
      |                        ~^~~~
      |                         )
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
	priority_queue<int,vector<int>,greater<int>> A;
	int N, M,p,B,C;
	cin >> N >> M;
	long long ans=0;
	for (size_t i = 0; i < N; i++)
	{
		cin >> p;
		A.push(p);
	}
	for (size_t i = 0; i < M; i++)
	{
		cin >> B >> C;
		for (size_t i = 0; i < B; i++)
		{
			if (A.top() < C)
			{
				A.pop();
				A.push(C);
			}
			else break;
		}
	}
	while (!A.empty()) {
		ans += long long(A.top());
		A.pop();
	}
	cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:24: error: expected primary-expression before 'long'
   27 |                 ans += long long(A.top());
      |                        ^~~~
Language: C++

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

int k, s;
int res = 0;

int main(){
  cin >> k >> s;
  rep(i, k + 1){
    rep(j, k + 1){
      int x = i, y = j;
      if(x + y <= s && x + y >= s - k){
        //int z = s - x - y;
        
        cerr << x <<" "<<y <<" "<<z <<endl;
        res++;
      }
    }
  }
  cout << res << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:35: error: 'z' was not declared in this scope
   16 |         cerr << x <<" "<<y <<" "<<z <<endl;
      |                                   ^
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>;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
int nx[4]={0,1,-1,0};
int ny[4]={1,0,0,-1};
int main(){
  ll n,m;
  cin>>n>>m;
  vll a(n);
  rep(i,n) cin>>a[i];
  vector<pll> p(m)
  rep(i,m){
    ll b,c;
    cin>>b>>c;
    p[i]=mp(c,b);
  }
  sort(rall(p));
  sort(all(a));
  ll ans=0;
  rep(i,n){
    ans+=a[i];
  }
  ll j=0;
  rep(i,n){
    if(p[j].S==0) j++;
    if(a[i]<p[j].F){
      ans-=a[i];
      ans+=p[j].F;
      p[j].S--;
    }
    else{
      break;
    }
  }
  COUT(ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: expected ',' or ';' before 'for'
    7 | #define rep(i, n) for (ll i = 0; i < (n); i++)
      |                   ^~~
a.cc:46:3: note: in expansion of macro 'rep'
   46 |   rep(i,m){
      |   ^~~
a.cc:46:7: error: 'i' was not declared in this scope
   46 |   rep(i,m){
      |       ^
a.cc:7:34: note: in definition of macro 'rep'
    7 | #define rep(i, n) for (ll i = 0; i < (n); i++)
      |                                  ^
Language: C++

#include <iostream>
#include <queue>
#include <vector>
#include <functional>
using namespace std;
bool cmp(pair <int,int> a,pair <int,int> b){
    return a.second>b.second;
}
int main(){
    int n,m;
    cin>>n>>m;
    int a[n];
    pair <int,int> p[m];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    sort(a,a+n);
    for(int i=0;i<m;i++){
        cin>>p[i].first>>p[i].second;
    }
    sort(p,p+m,cmp);
    int curr=0,f=0;
    long long int ans=0;
    for(int i=0;i<m;i++){
        int cnt=1;
        while(curr<n&&cnt++<=p[i].first){
            if(a[curr]>p[i].second){
                f=1;
                break;
            }
            else{
                a[curr]=p[i].second;
            }
            curr++;
        }
        if(f) break;
    }
    for(int i=0;i<n;i++) ans+=a[i];
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |     sort(a,a+n);
      |     ^~~~
      |     short
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;
  vll a(n);
  rep(i,n) cin>>a[i];
  vector<pll> p;
  rep(i,m){
    ll b,c;
    cin>>b>>c;
    p[i]=mp(c,b);
  }
  sort(rall(p));
  sort(all(a));
  ll j=0;
  rep(i,m){
    ll c=p[i].F;
    ll b=p[i].S;
    while(b){
      if(j>=n) break;
      if(a[j]<c){
        a[j]=c;
        j++;
        b--;
      }
      else break;
    }
    if(j>=n) break;
  }
  rep(i,n){
    ll ans=0;
    ans+=a[i];
  }
  COUT(ans);
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:68:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   68 |   COUT(ans);
      |        ^~~
a.cc:17:24: note: in definition of macro 'COUT'
   17 | #define COUT(x) cout<<(x)<<endl
      |                        ^
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;
  vll a(n);
  rep(i,n) cin>>a[i];
  vector<pll> p;
  rep(i,m){
    ll b,c;
    cin>>b>>c;
    p[i]=mp(c,b);
  }
  sort(rall(p));
  sort(all(a));
  ll j=0;
  rep(i,m){
    ll c=p[i].F;
    ll b=p[i].S;
    while(b){
      if(j>=n) break;
      if(a[j]<c){
        a[j]=c;
        j++;
        b--;
      }
      else break;
    }
    if(j>=n) break;
  }
  rep(i,n){
    ll ans+=a[i];
  }
  COUT(ans);
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:65:11: error: expected initializer before '+=' token
   65 |     ll ans+=a[i];
      |           ^~
a.cc:67:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   67 |   COUT(ans);
      |        ^~~
a.cc:17:24: note: in definition of macro 'COUT'
   17 | #define COUT(x) cout<<(x)<<endl
      |                        ^
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;
  vll a(n);
  rep(i,n) cin>>a[i];
  vector<pll> p
  rep(i,m){
    ll b,c;
    cin>>b>>c;
    p[i]=mp(c,b);
  }
  sort(rall(p));
  sort(all(a));
  ll j=0;
  rep(i,m){
    ll c=p[i].F;
    ll b=p[i].S;
    while(b){
      if(j>=n) break;
      if(a[j]<c){
        a[j]=c;
        j++;
        b--;
      }
      else break;
    }
    if(j>=n) break;
  }
  rep(i,n){
    ans+=a[i];
  }
  COUT(ans);
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: expected initializer before 'for'
    7 | #define rep(i, n) for (ll i = 0; i < (n); i++)
      |                   ^~~
a.cc:42:3: note: in expansion of macro 'rep'
   42 |   rep(i,m){
      |   ^~~
a.cc:42:7: error: 'i' was not declared in this scope
   42 |   rep(i,m){
      |       ^
a.cc:7:34: note: in definition of macro 'rep'
    7 | #define rep(i, n) for (ll i = 0; i < (n); i++)
      |                                  ^
a.cc:47:13: error: 'p' was not declared in this scope
   47 |   sort(rall(p));
      |             ^
a.cc:12:17: note: in definition of macro 'rall'
   12 | #define rall(v)(v).rbegin(),(v).rend()
      |                 ^
a.cc:65:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   65 |     ans+=a[i];
      |     ^~~
      |     abs
a.cc:67:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   67 |   COUT(ans);
      |        ^~~
a.cc:17:24: note: in definition of macro 'COUT'
   17 | #define COUT(x) cout<<(x)<<endl
      |                        ^
Language: Java

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

/**
 * Integer Cards
 */
public class D {

    public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
            int N = sc.nextInt();
            int M = sc.nextInt();

            long[] A = new long[N];
            for (int i = 0; i < N; i++) {
                A[i] = sc.nextLong();
            }

            List<BC> list = new ArrayList<>();
            for (int i = 0; i < M; i++) {
                BC bc = new BC();
                bc.B = sc.nextInt();
                bc.C = sc.nextLong();
                list.add(bc);
            }

            Arrays.sort(A);
            Collections.sort(list, (o1, o2) -> Long.compare(o2.C, o1.C));

            long sum = 0;
            long count = 0;

            for (int i = N - 1; i >= 0; i--) {
                long a = A[i];

                while (list.size() > 0 && list.get(0).C >= a) {
                    BC bc = list.get(0);

                    if (count + bc.B >= N) {
                        sum += bc.C * (N - count);
                        count = N;
                        break;
                    }

                    sum += bc.C * bc.B;
                    count += bc.B;
                    list.remove(0);
                }

                if (count == N) {
                    break;
                }

                sum += a;
                count++;

                if (count == N) {
                    break;
                }
            }

            System.out.println(sum);
        }
    }

    static class BC {

        int B;

        long C;

    }

}


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

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

	priority_queue<int,vector<int>> pq;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		pq.push(a);
	}

	for (int i = 0; i < m; i++) {
		int b, c;
		cin >> b >> c;
		for (int j = 0; j < b; j++) {
			pq.push(c);
			
		}
	}
	
	long long sum = 0;
	for(int i = 0; i < n; i++){
		sum += pq.top();
		pq.pop();
	}

	cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> n >> m;
      |         ^~~
a.cc:5:9: error: 'priority_queue' was not declared in this scope
    5 |         priority_queue<int,vector<int>> pq;
      |         ^~~~~~~~~~~~~~
a.cc:5:24: error: expected primary-expression before 'int'
    5 |         priority_queue<int,vector<int>> pq;
      |                        ^~~
a.cc:9:17: error: 'pq' was not declared in this scope
    9 |                 pq.push(a);
      |                 ^~
a.cc:16:25: error: 'pq' was not declared in this scope
   16 |                         pq.push(c);
      |                         ^~
a.cc:23:24: error: 'pq' was not declared in this scope
   23 |                 sum += pq.top();
      |                        ^~
a.cc:27:9: error: 'cout' was not declared in this scope
   27 |         cout << sum << endl;
      |         ^~~~
a.cc:27:24: error: 'endl' was not declared in this scope
   27 |         cout << sum << endl;
      |                        ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define int ll
#define all(in) in.begin(), in.end()
using pii = pair<int,int>;
/*Happy New Year :)*/
signed main(){
    int n,m; cin >> n >> m;
    vector<int>a(n);
    vector<pii>b(m);
    for(auto& e : a ) cin >> e;
    for(auto& p : b) cin >> p.second >> p.first;
    sort(all(b),greater<pii>());
    priority_queue<int,vector<int>,greater<>>pq;
    for(auto e : a) pq.emplace(e);
    for(auto p : b){
        rep(_,p.second){
            if(pq.top() < p.first){
                pq.pop();
                pq.push(p.first);
            } else {
                break;
            }
            if(pq.top() >= p.first) break;
        }
    }
    int sum = 0;
    while(not pq.empty()) {
        sum += pq.top(); pq.pop();
    }
    cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: '_' was not declared in this scope
   18 |         rep(_,p.second){
      |             ^
a.cc:18:9: error: 'rep' was not declared in this scope
   18 |         rep(_,p.second){
      |         ^~~
Language: C++

/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0
#define debug(aa, a) fprintf(stderr, aa, a)

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/

int a[1000000000000000];

int main() {

	int n, m;
	scanf("%d%d", &n, &m);
	int addition = 0;
	rep(i, n)scanf("%d", &a[i]);
	int b, c;
	rep(i, m) {
		scanf("%d%d", &b, &c);
		rep(j, b) a[n + j + addition];
		addition += b;
	}
	sort(all(a), greater<int>());
	unsigned long long ans = 0;
	rep(i, n)ans += a[i];
	printf("%llu\n", ans);

	Please AC;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:20: error: request for member 'begin' in 'a', which is of non-class type 'int [1000000000000000]'
   41 | #define all(x) (x).begin(), (x).end()
      |                    ^~~~~
a.cc:103:14: note: in expansion of macro 'all'
  103 |         sort(all(a), greater<int>());
      |              ^~~
a.cc:41:33: error: request for member 'end' in 'a', which is of non-class type 'int [1000000000000000]'
   41 | #define all(x) (x).begin(), (x).end()
      |                                 ^~~
a.cc:103:14: note: in expansion of macro 'all'
  103 |         sort(all(a), greater<int>());
      |              ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repp(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define repm(i,n) for(int (i)=(n-1);(i)>=0;(i)--)
#define INF (1ll<<60)
typedef long long lint;
const lint MOD =1000000007;
const lint MAX = 10000000;

 
lint fac[MAX], finv[MAX], inv[MAX];

void COMinit() // 二項係数を求める時は前処理としてCOMinit()をする
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (lint i = 2; i < MAX; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
// 二項係数計算
long long COM(lint n, lint k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

lint primary(lint num)
{
    if (num < 2) return 0;
    else if (num == 2) return 1;
    else if (num % 2 == 0) return 0; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return 0;
        }
    }

    // 素数である
    return 1;
}

   


  int main(){
  lint N,M,ans=0;
  cin >>N>>M;
  priority_queue<int,vector<int>,greater<int>> A;
  pair<lint,lint> x[M];
  rep(i,N){
    int a;
    cin>>a;
    A.push(a);
  }
  rep(i,M){
    int a,b;
    cin>>a>>b;
    x[i]=make_pair(b,a);
  }
  sort(x,x+M);
  rep(i,M){
      lint l,m;
      tie(m,l)=x[i];
        rep(j,l){
      if(A.top()<b){
        A.pop();
        A.push(b);
      }else break;
    }
  }
  rep(i,N){
    ans+=A.top();
    A.pop();
  }
  cout <<ans;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:80:18: error: 'b' was not declared in this scope
   80 |       if(A.top()<b){
      |                  ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;


int main(){

  long long int s , t ,a[100010] ,b[100010], c[100010];
  
  cin >> s >> t ;
  
  for(int i=0;i<s;i++)
    cin >> a[i];
  
  
  for(int i=0;i<t;i++){
    
    cin >> c[i] >> d[i];
    
  }
  
  vector<pair<long long , long long >> p;
  
  for(int i=0;i<s;i++){
    p.push.back({a[i],1});
  }
  
  for(int i=0;i<t;i++){
  p.push.back({c[i],b[i]});
  }
  
  
  sort(p.begin(),b.begin()+s+t,greater<long long int>());
  
  int ans = s, res = 0;
  for(int i=0;i<s+t;i++){
    
    if(ans > 0){
      res += p[i].first*p[i].second;
      
      ans -= p[i].second;
      
    }
    else{
      
      break;
      
    }
    
  }
  
  cout << res << endl;
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:18:20: error: 'd' was not declared in this scope
   18 |     cin >> c[i] >> d[i];
      |                    ^
a.cc:25:7: error: 'class std::vector<std::pair<long long int, long long int> >' has no member named 'push'
   25 |     p.push.back({a[i],1});
      |       ^~~~
a.cc:29:5: error: 'class std::vector<std::pair<long long int, long long int> >' has no member named 'push'
   29 |   p.push.back({c[i],b[i]});
      |     ^~~~
a.cc:33:20: error: request for member 'begin' in 'b', which is of non-class type 'long long int [100010]'
   33 |   sort(p.begin(),b.begin()+s+t,greater<long long int>());
      |                    ^~~~~
a.cc:33:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   33 |   sort(p.begin(),b.begin()+s+t,greater<long long int>());
      |   ^~~~
      |   short
Language: C++

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

typedef long long  ll;

ll MOD = 1000000007;
ll INF = 100000000000000;
double PI = 3.1415926535;

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

using Graph = vector<vector<ll>>;

int main(){
    ll N,M;cin >> N >> M;
    vector<ll> A(N);
    vector<pair<ll,ll>> Q(M);
    ll card = 0;
    for(int i = 0;i < N;i++)cin >> A[i];
    for(int i = 0;i < M;i++){
      cin >> Q[i].second >> Q[i].first;
      card += Q[i].first;
    }
    sort(A.begin(),A.end());
    sort(Q.begin(),Q.end());
    reverse(Q.begin(),Q.end());
    ll n = Q[0].second,m = 0;
    for(int i = 0;i < min(N,card);i++){
      if(n == 0){
        m++;
        n = Q[m].second;
      }
      ll a = Q[m].first;
      //cout << A[i] << ' ' << Q[m].first << endl;
      if(A[i] < Q[m].first){
        swap(A[i],a);
        n--;
      }else{
        break;
      }
    }
    ll ans = 0;
    for(int i = 0;i < N;i++){
      ans += A[i];
    }
    cout 

Compiler output:
a.cc: In function 'int main()':
a.cc:50:9: error: expected ';' at end of input
   50 |     cout
      |         ^
      |         ;
a.cc:50:9: error: expected '}' at end of input
a.cc:18:11: note: to match this '{'
   18 | int main(){
      |           ^