E. Nearest Opposite Parity dijkstra+反向建边+超级源点
E. Nearest Opposite Parity//n+1奇数0偶数超级源点int n,a[MAXN];vector<pii>edge[MAXN];int dis[MAXN],vis[MAXN],ans[MAXN];void spfa(int u){ rep(i,n+2) dis[i]=1<<30,vis[i]=0; queue<int...
原创
2019-12-16 01:05:24 ·
299 阅读 ·
0 评论