Senior's Gun薛杰杰是一位美丽迷人的神枪手。她经常携带n支枪,每支枪都具有攻击力a[i。有一天,薛杰杰走到外面,遇到了怪物,每个怪物都有防御力b[们]。在满足b[i]≤a[i]的情况下,薛杰杰可用i枪杀死怪物j,她会得到a[i]-b[]的奖金。请记住,每支枪只能用来杀死一个怪物,而且显然每个怪物只能被杀死一次。薛杰杰想最大化她的奖金,并且她没有必要杀死所有的怪物。#include (5488)#include #include using namespace std;int Gun[100000] = { 0 };int Monster[100000] = { 0 };bool compare1(int a,int b) {return a > b;//降序}bool compare2(int a,int b) {return a }int main() {int T,n,m,money = 0;cin >> T;while (T>0){cin >> n >> m;for (int i = 0; i cin >> Gun[i];}for (int j = 0; j cin >> Monster[j];}sort(Gun, Gun + n, compare1);sort(Monster, Monster + m, compare2);for (int i = 0; i if (Gun[i] - Monster[i] > 0) {money += Gun[i] - Monster[i];}}cout }}