提交时间:2022-08-18 10:56:50
运行 ID: 55398
#include<bits/stdc++.h> #define int long long #define mod 1000000007 #define inf 0x7f7f7f7f using namespace std; inline int read(){ int x=0,f=0;char c=getchar(); while(!isdigit(c))f|=(!(c^'-')),c=getchar(); while(isdigit(c))x=(x<<1)+(x<<3)+(c^48),c=getchar(); return f?-x:x; } struct edge{int to,w;}; struct node{ int u,dis; bool operator<(const node &fuck)const{return dis>fuck.dis;} }; struct _{int u,v,w;}a[100005]; vector<edge>g[100005]; int n,m,l,s,t,dis[100005]; bool vis[100005]; inline void dij(int s){ priority_queue<node>q; for(int i=1;i<=n;i++)vis[i]=0,dis[i]=inf; dis[1]=0; q.push((node){s,dis[s]}); while(!q.empty()){ node no=q.top(); q.pop(); int u=no.u,d=no.dis; if(vis[u])continue; vis[u]=1; for(int j=0;j<g[u].size();j++){ int v=g[u][j].v.w=g[u][j].w; if(dis[v]>dis[u]+w){ dis[v]=dis[u]+w; q.push((node){v,dis[v]}); } } } } signed main(){ puts("NO"); return 0; }