题目描述:
输入格式:
输出格式:
输入样例:
4 4 5 7 3 4 1 2 4 1 3 5 2 4 3 3 4 5
输出样例:
13
#include<bits/stdc++.h>
using namespace std;
const int N=1010,M=10010;
struct node{
int x,y;
bool operator<(const node&x)const{//这个用于去让优先队列,根据y值进行排列
return x.y<y;
}
};
int n,m;
vector<node>a[N];//vector容器用来