Language: C++

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

using namespace std;

int main(){
  int x,y,a,b,c,ans=0;
  int a[100010],b[100010],c[100010];
  
  cin >> x >> y >> a >> b >> c;
  
  for(int i=0;i<a;i++)
    cin >> a[i];
  for(int i=0;i<b;i++)
    cin >> b[i];
  for(int i=0;i<c;i++)
    cin >> c[i];
  
  priority_queue<int> qa;
  priority_queue<int> qb;
  priority_queue<int> qc;
  
  for(int i=0;i<a;i++){
    qa.push_back(a[i]);
  }
  for(int i=0;i<b;i++){
    qb.push_back(b[i]);
  }
  for(int i=0;i<c;i++){
    qc.push_back(c[i]);
  }
  
  
    for(int i=0;i<x;i++){
      qd.push_back(qa.top());
      qa.pop();
    }
    for(int i=0;i<y;i++){
      qd.push_back(qb.top());
      qb.pop();
    }
  for(int i=0;i<c;i++){
    qd.push_back(qc.top());
    qc.pop();
  }
  
  for(int i=0;i<x+y;i++){
    ans += qd.top();
    qd.pop();
  }
  
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: conflicting declaration 'int a [100010]'
    9 |   int a[100010],b[100010],c[100010];
      |       ^
a.cc:8:11: note: previous declaration as 'int a'
    8 |   int x,y,a,b,c,ans=0;
      |           ^
a.cc:9:17: error: conflicting declaration 'int b [100010]'
    9 |   int a[100010],b[100010],c[100010];
      |                 ^
a.cc:8:13: note: previous declaration as 'int b'
    8 |   int x,y,a,b,c,ans=0;
      |             ^
a.cc:9:27: error: conflicting declaration 'int c [100010]'
    9 |   int a[100010],b[100010],c[100010];
      |                           ^
a.cc:8:15: note: previous declaration as 'int c'
    8 |   int x,y,a,b,c,ans=0;
      |               ^
a.cc:14:13: error: invalid types 'int[int]' for array subscript
   14 |     cin >> a[i];
      |             ^
a.cc:16:13: error: invalid types 'int[int]' for array subscript
   16 |     cin >> b[i];
      |             ^
a.cc:18:13: error: invalid types 'int[int]' for array subscript
   18 |     cin >> c[i];
      |             ^
a.cc:25:8: error: 'class std::priority_queue<int>' has no member named 'push_back'
   25 |     qa.push_back(a[i]);
      |        ^~~~~~~~~
a.cc:25:19: error: invalid types 'int[int]' for array subscript
   25 |     qa.push_back(a[i]);
      |                   ^
a.cc:28:8: error: 'class std::priority_queue<int>' has no member named 'push_back'
   28 |     qb.push_back(b[i]);
      |        ^~~~~~~~~
a.cc:28:19: error: invalid types 'int[int]' for array subscript
   28 |     qb.push_back(b[i]);
      |                   ^
a.cc:31:8: error: 'class std::priority_queue<int>' has no member named 'push_back'
   31 |     qc.push_back(c[i]);
      |        ^~~~~~~~~
a.cc:31:19: error: invalid types 'int[int]' for array subscript
   31 |     qc.push_back(c[i]);
      |                   ^
a.cc:36:7: error: 'qd' was not declared in this scope; did you mean 'qc'?
   36 |       qd.push_back(qa.top());
      |       ^~
      |       qc
a.cc:40:7: error: 'qd' was not declared in this scope; did you mean 'qc'?
   40 |       qd.push_back(qb.top());
      |       ^~
      |       qc
a.cc:44:5: error: 'qd' was not declared in this scope; did you mean 'qc'?
   44 |     qd.push_back(qc.top());
      |     ^~
      |     qc
a.cc:49:12: error: 'qd' was not declared in this scope; did you mean 'qc'?
   49 |     ans += qd.top();
      |            ^~
      |            qc