摘要: P1038 神经网络,拓扑排序板子题 include <bits/stdc++.h> using namespace std; const int N=1e2+10; struct node { int v,w; }; vector g[N]; queue q; int n,m; bool flag 阅读全文
posted @ 2024-10-06 08:35 srzsrz 阅读(15) 评论(0) 推荐(0)
摘要: P4568 分层图板子题(卡SPFA) include<bits/stdc++.h> define ll long long using namespace std; const int N=1e5+10; int n,m,k,s,t; ll vis[N<<4],dis[N<<4]; ll ans= 阅读全文
posted @ 2024-10-06 08:33 srzsrz 阅读(6) 评论(0) 推荐(0)
摘要: bool SPFA(int s) { int cnt=0; memset(dis,0x3f,sizeof(dis)); queue<int> q; q.push(s); vis[s]=1;dis[v]=0; while(!q.empty()) { int u=q.front();q.pop(); v 阅读全文
posted @ 2024-08-24 18:41 srzsrz 阅读(43) 评论(0) 推荐(0)