Language: C++

#include<tr1/unordered_map>
#include<cstring>
#include<cctype>
#include<cstdio>
#include<queue>
#define INF 2000000000
#define mod 1000000007
using namespace std;
using namespace tr1;
unordered_map<pair<int,int>,int> mn;
int n,m,d[100001],h[100001],ver[200001],edge[200001],next[200001],cnt,x,y,z,F,s=0,sum[100001],N;
bool vis[100001]={0};
priority_queue<pair<int,int>,vector<pair<int,int> >,greater<pair<int,int> > >q;
inline void read(register int &in)
{
    in=0;
    register short fh=1;
    register char C=getchar();
    while(!isdigit(C))fh=(C=='-'?-fh:fh),C=getchar();
    while(isdigit(C))in=(in<<3)+(in<<1)+C-48,C=getchar();
    in*=fh;
}
inline void add(register int x,register int y,register int z)
{
	ver[++cnt]=y;
	edge[cnt]=z;
	next[cnt]=h[x];
	h[x]=cnt;
	mn[make_pair(x,y)]=cnt;
}
inline void dijkstra()
{
	for(register int i=1;i<=n+1;i++)d[i]=INF;
	q.push(make_pair(d[F]=0,F));
	while(!q.empty())
	{
		register int x=q.top().second;q.pop();
		if(vis[x])continue;
		vis[x]=1;
		for(register int i=h[x];i;i=next[i])
		{
			register int y=ver[i];
			if(d[y]>d[x]+edge[i])
			{
				d[y]=d[x]+edge[i];
				sum[y]=sum[x];
				q.push(make_pair(d[y],y));
			}
			else if(d[y]==d[x]+edge[i])sum[y]=(sum[y]+sum[x])%mod;
		}
	}
}
int main()
{
	read(n),read(m);
	read(F),read(N);
	while(m--)
	{
		read(x),read(y),read(z);
		if(mn[make_pair(x,y)])edge[mn[make_pair(x,y)]]=min(edge[mn[make_pair(x,y)]],z);
        else add(x,y,z);
	}
	sum[1]=1;
	dijkstra();
	printf("%d\n",sum[N]*2);
}

Compiler output:
a.cc:14:32: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   14 | inline void read(register int &in)
      |                                ^~
a.cc: In function 'void read(int&)':
a.cc:17:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   17 |     register short fh=1;
      |                    ^~
a.cc:18:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   18 |     register char C=getchar();
      |                   ^
a.cc: At global scope:
a.cc:23:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   23 | inline void add(register int x,register int y,register int z)
      |                              ^
a.cc:23:45: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   23 | inline void add(register int x,register int y,register int z)
      |                                             ^
a.cc:23:60: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   23 | inline void add(register int x,register int y,register int z)
      |                                                            ^
a.cc: In function 'void add(int, int, int)':
a.cc:27:9: error: reference to 'next' is ambiguous
   27 |         next[cnt]=h[x];
      |         ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
                 from /usr/include/c++/14/tr1/unordered_map:37,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:11:54: note:                 'int next [200001]'
   11 | int n,m,d[100001],h[100001],ver[200001],edge[200001],next[200001],cnt,x,y,z,F,s=0,sum[100001],N;
      |                                                      ^~~~
a.cc: In function 'void dijkstra()':
a.cc:33:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   33 |         for(register int i=1;i<=n+1;i++)d[i]=INF;
      |                          ^
a.cc:37:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   37 |                 register int x=q.top().second;q.pop();
      |                              ^
a.cc:40:34: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   40 |                 for(register int i=h[x];i;i=next[i])
      |                                  ^
a.cc:40:45: error: reference to 'next' is ambiguous
   40 |                 for(register int i=h[x];i;i=next[i])
      |                                             ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:11:54: note:                 'int next [200001]'
   11 | int n,m,d[100001],h[100001],ver[200001],edge[200001],next[200001],cnt,x,y,z,F,s=0,sum[100001],N;
      |                                                      ^~~~
a.cc:42:38: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   42 |                         register int y=ver[i];
      |                                      ^