判断是否满流,,,人数给了100000,一看普通建图肯定不行,卡了几天了,,
看了网上说把状态相同(选择星球相同)的人合并,用二进制,最多有2^10种状态,
#include<stdio.h>
#include<string.h>
#include<queue>
#define N 100100
#define inf 0x3fffffff
using namespace std;
int dis[N],gap[10],num,head[N],start,end,ans;
struct edge
{
int st,ed,next,flow;
}E[N*10];
void addedge(int x,int y,int flow)
{
E[num].st=x;E[num].ed=y;E[num].flow=flow;E[num].next=head[x];head[x]=num++;
E[nu......
阅读全文