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

bool cmp(int a,int b){
	if(a>b){
		return true;
	}return false;
}

int main() {
	int n,m,k,x,y,a[100005],b[100005],c[100005],sum = 0;
	cin>>x>>y>>n>>m>>k;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}for(int i=0;i<m;i++){
		cin>>b[i];
	}for(int i=0;i<k;i++){
		cin>>c[i];
	}sort(a+0,a+n,cmp);
	sort(b+0,b+m,cmp);
	sort(c+0,c+k,cmp);
	
	int biaozhi = 0;
	int now = 0;
	while(now < x){
		if(c[biaozhi] > a[now]){
			sum += c[biaozhi];
			x -= 1;
			biaozhi += 1;
		}now++;	
	}now = 0;
	while(now < y){
		if(c[biaozhi] > b[now]){
			sum += c[biaozhi];
			y -= 1;
			biaozhi += 1;
		}	now++;
	}
	for(int i=0;i<x;i++){
		sum += a[i];
	}for(int i=0;i<y;i++){
		sum += b[i];
	}cout<<sum;
	return 0;
}

Wrong Answer 25pts

0 条评论

目前还没有评论...