/in/foo.cc:14:1: error: expected initializer before 'struct'
struct EDGE
^~~~~~
/in/foo.cc:18:2: error: 'edge' does not name a type
}edge[N<<1];
^~~~
/in/foo.cc: In function 'void add(int, int, ll)':
/in/foo.cc:29:2: error: 'edge' was not declared in this scope
edge[++tot]=(EDGE){v,head[u],w};
^~~~
/in/foo.cc:29:15: error: 'EDGE' was not declared in this scope
edge[++tot]=(EDGE){v,head[u],w};
^~~~
/in/foo.cc: In function 'void spfa(int)':
/in/foo.cc:35:25: error: 'dist' was not declared in this scope
for (int i=1;i<=n;i++) dist[i]=inf;
^~~~
/in/foo.cc:36:2: error: 'dist' was not declared in this scope
dist[s]=0;
^~~~
/in/foo.cc:42:26: error: 'edge' was not declared in this scope
for (int i=head[k];i;i=edge[i].nxt)
^~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:67:6: error: 'dist' was not declared in this scope
if (dist[n]<=t) printf("%lld\n",dist[n]);
^~~~