criyle/codenet-compile-errors huggingface dataset:
Language: Java

public class Main {

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();

		int[] a = new int[n];
		for( int i=0 ; i<n ; i++ ) {
			a[i] = sc.nextInt();
		}

		Pair[] p = new Pair[m];
		for( int i=0 ; i<m ; i++ ) {
			p[i] = new Pair(sc.nextInt(),sc.nextInt());
		}

		Arrays.sort(a);
		Arrays.sort(p);

		int s=0;
		for( int i=0 ; i< m ; i++) {
			int b = p[i].r;
			int c = p[i].l;
			
			for( int j=0 ; j<b && s<n ; j++ ) {
				if( a[s] < c) {
					a[s] = c;
					s++;
				}
			}
		}
		
		long ans = 0;
		for( int i=0 ; i< n ; i++) {
			ans += a[i];
		}
		System.out.println(ans);
		
	}

	public static class Pair implements Comparable<Pair>{
		int r = 0;
		int l = 0;
		
		public Pair(int weight, int limit) {
			super();
			this.r = weight;
			this.l = limit;
		}

		@Override
		public int compareTo(Pair o) {
			if(false)
				// ASC
				return (l - o.l);
			else
				// DESC
				return -(l - o.l);
		}
	
	}
}


Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
Main.java:18: error: cannot find symbol
		Arrays.sort(a);
		^
  symbol:   variable Arrays
  location: class Main
Main.java:19: error: cannot find symbol
		Arrays.sort(p);
		^
  symbol:   variable Arrays
  location: class Main
4 errors
Language: C++

#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define ll long long
using namespace std;
const int MOD = 1000000007;
const long long INF = 1LL << 60;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n, m;
  cin >> n >> m;
  vector<ll> a(n);
  vector<ll> b(n);
  vector<ll> c(n);
  priority_queue<ll, vector<int>, greater<int> > q;
  for (ll i = 0; i < n; i++) {
    cin >> a[i];
    q.push(a[i]);
  }
  for (ll i = 0; i < m; i++) {
    cin >> b[i] >> c[i];
    ll cnt = 0;
    for (ll j = 0; cnt < b[i] && j < n; j++) {
      if (q.top() < c[i]) {
        q.pop();
        q.push(c[i]);
        cnt++;
      }
    }
  }
  // ll sum = 0;
  // for (ll i = 0; i < a.size(); i++) {
  //   sum += a[i];
  // }
  // cout << sum << endl;
  ll sum = 0;
  while (!q.empty()) {
    // cout << q.top() << endl;
    sum += q.top();
    q.pop();
  }
  cout << sum << endl;
}

Compiler output:
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:8:
/usr/include/c++/14/bits/stl_queue.h: In instantiation of 'class std::priority_queue<long long int, std::vector<int>, std::greater<int> >':
a.cc:26:50:   required from here
   26 |   priority_queue<ll, vector<int>, greater<int> > q;
      |                                                  ^
/usr/include/c++/14/bits/stl_queue.h:520:67: error: static assertion failed: value_type must be the same as the underlying container
  520 |       static_assert(is_same<_Tp, typename _Sequence::value_type>::value,
      |                                                                   ^~~~~
/usr/include/c++/14/bits/stl_queue.h:520:67: note: 'std::integral_constant<bool, false>::value' evaluates to false
Language: C++

#include <iostream>
#include <stdio.h>
#include <vector> 
#include <math.h> 
#include <map> 
using namespace std;
int main(void){
    long long n, m; cin >> n >> m;
    map<long long, long long> map;
    vector<long long> v(n);
    long long min = 1000000000;
    long long max = 0;
    long long i = 0;
    long long ans = 0;
    while(i < n)  {
        long long tmp;
        cin >> tmp;
        map[tmp]++;
        v[i] = tmp;
        ans += tmp;
        if (tmp > max) max = tmp;
        if (tmp < min) min = tmp;
        i++;
    }
    i = 0;
    sort(v.begin(), v.end());
    while(i < m)  {
        long long b,c;
        cin >> b >> c;
        // if (c < min) {
        //     i++;
        //     continue;
        // }
        long long j = 0;
        while (j < b) {
            if (v[j] < c) {
                ans = ans + c - v[j];
                v[j] = c;
            } else {
                j++;
                continue;
            }
            j++;
        }
        sort(v.begin(), v.end());
        i++;
    }
    cout << ans << endl;
}


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

#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<n;i++)
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0;}

