Language: C++

#include<bits/stdc++.h>
#define MAX_N 100005
#define inf (1LL<<60)
#define LL long long
#define pb push_back
#define MOD 1000000007
using namespace std;
struct node{
	LL y,cost;
};
struct cmp{
	bool operator()(node x,node y){
		if(x.cost==y.cost)	return x.y<y.y;
		return x.cost>y.cost;
	}
};
LL n,m;
LL dst[2][MAX_N],t[2][MAX_N];
LL ans;
priority_queue<node,vector<node>,cmp> Q;
vector<node> net[MAX_N];
void dijkstra(LL s,LL z){
	LL sz,i;
	node p,q;
	for(i=1;i<=n;i++)	dst[z][i]=inf;
	dst[z][s]=0;
	t[z][s]=1;
	Q.push({s,0});
	while(!Q.empty()){
		p=Q.top();Q.pop();
		if(dst[z][p.y]!=p.cost)	continue;
		sz=net[p.y].size();
		while(sz--){
			q=net[p.y][sz];
			if(dst[z][q.y]==p.cost+q.cost){
				t[z][q.y]=(t[z][q.y]+t[z][p.y])%MOD;
			}
			if(dst[z][q.y]>p.cost+q.cost){
				dst[z][q.y]=p.cost+q.cost;
				t[z][q.y]=t[z][p.y];
				Q.push({q.y,dst[z][q.y]});
			}
		}
	}
}
int main(){
	freopen("input.txt","r",stdin);
	LL s,e,i,x;
	node p;
	scanf("%lld %lld",&n,&m);
	scanf("%lld %lld",&s,&e);
	for(i=1;i<=m;i++){
		scanf("%lld %lld %lld",&x,&p.y,&p.cost);
		net[x].pb(p);
		swap(x,p.y);net[x].pb(p);
	}
	dijkstra(s,0);
	dijkstra(e,1);
	ans=(t[0][e]*t[0][e])%MOD;
	for(i=1;i<=n;i++){
		if(dst[0][i]==dst[1][i] && dst[0][i]+dst[1][i]==dst[0][e])	ans=(ans-t[0][i]*t[1][i]+MOD*MOD)%MOD;
	}
	LL sz;
	for(i=1;i<=n;i++){
		sz=net[i].size();
		while(sz--){
			p=net[i][sz];
			if(dst[0][i]+dst[1][p.y]+p.cost!=dst[0][e])	continue;
			if(dst[1][p.y]+p.cost>dst[0][i] && dst[0][i]+p.cost>dst[1][p.y])	ans=(ans-t[0][i]*t[1][p.y]+MOD*MOD)%MOD;
		}
	}
	printf("%lld\n",ans);
	return 0;
}#include<bits/stdc++.h>
#define MAX_N 100005
#define inf (1LL<<60)
#define LL long long
#define pb push_back
#define MOD 1000000007
using namespace std;
struct node{
	LL y,cost;
};
struct cmp{
	bool operator()(node x,node y){
		if(x.cost==y.cost)	return x.y<y.y;
		return x.cost>y.cost;
	}
};
LL n,m;
LL dst[2][MAX_N],t[2][MAX_N];
LL ans;
priority_queue<node,vector<node>,cmp> Q;
vector<node> net[MAX_N];
void dijkstra(LL s,LL z){
	LL sz,i;
	node p,q;
	for(i=1;i<=n;i++)	dst[z][i]=inf;
	dst[z][s]=0;
	t[z][s]=1;
	Q.push({s,0});
	while(!Q.empty()){
		p=Q.top();Q.pop();
		if(dst[z][p.y]!=p.cost)	continue;
		sz=net[p.y].size();
		while(sz--){
			q=net[p.y][sz];
			if(dst[z][q.y]==p.cost+q.cost){
				t[z][q.y]=(t[z][q.y]+t[z][p.y])%MOD;
			}
			if(dst[z][q.y]>p.cost+q.cost){
				dst[z][q.y]=p.cost+q.cost;
				t[z][q.y]=t[z][p.y];
				Q.push({q.y,dst[z][q.y]});
			}
		}
	}
}
int main(){
	LL s,e,i,x;
	node p;
	scanf("%lld %lld",&n,&m);
	scanf("%lld %lld",&s,&e);
	for(i=1;i<=m;i++){
		scanf("%lld %lld %lld",&x,&p.y,&p.cost);
		net[x].pb(p);
		swap(x,p.y);net[x].pb(p);
	}
	dijkstra(s,0);
	dijkstra(e,1);
	ans=(t[0][e]*t[0][e])%MOD;
	for(i=1;i<=n;i++){
		if(dst[0][i]==dst[1][i] && dst[0][i]+dst[1][i]==dst[0][e])	ans=(ans-t[0][i]*t[1][i]+MOD*MOD)%MOD;
	}
	LL sz;
	for(i=1;i<=n;i++){
		sz=net[i].size();
		while(sz--){
			p=net[i][sz];
			if(dst[0][i]+dst[1][p.y]+p.cost!=dst[0][e])	continue;
			if(dst[1][p.y]+p.cost>dst[0][i] && dst[0][i]+p.cost>dst[1][p.y])	ans=(ans-t[0][i]*t[1][p.y]+MOD*MOD)%MOD;
		}
	}
	printf("%lld\n",ans);
	return 0;
}

