Language: C++

#include<bits/stdc++.h>
 2 #define F(i,a,b) for(int i=(a);i<=(b);++i)
 3 #define eF(i,u) for(int i=h[u];i;i=nxt[i])
 4 #define Mod 1000000007
 5 using namespace std;
 6 typedef long long ll;
 7 typedef pair<ll,int> pli;
 8 
 9 int n,m,S,T;
10 ll Ans;
11 int U[200001],V[200001],D[200001];
12 int h[100001],nxt[400001],to[400001],w[400001],tot;
13 void ins(int x,int y,int z){nxt[++tot]=h[x];to[tot]=y;w[tot]=z;h[x]=tot;}
14 
15 ll d1[100001],d2[100001],g1[100001],g2[100001];bool v1[100001],v2[100001];
16 priority_queue<pli,vector<pli>,greater<pli> > pq;
17 
18 void Dij(ll*d,ll*g,bool*v,int s){
19     d[s]=0ll;
20     pq.push(pli(0ll,s));
21     g[s]=1;
22     while(!pq.empty()){
23         pli P=pq.top(); pq.pop();
24         int u=P.second; ll du=P.first;
25         if(v[u]||d[u]<du) continue;
26         v[u]=1;
27         eF(i,u){
28             if(d[to[i]]==du+w[i])
29                 g[to[i]]=(g[to[i]]+g[u])%Mod;
30             if(d[to[i]]>du+w[i])
31                 g[to[i]]=g[u],
32                 d[to[i]]=du+w[i], pq.push(pli(d[to[i]],to[i]));
33         }
34     }
35 }
36 
37 int main(){
38     int x,y,z;
39     scanf("%d%d",&n,&m);
40     scanf("%d%d",&S,&T);
41     F(i,1,m) scanf("%d%d%d",&x,&y,&z), ins(x,y,z), ins(y,x,z), U[i]=x, V[i]=y, D[i]=z;
42     memset(d1,0x3f,sizeof d1);
43     Dij(d1,g1,v1,S);
44     memset(d2,0x3f,sizeof d2);
45     Dij(d2,g2,v2,T);
46     ll Dist=d1[T];
47     Ans=g1[T]*g1[T]%Mod;
48     F(i,1,n){
49         if(d1[i]+d2[i]==Dist&&d1[i]==d2[i])
50             Ans=(Ans-g1[i]*g1[i]%Mod*g2[i]%Mod*g2[i]%Mod)%Mod;
51     }
52     int u,v,d;
53     F(i,1,m){
54         u=U[i], v=V[i], d=D[i];
55         if(d1[u]+d+d2[v]==Dist && d1[u]+d>d2[v] && d2[v]+d>d1[u]){
56             Ans=(Ans-g1[u]*g2[v]%Mod*g1[u]%Mod*g2[v]%Mod)%Mod;
57         }
58         u=V[i], v=U[i], d=D[i];
59         if(d1[u]+d+d2[v]==Dist && d1[u]+d>d2[v] && d2[v]+d>d1[u]){
60             Ans=(Ans-g1[u]*g2[v]%Mod*g1[u]%Mod*g2[v]%Mod)%Mod;
61         }
62     }
63     printf("%lld",(Ans%Mod+Mod)%Mod);
64     return 0;
65 }

Compiler output:
a.cc:2:4: error: stray '#' in program
    2 |  2 #define F(i,a,b) for(int i=(a);i<=(b);++i)
      |    ^
a.cc:3:4: error: stray '#' in program
    3 |  3 #define eF(i,u) for(int i=h[u];i;i=nxt[i])
      |    ^
a.cc:4:4: error: stray '#' in program
    4 |  4 #define Mod 1000000007
      |    ^
a.cc:2:2: error: expected unqualified-id before numeric constant
    2 |  2 #define F(i,a,b) for(int i=(a);i<=(b);++i)
      |  ^
a.cc:2:35: error: 'i' does not name a type
    2 |  2 #define F(i,a,b) for(int i=(a);i<=(b);++i)
      |                                   ^
a.cc:2:42: error: expected unqualified-id before '++' token
    2 |  2 #define F(i,a,b) for(int i=(a);i<=(b);++i)
      |                                          ^~
a.cc:3:35: error: 'i' does not name a type
    3 |  3 #define eF(i,u) for(int i=h[u];i;i=nxt[i])
      |                                   ^
a.cc:3:37: error: 'i' does not name a type
    3 |  3 #define eF(i,u) for(int i=h[u];i;i=nxt[i])
      |                                     ^
a.cc:6:2: error: expected unqualified-id before numeric constant
    6 |  6 typedef long long ll;
      |  ^
a.cc:7:2: error: expected unqualified-id before numeric constant
    7 |  7 typedef pair<ll,int> pli;
      |  ^
a.cc:8:2: error: expected unqualified-id before numeric constant
    8 |  8
      |  ^
a.cc:10:1: error: expected unqualified-id before numeric constant
   10 | 10 ll Ans;
      | ^~
a.cc:11:1: error: expected unqualified-id before numeric constant
   11 | 11 int U[200001],V[200001],D[200001];
      | ^~
a.cc:12:1: error: expected unqualified-id before numeric constant
   12 | 12 int h[100001],nxt[400001],to[400001],w[400001],tot;
      | ^~
a.cc:13:1: error: expected unqualified-id before numeric constant
   13 | 13 void ins(int x,int y,int z){nxt[++tot]=h[x];to[tot]=y;w[tot]=z;h[x]=tot;}
      | ^~
a.cc:14:1: error: expected unqualified-id before numeric constant
   14 | 14
      | ^~
a.cc:16:1: error: expected unqualified-id before numeric constant
   16 | 16 priority_queue<pli,vector<pli>,greater<pli> > pq;
      | ^~
a.cc:17:1: error: expected unqualified-id before numeric constant
   17 | 17
      | ^~
a.cc:36:1: error: expected unqualified-id before numeric constant
   36 | 36
      | ^~