Language: C++

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

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int x,y,a,b,c;
	cin>>x>>y>>a>>b>>c;
	priority_queue<int,vector<int>,greater<int> >pq_a;
	priority_queue<int,vector<int>,greater<int> >pq_b;
	priority_queue<int,vector<int>,less<int> >pq_c;
	while(a--){
		int a;
		cin>>a;
		pq_a.push(a);
	}
	while(b--){
		int a;
		cin>>a;
		pq_b.push(a);
	}
	while(c--){
		int a;
		cin>>a;
		pq_c.push(a);
	}
	while(pq_a.size()>x) pq_a.pop();
	while(pq_b.size()>y) pq_b.pop();
	while(!pq_c.empty()){
		int curr = pq_c.top();
		pq_c.pop();
		if(pq_a.top()>=curr && pq_b.top()>=curr) break;
		if(pq_a.top()>=pq_b.top()){
			pq_b.pop();
			pq_b.push(curr);
		}
		else{
			pq_a.pop();
			pq_a.push(curr);
		}
	}
	long long ret = 0;
	while(!pq_a.empty()){
		ret+=pq_a.top();
		pq_a.pop();
	}
	while(!pq_b.empty()){
		ret+=pq_b.top();
		pq_b.pop();
	}
	cout<<ret;
}

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:5:9: error: 'ios_base' has not been declared
    5 |         ios_base::sync_with_stdio(false);
      |         ^~~~~~~~
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin.tie(NULL);
      |         ^~~
a.cc:6:17: error: 'NULL' was not declared in this scope
    6 |         cin.tie(NULL);
      |                 ^~~~
a.cc:1:1: note: 'NULL' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
  +++ |+#include <cstddef>
    1 | include<bits/stdc++.h>
a.cc:9:9: error: 'priority_queue' was not declared in this scope
    9 |         priority_queue<int,vector<int>,greater<int> >pq_a;
      |         ^~~~~~~~~~~~~~
a.cc:9:24: error: expected primary-expression before 'int'
    9 |         priority_queue<int,vector<int>,greater<int> >pq_a;
      |                        ^~~
a.cc:10:24: error: expected primary-expression before 'int'
   10 |         priority_queue<int,vector<int>,greater<int> >pq_b;
      |                        ^~~
a.cc:11:24: error: expected primary-expression before 'int'
   11 |         priority_queue<int,vector<int>,less<int> >pq_c;
      |                        ^~~
a.cc:15:17: error: 'pq_a' was not declared in this scope
   15 |                 pq_a.push(a);
      |                 ^~~~
a.cc:20:17: error: 'pq_b' was not declared in this scope
   20 |                 pq_b.push(a);
      |                 ^~~~
a.cc:25:17: error: 'pq_c' was not declared in this scope
   25 |                 pq_c.push(a);
      |                 ^~~~
a.cc:27:15: error: 'pq_a' was not declared in this scope
   27 |         while(pq_a.size()>x) pq_a.pop();
      |               ^~~~
a.cc:28:15: error: 'pq_b' was not declared in this scope
   28 |         while(pq_b.size()>y) pq_b.pop();
      |               ^~~~
a.cc:29:16: error: 'pq_c' was not declared in this scope
   29 |         while(!pq_c.empty()){
      |                ^~~~
a.cc:32:20: error: 'pq_a' was not declared in this scope
   32 |                 if(pq_a.top()>=curr && pq_b.top()>=curr) break;
      |                    ^~~~
a.cc:32:40: error: 'pq_b' was not declared in this scope
   32 |                 if(pq_a.top()>=curr && pq_b.top()>=curr) break;
      |                                        ^~~~
a.cc:33:20: error: 'pq_a' was not declared in this scope
   33 |                 if(pq_a.top()>=pq_b.top()){
      |                    ^~~~
a.cc:33:32: error: 'pq_b' was not declared in this scope
   33 |                 if(pq_a.top()>=pq_b.top()){
      |                                ^~~~
a.cc:43:16: error: 'pq_a' was not declared in this scope
   43 |         while(!pq_a.empty()){
      |                ^~~~
a.cc:47:16: error: 'pq_b' was not declared in this scope
   47 |         while(!pq_b.empty()){
      |                ^~~~
a.cc:51:9: error: 'cout' was not declared in this scope
   51 |         cout<<ret;
      |         ^~~~