Language: C++

#pragma GCC optimize(3)
#include<tr1/unordered_map>
#include<bits/stdc++.h>
#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:12:1: error: reference to 'unordered_map' is ambiguous
   12 | unordered_map<pair<int,int>,int> mn;
      | ^~~~~~~~~~~~~
In file included from /usr/include/c++/14/tr1/unordered_map:44,
                 from a.cc:2:
/usr/include/c++/14/tr1/unordered_map.h:180:11: note: candidates are: 'template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> class std::tr1::unordered_map'
  180 |     class unordered_map
      |           ^~~~~~~~~~~~~
In file included from /usr/include/c++/14/unordered_map:41,
                 from /usr/include/c++/14/functional:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:3:
/usr/include/c++/14/bits/unordered_map.h:109:11: note:                 'template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> class std::unordered_map'
  109 |     class unordered_map
      |           ^~~~~~~~~~~~~
a.cc:16:32: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   16 | inline void read(register int &in)
      |                                ^~
a.cc: In function 'void read(int&)':
a.cc:19:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   19 |     register short fh=1;
      |                    ^~
a.cc:20:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   20 |     register char C=getchar();
      |                   ^
a.cc: At global scope:
a.cc:25:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   25 | inline void add(register int x,register int y,register int z)
      |                              ^
a.cc:25:45: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   25 | inline void add(register int x,register int y,register int z)
      |                                             ^
a.cc:25:60: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   25 | inline void add(register int x,register int y,register int z)
      |                                                            ^
a.cc: In function 'void add(int, int, int)':
a.cc:29:9: error: reference to 'next' is ambiguous
   29 |         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:
/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:13:54: note:                 'int next [200001]'
   13 | 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:31:9: error: 'mn' was not declared in this scope; did you mean 'yn'?
   31 |         mn[make_pair(x,y)]=cnt;
      |         ^~
      |         yn
a.cc: In function 'void dijkstra()':
a.cc:35:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   35 |         for(register int i=1;i<=n+1;i++)d[i]=INF;
      |                          ^
a.cc:39:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   39 |                 register int x=q.top().second;q.pop();
      |                              ^
a.cc:42:34: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   42 |                 for(register int i=h[x];i;i=next[i])
      |                                  ^
a.cc:42:45: error: reference to 'next' is ambiguous
   42 |                 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:13:54: note:                 'int next [200001]'
   13 | 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:44:38: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   44 |                         register int y=ver[i];
      |                                      ^
a.cc: In function 'int main()':
a.cc:62:20: error: 'mn' was not declared in this scope; did you mean 'yn'?
   62 |                 if(mn[make_pair(x,y)])edge[mn[make_pair(x,y)]]=min(edge[mn[make_pair(x,y)]],z);
      |                    ^~
      |                    yn