把距离从小到大排序
d[i][j]表示有前i个男生和前j个女生的最优方案
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<vector>
#include<queue>
#include<deque>
#include<iostream>
#include<map>
#define max(a, b) ((a) > (b) ? (a) : (b))
#define SF scanf
#define PF printf
using namespace std;
typedef long long LL;
const int MAXN = 2011;
const int MAXM = 2011 * 3;
int n, m;
struct Node {
char A[20];
int x;
bool operator < (const Node &t) const {
return x < t.x;
}
} boy[MAXN+10], girl[MAXM+10];
int d[MAXN+10][MAXM+10], Boy[MAXN+10][MAXM+10], Girl[MAXN+10][MAXM+10];
char Name[4][20];
void dp()
{
memset(d, 0x3f, sizeof(d));
d[0][0] = 0;
for(int i = 1; i <= n; i++)
{
for