vector<vector<pair<int,int>>>g;
vector<int>res;
void dfs(int v,int p,int c) {
    res[v] = c;
    for(auto e : g[v]) {
        if(e.first == p) continue;
        if(e.second % 2==0) dfs(e.first,v,c%2);
        else dfs(e.first,v,(c+1)%2);
    }
}
int main() {
    int n;
    cin >> n;
    g.resize(n);
    rep(i,n-1) {
        int v,u,w;
        cin >> v >> u >> w;
        v--;u--;
        g[v].push_back({u,w});
        g[u].push_back({v,w});+
    }
    res.resize(n);
    dfs(0,-1,0);
    rep(i,n) {
        cout << res[i] << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:5: error: expected primary-expression before '}' token
   29 |     }
      |     ^
Language: C++

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

int main(){
  int N,M;
  cin>>N>>M;
  int A[N];
  for(int i=0;i<N;i++)cin>>A[i];
  sort(A,A+N);
  
  for(int i=0;i<M;i++){
    int B,C;
    cin>>B>>C;
    for(int j=0;j<B;j++){
      if(A[j]<C)A[j]=C;
    }
    sort(A,A+N);
  }
  int sum=0;
  for(int i=0;i<N;i++){
    sum+=A[i];
  }
  cout<<sum<<endl;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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

int main(){
  int N,M;
  cin>>N>>M;
  int A[N];
  for(int i=0;i<N;i++)cin>>A[i];
  sort(A,A+N);
  
  for(int i=0;i<M;i++){
    int B,C;
    cin>>B>>C;
    for(int j=0;j<B;j++){
      if(A[j]<C)A[j]=C;
    }
    sort(A,A+N)
  }
  int sum=0;
  for(int i=0;i<N;i++){
    sum+=A[i];
  }
  cout<<sum<<endl;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:18:16: error: expected ';' before '}' token
   18 |     sort(A,A+N)
      |                ^
      |                ;
   19 |   }
      |   ~
Language: C++

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

int main(){
  int n, m;
  cin >> n >> m;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < m; i++) {
    long long b, c;
    cin >> b >> c;
    for (long long j = 0; j < b; j++) {
      
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:12:31: note: to match this '{'
   12 |   for (int i = 0; i < m; i++) {
      |                               ^
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

=#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = INT32_MAX;
const ll INFL = INT64_MAX;
const int mod = 1e9 + 7;

template <typename T>
void print_vec(vector<T> v) {
  for (T i : v) cout << i << " ";
  cout << endl;
}

int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  rep(i, m) {
    int b, c;
    cin >> b >> c;
    rep(j, b) a.push_back(c);
  }
  sort(a.rbegin(), a.rend());
  ll ans = 0;
  rep(i, n) ans += a[i];
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | =#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: expected unqualified-id before '=' token
    1 | =#include <bits/stdc++.h>
      | ^
a.cc:5:11: error: 'pair' does not name a type
    5 | using P = pair<int, int>;
      |           ^~~~
a.cc:6:17: error: 'INT32_MAX' was not declared in this scope
    6 | const int INF = INT32_MAX;
      |                 ^~~~~~~~~
a.cc:1:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
  +++ |+#include <cstdint>
    1 | =#include <bits/stdc++.h>
a.cc:7:17: error: 'INT64_MAX' was not declared in this scope
    7 | const ll INFL = INT64_MAX;
      |                 ^~~~~~~~~
a.cc:7:17: note: 'INT64_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc:11:6: error: variable or field 'print_vec' declared void
   11 | void print_vec(vector<T> v) {
      |      ^~~~~~~~~
a.cc:11:16: error: 'vector' was not declared in this scope
   11 | void print_vec(vector<T> v) {
      |                ^~~~~~
a.cc:11:24: error: expected primary-expression before '>' token
   11 | void print_vec(vector<T> v) {
      |                        ^
a.cc:11:26: error: 'v' was not declared in this scope
   11 | void print_vec(vector<T> v) {
      |                          ^
a.cc: In function 'int main()':
a.cc:18:3: error: 'cin' was not declared in this scope
   18 |   cin >> n >> m;
      |   ^~~
a.cc:19:3: error: 'vector' was not declared in this scope
   19 |   vector<int> a(n);
      |   ^~~~~~
a.cc:19:10: error: expected primary-expression before 'int'
   19 |   vector<int> a(n);
      |          ^~~
a.cc:20:20: error: 'a' was not declared in this scope
   20 |   rep(i, n) cin >> a[i];
      |                    ^
a.cc:24:15: error: 'a' was not declared in this scope
   24 |     rep(j, b) a.push_back(c);
      |               ^
a.cc:26:8: error: 'a' was not declared in this scope
   26 |   sort(a.rbegin(), a.rend());
      |        ^
a.cc:26:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   26 |   sort(a.rbegin(), a.rend());
      |   ^~~~
      |   short
a.cc:29:3: error: 'cout' was not declared in this scope
   29 |   cout << ans << endl;
      |   ^~~~
a.cc:29:18: error: 'endl' was not declared in this scope
   29 |   cout << ans << endl;
      |                  ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {

	int n, m;
	cin >> n >> m;

	map<long long, long long> count;
		
	int tmp;
	for (int i = 0; i < n; i++) {
		cin >> tmp;
		count[tmp]++;
	}

	long long in1, in2;
	for (int i = 0; i < m; i++) {
		cin >> in1 >> in2;
		auto itr = count.begin();
		while (itr->first < in2) {
			bool brkflg = false;
			while (itr->second > 0) {
				in1--;
				itr->second--;
				count[in2]++;
				if (in1 == 0) {
					brkflg = true;
					break;
				}
				if (itr->second == 0) {
					break;
				}

			}
			if (brkflg) { break; }
			itr=next(itr, 1);
		}
		itr = count.begin();
		while(itr->second==0){
			count.erase(itr->first);
			itr = count.begin();
		}

	}

	long long res=0;
	for (auto itr = count.begin(); itr != count.end(); itr++) {
		res += itr->first*itr->second;
	}
	cout << res << endl;
	return 0;



Compiler output:
a.cc: In function 'int main()':
a.cc:53:18: error: expected '}' at end of input
   53 |         return 0;
      |                  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,N) for(int i=0; i<N; i++){    ;
int main() {
ll N;
ll M;
cin>>N>>M;
vector<long long>A(N);
vector<long long>array(M);
vector<ll>C(M);
rep(i,N)
cin>>A.at(i);
}
rep(i,M)
cin>>array.at(i);
cin>>C.at(i);
}
vector<int>B(M);
vector<size_t> indices(array.size());
iota(indices.begin(), indices.end(), 0);
sort(indices.begin(), indices.end(), [&array](size_t i1, size_t i2) {
        return array[i1] < array[i2];
});
int y=0;
for (auto v : indices)
   B.at(y)=v;  
   y++;
}
sort(A.begin(),A.end());
long long answer=0;
for(ll i=0; i<M; i++){
    ll a=array.at(i);
    for(ll j=0; j<a; j++){
        if(A.at(j)<C.at(i)){
            A.at(j)=C.at(i);

        }
        else
        j+=1000000000;
    }
    sort(A.begin(),A.end());
}
long long count=0; 
rep(i,N)
count+=A.at(i);
}
cout<<count<<endl;
}


Compiler output:
a.cc:30:5: error: expected constructor, destructor, or type conversion before '(' token
   30 | sort(A.begin(),A.end());
      |     ^
a.cc:32:1: error: expected unqualified-id before 'for'
   32 | for(ll i=0; i<M; i++){
      | ^~~
a.cc:32:13: error: 'i' does not name a type
   32 | for(ll i=0; i<M; i++){
      |             ^
a.cc:32:18: error: 'i' does not name a type
   32 | for(ll i=0; i<M; i++){
      |                  ^
a.cc:4:18: error: expected unqualified-id before 'for'
    4 | #define rep(i,N) for(int i=0; i<N; i++){    ;
      |                  ^~~
a.cc:45:1: note: in expansion of macro 'rep'
   45 | rep(i,N)
      | ^~~
a.cc:45:5: error: 'i' does not name a type
   45 | rep(i,N)
      |     ^
a.cc:4:31: note: in definition of macro 'rep'
    4 | #define rep(i,N) for(int i=0; i<N; i++){    ;
      |                               ^
a.cc:45:5: error: 'i' does not name a type
   45 | rep(i,N)
      |     ^
a.cc:4:36: note: in definition of macro 'rep'
    4 | #define rep(i,N) for(int i=0; i<N; i++){    ;
      |                                    ^
a.cc:48:1: error: 'cout' does not name a type
   48 | cout<<count<<endl;
      | ^~~~
a.cc:49:1: error: expected declaration before '}' token
   49 | }
      | ^
Language: C++

#include <arrayits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,N) for(int i=0; i<N; i++){    ;
int main() {
ll N;
ll M;
cin>>N>>M;
vector<long long>A(N);
vector<long long>array(M);
vector<ll>C(M);
rep(i,N)
cin>>A.at(i);
}
rep(i,M)
cin>>array.at(i);
cin>>C.at(i);
}
vector<int>B(M);
vector<size_t> indices(array.size());
iota(indices.begin(), indices.end(), 0);
sort(indices.begin(), indices.end(), [&array](size_t i1, size_t i2) {
        return array[i1] < array[i2];
});
int y=0;
for (auto v : indices)
   B.at(y)=v;  
   y++;
}
sort(A.begin(),A.end());
long long answer=0;
for(ll i=0; i<M; i++){
    ll a=array.at(i);
    for(ll j=0; j<a; j++){
        if(A.at(j)<C.at(i)){
            A.at(j)=C.at(i);

        }
        else
        j+=1000000000;
    }
    sort(A.begin(),A.end());
}
long long count=0; 
rep(i,N)
count+=A.at(i);
}
cout<<count<<endl;
}


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

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,N) for(int i=0; i<N; i++){    ;
int main() {
ll N,M;
cin>>N>>M;
vector<ll>A(N);
vector<ll>B(M);
vector<ll>C(M);
rep(i,N)
cin>>A.at(N);
}
rep(i,M)
cin>>B.at(i);
cin>>C.at(i);
}
sort(A.begin(),A.end());
long long answer=0;
for(ll i=0; i<M; i++){
    ll a=B.at(i);
    for(ll j=0; j<a; j++){
        if(A.at(j)<C.at(i)){
            A.at(j)=C.at(i);

        }
        else
        j+=1000000000;
    }
    sort(A.begin(),A.end();)
}
int count=0; 
rep(i,N)
count+=A.at(i);
}
cout<<count<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:27: error: expected ')' before ';' token
   30 |     sort(A.begin(),A.end();)
      |         ~                 ^
      |                           )
a.cc:30:28: error: expected primary-expression before ')' token
   30 |     sort(A.begin(),A.end();)
      |                            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<ll, ll> P;
ll Mod = 1000000007;
int main() {
  ll N,M;
  cin >> N >> M;
  vector<ll> A(N);
  vector<P> Card(M);
  for (int i = 0; i < N; i++ ){
    cin >> A[i];
  }
  for (int i = 0; i < M; i++) {
    cin >> Card[i].second >> Card[i].first;
  }
  sort(Card.begin(),Card.end());
  reverse(Card.begin(),Card.end());
  int cnt = 0;
  for (int i = 0; i < N; i++) {
    A.push_back(Card[cnt].first);
    Card[cnt].second--;
    if (Card[cnt].second == 0) {
      cnt+
    }
  }
  sort(A.begin(),A.end());
  reverse(A.begin(),A.end());
  ll ans = 0;
  for (int i = 0; i < N; i++) {
    ans += A[i];
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: expected primary-expression before '}' token
   25 |     }
      |     ^
Language: C++

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

int main(){
  long long N,M;
  cin>>N>>M;
  vector<long long>A(N,0);
  for(int i=0;i<N;i++){
    cin>>A[i];
  }
  sort(A.begin(),A.end());
  
  vector<pair<long long,long long>>vec;
  for(int i=0;i<M;i++){
    long long b,c;
    cin>>b>>c;
    vec.emplece_back(c,b);
  }
  
  sort(vec.begin(),vec.end());
  
  int temp1=0;
  int temp2=0;
  int temp3=0;
  while(1){
    if(A[temp1]<vec[M-1-temp2].first && vec[M-1-temp2].second-temp3>0){
      A[temp1]=vec[M-1-temp2].first;
      temp1++;
      temp3++;
      continue;
    }
    if(A[temp1]<vec[M-1-temp2].first && vec[M-1-temp2].second-temp3==0){
      temp2++;
      temp3=0;
      continue;
    }
    break;
  }

  long long sum=0;
  for(int i=0;i<N;i++){
    sum=sum+A[i];
  }
  cout<<setprecision(18)<<sum<<endl;
  return 0;
}

 

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'class std::vector<std::pair<long long int, long long int> >' has no member named 'emplece_back'; did you mean 'emplace_back'?
   17 |     vec.emplece_back(c,b);
      |         ^~~~~~~~~~~~
      |         emplace_back
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
#define cyes cout<<"YES"<<endl
#define cno cout<<"NO"<<endl
#define sp <<" "<<
#define CST(x) cout<<fixed<<setprecision(x)
#define PI 3.14159265359
#define MOD 1000000007
using namespace std;
using ll = long long;
using ld = long double;
using Graph = vector<vector<int>>;
using que_a = priority_queue<int, vector<int>, greater<int> >;
using que_d = priority_queue<int,int>;
///1<<3シフト演算子 とは　0001の1を三つずらして1000にする, これは8を表しておりつまりbitは0から7まで
//条件式 ? 真の場合の文 : 偽の場合の文
//string S  S,at(i),S += T,S += c,S.size(),S.substr(l)l文字目から最後まで,
///S.substr(l, r)l文字目からl+r-1文字目 n文字目から0個で空列を返せる
//*min_element(all(x)) *max_element(all(x))
//vi x; x.back(),x.front(),x.push_back(),x.pop_back()
//gcd(a, b)最大公約数
//sort(all(x)),reverse(all(x)),sort(x.begin()+l,a.begin()+r)lからrまで
//stack<int> a; a.push(x),a.pop(),a.top(),a.empty()bool
//queue<int> b; b.push(x),b.pop(),b.front(),b.empty()bool,b.size() 要素が小さい順
//priority_queue<int, vector<int>, greater<int>> c,c.top()
//map<int, int> M1; 変数[key] = value; 変数.erase(key); 変数.at(key); 変数.count(key)所属判定　変数.size()
//find(all(x), key)boolソート済みのベクトル
//*lower_bound(all(x),k)以上の最小の要素,*uppper_bound(all(x),k)より大きい最小の要素
//char('0'+cnt) 数字cntからcharへの変換
//int(char-'0') charからintへの変換
//binary_search(all(p),x) bool型




int main(){

    int n,m; cin >> n >> m;
    vector<pair<ll,ll>> v;
    rep(i,n){
        int a; cin >> a;
        v.push_back({a,1});
    }
    rep(i,m){
        int b,c; cin >> b >> c;
        v.push_back({c,b});
    }
    sort(all(v),greater<pair<ll,ll>>());
    ll num = 0;
    ll res = 0;
    for(auto p : v){
        if(num + p.second <= n){
            res += p.first * p.second;
            num += p.second;
        }
        else{
            res += p.first * (n - num);
            num = n;
            break;
        }

    }
    cout << res << endl;
    return 0;
}

Compiler output:
a.cc:15:37: error: 'int' is not a class, struct, or union type
   15 | using que_d = priority_queue<int,int>;
      |                                     ^
a.cc:15:37: error: template argument 3 is invalid
Language: C++

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

int main(){
  int n,m;
  cin >> n >> m;
  priority_queue<pair<int, int>> q;
  for (int i=0;i<n;++i){
    q.push(make_pair(a[i],1));
  }
  for (int i=0;i<m;++i){
    q.push(make_pair(c[i],b[i]));
  }
  
  long long ans=0;
  for (int i=0;i<n;++i){
    auto p=q.top(); q.pop();
    ans+=p.first;
    if (p.second>1){
      p.second--;
      q.push(p);//qに突っ込み直す
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: 'a' was not declared in this scope
    9 |     q.push(make_pair(a[i],1));
      |                      ^
a.cc:12:22: error: 'c' was not declared in this scope
   12 |     q.push(make_pair(c[i],b[i]));
      |                      ^
a.cc:12:27: error: 'b' was not declared in this scope
   12 |     q.push(make_pair(c[i],b[i]));
      |                           ^
Language: C++

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

int main(){
  int n,m;
  cin >> n >> m;
  priority_queue<pair<int, int>> q;
  for (int i=0;i<n;++i){
    q.push_back(make_pair(a[i],1));
  }
  for (int i=0;i<m;++i){
    q.push_back(make_pair(c[i],b[i]));
  }
  
  long long ans=0;
  for (int i=0;i<n;++i){
    auto p=q.top(); q.pop();
    ans+=p.first;
    if (p.second>1){
      p.second--;
      q.push(p);//qに突っ込み直す
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'class std::priority_queue<std::pair<int, int> >' has no member named 'push_back'
    9 |     q.push_back(make_pair(a[i],1));
      |       ^~~~~~~~~
a.cc:9:27: error: 'a' was not declared in this scope
    9 |     q.push_back(make_pair(a[i],1));
      |                           ^
a.cc:12:7: error: 'class std::priority_queue<std::pair<int, int> >' has no member named 'push_back'
   12 |     q.push_back(make_pair(c[i],b[i]));
      |       ^~~~~~~~~
a.cc:12:27: error: 'c' was not declared in this scope
   12 |     q.push_back(make_pair(c[i],b[i]));
      |                           ^
a.cc:12:32: error: 'b' was not declared in this scope
   12 |     q.push_back(make_pair(c[i],b[i]));
      |                                ^
Language: C++

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

int main(){
  int n,m;
  cin >> n >> m;
  priority_queue<pair<int, int>> q;
  for (int i=0;i<n;++i){
    q.push_back(make_pair(a[i],1));
  }
  for (int i=0;i<m;++i){
    q.push_back(make_pair(c[i],b[i]));
  }
  
  long long ans=0;
  for (int i=0;i<n;++i){
    auto p=q.top(); q.pop();
    ans+=p.first;
    if (p.second>1){
      p.second--;
      q.push(p);//qに突っ込み直す
    }
  }
  cout << ans << endl;
}

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

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

int main() {
    int n,m;cin>>n>>m;
    int a[n];
    for (int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    map<int,ll> mp;
    for (int i=0;i<m;i++) {
        int b,c;
        cin>>b>>c;
        mp[c]+=b
    }
    ll ans=0;
    for (int i=0;i<n;i++) {
        auto it=mp.rbegin();
        if (it->first>a[i]) {
            a[i]=it->first;
            it->second--;
            if (it->second==0)
                mp.erase(it->first);
        }
        ans+=a[i];
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: expected ';' before '}' token
   15 |         mp[c]+=b
      |                 ^
      |                 ;
   16 |     }
      |     ~
Language: Java

import java.util.*;
import java.util.Arrays;
import java.util.Comparator;
public class Main {    
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();        
		int m = sc.nextInt();
        int [] A = new int [n];
        for(int i=0;i<n;i++){A[i] = sc.nextInt();}
        Arrays.sort(s);               
        Data [] d = new Data [m];
        for(int i=0;i<m;i++){int B = sc.nextInt();
                             int C = sc.nextInt();
                             d[i] = new Data(B,C);                            
                            }
        Arrays.sort(d, new Comparator<Data>() {
            public int compare(Data d1, Data d2) {
                return d1.getB() - d2.getB();
            }
        }); 
        int point = m-1;
        int count = 0;
        for(int i=0;i<n;i++){if(point>=0 && d[point].getB()>A[i])
                            {A[i]=d[point].getB();
                             count++;                                                 
                             if(count==d[point].getA())
                            {point--;count=0;}
                            }else{break;}
                            }
        long ans = 0;
		for(int i=0;i<n;i++){ans+=A[i];}
        System.out.println(ans);
	}
}
class Data{
    private int a;
    private int b;
    public Data(int a, int b) {
        this.a = a;
        this.b = b;
    }
    public int getA() {
        return a;
    }
    public int getB() {
        return b;
    }
}

Compiler output:
Main.java:11: error: cannot find symbol
        Arrays.sort(s);               
                    ^
  symbol:   variable s
  location: class Main
1 error
Language: Java

import java.util.*;
import java.util.Arrays;
import java.util.Comparator;
public class Main {    
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();        
		int m = sc.nextInt();
        int [] A = new int [n];
        for(int i=0;i<n;i++){A[i] = sc.nextInt();}
        Arrays.sort(s);               
        Data [] d = new Data [m];
        for(int i=0;i<m;i++){int B = sc.nextInt();
                             int C = sc.nextInt();
                             d[i] = new Data(B,C);                            
                            }
        Arrays.sort(d, new Comparator<Data>() {
            public int compare(Data d1, Data d2) {
                return d1.getB() - d2.getB();
            }
        }); 
        int point = m-1;
        int count = 0;
        for(int i=0;i<n;i++){if(point>=0 && d[b].getB()>A[i]){A[i]=d[point].getB();
                                                              count++;                                                 
                                                              if(count==d[point].getA())
                                                             {point--;count=0;}
                                                             }else{break;}
                            }
        long ans = 0;
		for(int i=0;i<n;i++){ans+=s[i];}
        System.out.println(ans);
	}
}
class Data{
    private int a;
    private int b;
    public Data(int a, int b) {
        this.a = a;
        this.b = b;
    }
    public int getA() {
        return a;
    }
    public int getB() {
        return b;
    }
}


Compiler output:
Main.java:11: error: cannot find symbol
        Arrays.sort(s);               
                    ^
  symbol:   variable s
  location: class Main
Main.java:24: error: cannot find symbol
        for(int i=0;i<n;i++){if(point>=0 && d[b].getB()>A[i]){A[i]=d[point].getB();
                                              ^
  symbol:   variable b
  location: class Main
Main.java:31: error: cannot find symbol
		for(int i=0;i<n;i++){ans+=s[i];}
		                          ^
  symbol:   variable s
  location: class Main
3 errors
Language: Java

import java.util.*;
import java.util.Arrays;
import java.util.Comparator;
public class Main {    
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();        
		int m = sc.nextInt();
        int [] A = new int [n];
        for(int i=0;i<n;i++){A[i] = sc.nextInt();}
        Arrays.sort(s);               
        Data [] d = new Data [a];
        for(int i=0;i<m;i++){int B = sc.nextInt();
                             int C = sc.nextInt();
                             d[i] = new Data(B,C);                            
                            }
        Arrays.sort(d, new Comparator<Data>() {
            public int compare(Data d1, Data d2) {
                return d1.getB() - d2.getB();
            }
        }); 
        int point = m-1;
        int count = 0;
        for(int i=0;i<n;i++){if(point>=0 && d[b].getB()>A[i]){A[i]=d[point].getB();
                                                              count++;                                                 
                                                              if(count==d[point].getA())
                                                             {point--;count=0;}
                                                             }else{break;}
                            }
        long ans = 0;
		for(int i=0;i<n;i++){ans+=s[i];}
        System.out.println(ans);
	}
}
class Data{
    private int a;
    private int b;
    public Data(int a, int b) {
        this.a = a;
        this.b = b;
    }
    public int getA() {
        return a;
    }
    public int getB() {
        return b;
    }
}

Compiler output:
Main.java:11: error: cannot find symbol
        Arrays.sort(s);               
                    ^
  symbol:   variable s
  location: class Main
Main.java:12: error: cannot find symbol
        Data [] d = new Data [a];
                              ^
  symbol:   variable a
  location: class Main
Main.java:24: error: cannot find symbol
        for(int i=0;i<n;i++){if(point>=0 && d[b].getB()>A[i]){A[i]=d[point].getB();
                                              ^
  symbol:   variable b
  location: class Main
Main.java:31: error: cannot find symbol
		for(int i=0;i<n;i++){ans+=s[i];}
		                          ^
  symbol:   variable s
  location: class Main
4 errors
Language: Java

import java.util.*;
import java.util.Arrays;
import java.util.Comparator;
class Data{
    private int a;
    private int b;
    public Data(int a, int b) {
        this.a = a;
        this.b = b;
    }
    public int getA() {
        return a;
    }
    public int getB() {
        return b;
    }
}
public class Main {    
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int [] s = new int [n];
        for(int i=0;i<n;i++){s[i]=sc.nextInt();}
        Arrays.sort(s);
		int a = sc.nextInt();
		int [] in = new int [a];
        int [] in2 = new int [a];
        long ans = 0;
        for(int i=0;i<a;i++){
                             in[i] = sc.nextInt();
                             in2[i] = sc.nextInt();
                            }
        Data [] d = new Data [a];
         for(int i=0;i<a;i++){d[i] = new Data(in[i],in2[i]);                            
                             }
        Arrays.sort(d, new Comparator<Data>() {
            public int compare(Data d1, Data d2) {
                return d1.getB() - d2.getB();
            }
        }); 
        int b = 0;
        int c = a-1;
        while(b<n){if(c>=0 && d[c].getB()>in[b]){in[b]=d[c].getB();
                                                 d[c].getA()--;
                                                 b++;
                                                 if(d[c].getB()==0){c--;}
                                                }else{break;}
                  }        
		for(int i=0;i<n;i++){ans+=s[i];}
        System.out.println(ans);
	}
}


Compiler output:
Main.java:44: error: unexpected type
                                                 d[c].getA()--;
                                                          ^
  required: variable
  found:    value
1 error
Language: C++

#include <iostream>//cout<<right で右揃え
#include <iomanip>//cout<<setw(数字) で空白による桁揃え
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <cstdlib>//abs()で整数絶対値
#include <cmath>//abs()かfabs()で少数絶対値
#include <functional>//sort第三引数greater<型名>()で降順
#include <map>

using namespace std;
using ll = long long int;

int main(){
    ll N,M;cin>>N>>M;
    map<ll,ll> A;
    for(int i=0;i<N;i++){
        int x;cin>>x;
        A[x]++;
    }
    map<ll,ll> B;
    for(int i=0;i<M;i++){
        int y,z;cin>>y>>z;
        B[z] += y;
    }

/*    cout << endl;
    for(auto j=A.begin();j!=A.end();++j){
        cout << j->first << " " << j->second << endl;
    }
    cout << endl;
    for(auto j=B.begin();j!=B.end();++j){
        cout << j->first << " " << j->second << endl;
    }
*/
    auto i = A.begin();
    for(auto j=B.rbegin();j!=B.rend();++j){
        while(j->second!=0){
            if(i->first>=j->first) break;
            if(j->second>=i->second){
                B[j->first] -= i->second;
                A[j->first] += i->second;
                A.erase(A.begin());
                i = A.begin();
            }else{
                A[i->first] -= j->second;
                A[j->first] += j->second;
                B[j->first] = 0;
            }
        }

/*        cout << endl;
        for(auto j=A.begin();j!=A.end();++j){
            cout << j->first << " " << j->second << endl;
        }       
        cout << endl;
        for(auto j=B.begin();j!=B.end();++j){
            cout << j->first << " " << j->second << endl;
        }
        cout << endl;        
    }
*/
    ll ans = 0;
    for(auto j=A.begin();j!=A.end();++j){
        ans += j->first * j->second;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:2: error: expected '}' at end of input
   70 | }
      |  ^
a.cc:15:11: note: to match this '{'
   15 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,M;
  cin>>N>>M;
  vector<int64_t>A(N);
  for(int i=0;i<N;i++)
    cin>>A.at(i);
  sort(A.begin(),A.end());
  reverse(A.bebin(),A.end());
  vector<pair<int64_t,int>>D(M);
  for(int i=0;i<M;i++){
  int B; int64_t C;
    cin>>B>>C; B--;
    pair<int64_t,int>p(C,B);
    D.at(i)=p;
  }
  sort(D.begin(),D.end());
  reverse(D.begin(),D.end());
  vector<int64_t>R(N,0);
  int m=-1;
  for(int i=0;i<M;i++){
  
  if(m<D.at(i).second){
    for(int j=m+1;j<=D.at(i).second;j++)
     R.at(j)=D.at(i).first;
  } m=D.at(i).second;
  
 }int64_t ans=0;
  for(int i=0;i<N;i++){
   ans+=max(A.at(i),R.at(i));
  }cout<<ans<<endl;
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'class std::vector<long int>' has no member named 'bebin'; did you mean 'begin'?
   10 |   reverse(A.bebin(),A.end());
      |             ^~~~~
      |             begin
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,M;
  cin>>N>>M;
  vector<int64_t>A(N);
  for(int i=0;i<N;i++)
    cin>>A.at(i);
  sort(A.begin(),A.end());
  vecor<pair<int64_t,int>>D(M);
  for(int i=0;i<M;i++){
  int B; int64_t C;
    cin>>B>>C; B--;
    pair<int64_t,int>p(C,B);
    D.at(i)=p;
  }
  sort(D.begin(),D.end());
  reverse(D.begin(),D.end());
  vector<int64_t>R(N,0);
  int m=-1;
  for(int i=0;i<M;i++){
  
  if(m<D.at(i).second){
    for(int j=m+1;j<=D.at(i).second;j++)
     R.at(j)=D.at(i).first;
  } m=D.at(i).second;
  
 }int64_t ans=0;
  for(int i=0;i<N;i++){
   ans+=max(A.at(i),R.at(i));
  }cout<<ans<<endl;
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'vecor' was not declared in this scope
   10 |   vecor<pair<int64_t,int>>D(M);
      |   ^~~~~
a.cc:10:25: error: expected primary-expression before '>' token
   10 |   vecor<pair<int64_t,int>>D(M);
      |                         ^~
a.cc:10:27: error: 'D' was not declared in this scope
   10 |   vecor<pair<int64_t,int>>D(M);
      |                           ^
Language: C++

#include<stdio.h>
#include<algorithm>
#include<map>
using namespace std;

typedef pair<int, int> P;

int a[100000];
P card[100000];

int max(int a,int b){return a > b ? a : b;}

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

    for(int i = 0; i < n; i++) cin >> a[i];
    for(int i = 0; i < m; i++) {
        int c, b;
        cin >> c >> b;
        card[i] = P(b, c);
    }

    sort(a, a + n);
    sort(card, card + m);
    reverse(card, card + m);

    int t = 0;
    for(int i = 0; i < m; i++) {
        P p = card[i];
        int b = p.first;
        int c = p.second;
        for(int j = 0; j < c; j++) {
            a[t] = max(a[t], b);
            t++;

            if(t == n) break;
        }

        if (t == n) break;
    }

    long long s = 0;
    for(int i = 0; i < n; i++) s += a[i];
    cout << s;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'cin' was not declared in this scope
   15 |     cin >> n >> m;
      |     ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<map>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:45:5: error: 'cout' was not declared in this scope
   45 |     cout << s;
      |     ^~~~
a.cc:45:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        
        PriorityQueue<Integer> que = new PriorityQueue<>();
        for (int i = 0; i < n; i++) {
            que.add(sc.nextInt());
        }
        
        while (m-- > 0) {
            int k = sc.nextInt();
            int v = sc.nextInt();
            
            int c = 0;
            for (int i = 0; i < k; i++) {
                int num = que.peek();
                if (num < v) {
                    que.poll();
                    c++;
                } else {
                    break;
                }
            }
            for (int i = 0; i < c; i++) {
                que.add(v);
            }
        }
        
        long ans = 0;
        while (!que.isEmpty()) {
            ans += que.poll();
        }
        System.out.println(ans);
    }
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

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

// Type alias
using ll=long long;
using ld=double;

using pi=pair<int,int>;
using pll=pair<ll,ll>;
using pld=pair<ld,ld>;
using ti3=tuple<int, int, int>;

using vi=vector<int>;
using vll=vector<ll>;
using vld=vector<ld>;
using vpi=vector<pi>;
using vpll=vector<ll>;
using vpld=vector<ld>;
using vti3=vector<ti3>;

// Constants
const double EPS = 1e-9;
const int inf = numeric_limits<int>::max() / 2;
const ll mod = 1e9+7;

// Macro
#define rep(i,n) for(int i=0;i<int(n);++i)
#define rrep(i,n) for(int i=int(n-1);i>=0;--i)
#define REP(i,a,b) for(int i=int(a);i<int(b);++i)
#define RREP(i,a,b) for(int i=int(b-1);i>=int(a);--i)
#define SHOW(a) cout << #a << " = " << a << endl
#define ARR(a,n) for(int i=0;i<int(n);++i) cout << #a << "[" << i << "]" << " = " << a[i] << endl

#define ALL(a) a.begin(),a.end()

// Funtcions
ll pow(ll base, ll i, ll mod){
  ll a = 1;
  while(i){
    if (i & 1) {
      a *= base;
      a %= mod;
    }
    base *= base;
    base %= mod;
    i >>= 1;
  }
  return a;
}
ll gcd(ll a, ll b){
  while(b){
    ll c = a % b;
    a = b;
    b = c;
  }
  return a;
}
ll lcm(ll a, ll b){
  return a / gcd(a, b) * b;
}
template<typename T> bool chmin(T& a, const T& b) {
  if (a > b) return a = b, true; else return false;
}

template<typename T> bool chmax(T& a, const T& b) {
  if (a < b) return a = b, true; else return false;
}


void solve(){
  ll N, M;
  cin >> N >> M;
  map<ll, ll, greater<ll>> t;
  rep(i, N){
    ll a;
    cin >> a;
    if(t.contains(a)) t[a]++;
    else t[a] = 1;
  }

  rep(i, M){
    ll b, c;
    cin >> b >> c;
    if(t.contains(c)) t[c] += b;
    else t[c] = b;
  }

  ll sum = 0;
  ll count = 0;
  for(auto p : t){
    sum += p.first * min(N-count, p.second);
    count += p.second;
    if(count >= N)
      break;
  }

  cout << sum << endl;
}

int main(){
// FastIO
//ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:77:10: error: 'class std::map<long long int, long long int, std::greater<long long int> >' has no member named 'contains'
   77 |     if(t.contains(a)) t[a]++;
      |          ^~~~~~~~
a.cc:84:10: error: 'class std::map<long long int, long long int, std::greater<long long int> >' has no member named 'contains'
   84 |     if(t.contains(c)) t[c] += b;
      |          ^~~~~~~~
Language: C++

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

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

  vector<pair<ll,ll>> w(m + 100000);
  for(int i = 0; i < n; i++){
      ll a;
      cin >> a;
      w[m + a].first = a;
      w[m + a].second++;
  }
    
  for(int i = 0; i < m; i++){
          cin >> w[i].second >> w[i].first;
  }

  sort(w.begin(), w.end());
    int i = w.size()-1;
    int cnt = 0;
    ll sum = 0;
    bool f = false;
  while(true){
      while(w[i].second > 0){
          sum += w[i].first;
          cnt ++;
          if(cnt == n){f = true; break;}
          w[i].second--;
      }
      if(f){break;}
      i--;

  }

Compiler output:
a.cc: In function 'int main()':
a.cc:37:4: error: expected '}' at end of input
   37 |   }
      |    ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: Java

mport java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		Card[] cards = new Card[N + M];
		for (int i = 0; i < N; i++) {
			cards[i] = new Card(1, Integer.parseInt(sc.next()));
		}

		for (int i = N; i < M + N; i++) {
			cards[i] = new Card(Integer.parseInt(sc.next()), Integer.parseInt(sc.next()));
		}
		sc.close();

		Arrays.sort(cards, new Comparator<Card>() {
			public int compare(Card t1, Card t2) {
				return (int) (t2.num - t1.num);
			}
		});

		long ans = 0;
		long remain = N;
		for (Card card : cards) {
			if (remain <= card.count) {
				ans += remain * card.num;
				break;
			}
			ans += card.num * card.count;
			remain -= card.count;
		}

		System.out.println(ans);

	}

	static class Card {
		long num;
		int count;

		Card(int count, int num) {
			this.count = count;
			this.num = num;
		}
	}

}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Arrays;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.Comparator;
^
Main.java:3: error: class, interface, enum, or record expected
import java.util.Scanner;
^
3 errors
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
#define rrep(i, n) for(int i = n-1; i >= 0; --i)
#define fi first
#define se second
using namespace std;
using lint = long long;
using uint = unsigned int;
using ulint = unsigned long long;
using ldouble = long double;
using pii = pair<int, int>;
using pli = pair<lint, lint>;
using pdd = pair<double, double>;
using pld = pair<ldouble, ldouble>;
using v1i = vector<int>;
using v1li = vector<lint>;
using v2i = vector<vector<int>>;
using v2li = vector<vector<lint>>;
using v3i = vector<vector<vector<int>>>;
using v3li = vector<vector<vector<lint>>>;
using v1b = vector<bool>;
using v2b = vector<vector<bool>>;
using v3b = vector<vector<vector<bool>>>;
using v1c = vector<char>;
using v2c = vector<vector<char>>;
using v3c = vector<vector<vector<char>>>;
constexpr lint mod1 = 1e9+7;
constexpr lint mod2 = 998244353;

int main() {
  int n, m, c = 0, d = 0; lint s = 0;
  scanf("%d%d", &n, &m);
  v1i a(n) vector<pii> b(m);
  rep(i, n) scanf("&d", &a[i]);
  rep(i, m) scanf("&d&d", &b[i].se, &b[i].fi);
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  priority_queue<int> pq;
  rep(i, n){
    pq.push(b[c].fi);
    ++d;
    if(d == b[c].se){
      ++c;
      d = 0;
    }
  }
  rep(i, n){
    if(a[i] >= pq.top()) s += a[i];
    else{
      s += pq.top();
      pq.pop();
    }
  }
  printf("%ld", s);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:12: error: expected ',' or ';' before 'vector'
   33 |   v1i a(n) vector<pii> b(m);
      |            ^~~~~~
a.cc:35:28: error: 'b' was not declared in this scope
   35 |   rep(i, m) scanf("&d&d", &b[i].se, &b[i].fi);
      |                            ^
a.cc:37:8: error: 'b' was not declared in this scope
   37 |   sort(b.begin(), b.end());
      |        ^
Language: C++

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

int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
	int N, M;
	priority_queue<
					int,
					vector<int>,
					greater<int>
					> q; 
	cin >> N >> M;
	for (int i = 0; i < N; i++)
	{
		int tmp;
		cin >> tmp;
		q.push(tmp);
	}

	vector<pair<int, int>> vc;
	for (int i = 0; i < M; i++)
	{
		int b, c;
		cin >> b >> c;
		pair<int, int> tmp={c,b};
		vc.push_back(tmp);	
	}
	sort(vc.begin(), vc.end());
	for (int i = 0; i < M; i++)
	{
		if(vc[i].first <= q.top) break;
		for (int i = 0; i < vc[i].second; i++)
		{
			if(q.top>=vc[i].second) break;
			else{
				q.push(vc[i].second);
				q.pop();
			}
		}
	}
	

	ll ans=0;
	while(!q.empty()){
		ans+=q.top();
		q.pop();
	}	
	
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:37: error: invalid use of member function 'std::priority_queue<_Tp, _Sequence, _Compare>::const_reference std::priority_queue<_Tp, _Sequence, _Compare>::top() const [with _Tp = int; _Sequence = std::vector<int>; _Compare = std::greater<int>; const_reference = const int&]' (did you forget the '()' ?)
   33 |                 if(vc[i].first <= q.top) break;
      |                                   ~~^~~
      |                                        ()
a.cc:36:30: error: invalid use of member function 'std::priority_queue<_Tp, _Sequence, _Compare>::const_reference std::priority_queue<_Tp, _Sequence, _Compare>::top() const [with _Tp = int; _Sequence = std::vector<int>; _Compare = std::greater<int>; const_reference = const int&]' (did you forget the '()' ?)
   36 |                         if(q.top>=vc[i].second) 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());

  
  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:22:24: error: expected ';' before ')' token
   22 |   for (int i = 0; i < N); i++) {
      |                        ^
      |                        ;
a.cc:22:27: error: 'i' was not declared in this scope
   22 |   for (int i = 0; i < N); i++) {
      |                           ^