En

#include<bits/stdc++.h> #define P 2000 #define N 5005 #define M 400005 using namespace std; int n,s,s2,t; int cnt = 1; int vis[N]; int dis[N]; int head[N]; long long cost; struct edge{ int to; int nxt; int val; int w; }e[N<<1]; struct node{ int x; int y; friend bool operator <(node a,node b) { if(a.x != b.x) { return a.x < b.x; } return a.y < b.y; } }p[N]; void add(int x,int y,int z,int w) { e[++cnt] = (edge){y,head[x],z,w}; head[x] = cnt; } void addedge(int u,int v,int c,int w){ printf("%d %d\n",u,v); add(u,v,c,w);add(v,u,0,-w); } bool spfa() { memset(vis,0,sizeof(vis)); memset(dis,0x3f,sizeof(dis)); dis[s] = 0; vis[s] = 1; queue<int> q; q....

十一月 18, 2022 · 2 分钟 · 301 字 · Skywings