题意:把n个好友分到m个组。求每个组的最大人数最小可以是多少人,,,
最大流+二分,,,,isap跑得还是挺快的,,,
#include<stdio.h>
#include<string.h>
const int N=1510;
const int inf=0x3fffffff;
int dis[N],gap[N],head[N],num,start,ans,end,first[N],nume,n,m;
struct edge
{
int st,ed,flow,next;
}E[510000];
struct node
{
int x,next;
}e[510000];
void addedge(int x,int y,int w)
{
E[num].st=x;E[num].ed=y;E[num].flow=w;E[num].next=head[x];head[x]=num++;
E[num].st=y;E[num].ed=x......
阅读全文