Compiler output:
a.cc:74:2: error: stray '#' in program
   74 | }#include<bits/stdc++.h>
      |  ^
a.cc: In function 'int main()':
a.cc:61:109: warning: integer overflow in expression of type 'int' results in '-371520463' [-Woverflow]
   61 |                 if(dst[0][i]==dst[1][i] && dst[0][i]+dst[1][i]==dst[0][e])      ans=(ans-t[0][i]*t[1][i]+MOD*MOD)%MOD;
      |                                                                                                             ^
a.cc:69:127: warning: integer overflow in expression of type 'int' results in '-371520463' [-Woverflow]
   69 |                         if(dst[1][p.y]+p.cost>dst[0][i] && dst[0][i]+p.cost>dst[1][p.y])        ans=(ans-t[0][i]*t[1][p.y]+MOD*MOD)%MOD;
      |                                                                                                                               ^
a.cc: At global scope:
a.cc:74:3: error: 'include' does not name a type
   74 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:81:8: error: redefinition of 'struct node'
   81 | struct node{
      |        ^~~~
a.cc:8:8: note: previous definition of 'struct node'
    8 | struct node{
      |        ^~~~
a.cc:84:8: error: redefinition of 'struct cmp'
   84 | struct cmp{
      |        ^~~
a.cc:11:8: note: previous definition of 'struct cmp'
   11 | struct cmp{
      |        ^~~
a.cc:90:4: error: redefinition of 'long long int n'
   90 | LL n,m;
      |    ^
a.cc:17:4: note: 'long long int n' previously declared here
   17 | LL n,m;
      |    ^
a.cc:90:6: error: redefinition of 'long long int m'
   90 | LL n,m;
      |      ^
a.cc:17:6: note: 'long long int m' previously declared here
   17 | LL n,m;
      |      ^
a.cc:91:4: error: redefinition of 'long long int dst [2][100005]'
   91 | LL dst[2][MAX_N],t[2][MAX_N];
      |    ^~~
a.cc:18:4: note: 'long long int dst [2][100005]' previously declared here
   18 | LL dst[2][MAX_N],t[2][MAX_N];
      |    ^~~
a.cc:91:18: error: redefinition of 'long long int t [2][100005]'
   91 | LL dst[2][MAX_N],t[2][MAX_N];
      |                  ^
a.cc:18:18: note: 'long long int t [2][100005]' previously declared here
   18 | LL dst[2][MAX_N],t[2][MAX_N];
      |                  ^
a.cc:92:4: error: redefinition of 'long long int ans'
   92 | LL ans;
      |    ^~~
a.cc:19:4: note: 'long long int ans' previously declared here
   19 | LL ans;
      |    ^~~
a.cc:93:39: error: redefinition of 'std::priority_queue<node, std::vector<node>, cmp> Q'
   93 | priority_queue<node,vector<node>,cmp> Q;
      |                                       ^
a.cc:20:39: note: 'std::priority_queue<node, std::vector<node>, cmp> Q' previously declared here
   20 | priority_queue<node,vector<node>,cmp> Q;
      |                                       ^
a.cc:94:14: error: redefinition of 'std::vector<node> net [100005]'
   94 | vector<node> net[MAX_N];
      |              ^~~
a.cc:21:14: note: 'std::vector<node> net [100005]' previously declared here
   21 | vector<node> net[MAX_N];
      |              ^~~
a.cc:95:6: error: redefinition of 'void dijkstra(long long int, long long int)'
   95 | void dijkstra(LL s,LL z){
      |      ^~~~~~~~
a.cc:22:6: note: 'void dijkstra(long long int, long long int)' previously defined here
   22 | void dijkstra(LL s,LL z){
      |      ^~~~~~~~
a.cc:119:5: error: redefinition of 'int main()'
  119 | int main(){
      |     ^~~~
a.cc:46:5: note: 'int main()' previously defined here
   46 | int main(){
      |     ^~~~
a.cc: In function 'int main()':
a.cc:133:109: warning: integer overflow in expression of type 'int' results in '-371520463' [-Woverflow]
  133 |                 if(dst[0][i]==dst[1][i] && dst[0][i]+dst[1][i]==dst[0][e])      ans=(ans-t[0][i]*t[1][i]+MOD*MOD)%MOD;
      |                                                                                                             ^
a.cc:141:127: warning: integer overflow in expression of type 'int' results in '-371520463' [-Woverflow]
  141 |                         if(dst[1][p.y]+p.cost>dst[0][i] && dst[0][i]+p.cost>dst[1][p.y])        ans=(ans-t[0][i]*t[1][p.y]+MOD*MOD)%MOD;
      |                                                                                                                               ^