Language: C++

#include <bits/stdc++.h>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fr first
#define sc second
#define ll  long long
#define mp make_pair
#define mod 1000000007

using namespace std;
int n,m,st,en;
vector<pll>p[100100];

ll dp[2][100100];
ll dist[2][100100];

void dik(int in){
    priority_queue<pll,vector<pll> ,greater<pll> >q;
    for(int i=0 ;i<=n ;i ++)
        dist[in][i] = 1e17;
    dist[in][st] = 0;
    dp[in][st] = 1;
    q.push(mp(0,st));
    while(!q.empty()){
        pll t = q.top();
        q.pop();
        if(dist[in][t.sc] < t.fr)continue;
        for(int i=0 ;i<p[t.sc].size() ; i++){
            int u = p[t.sc][i].fr;
            ll d = p[t.sc][i].sc;
            if(dist[in][u] > t.fr+d){
                dist[in][u] = t.fr+d;
                dp[in][u] = dp[in][t.sc];
                q.push(mp(dist[in][u],u));
            }
            else if(dist[in][u] == t.fr+d){
                dp[in][u] += dp[in][t.sc];
                dp[in][u] %= mod;
            }
        }
    }
}
int x1[100100];
int y1[100100];
ll d1[100100];

bool vis[100100];
ll z[100100];
int main()  {
    ll x,y,d;
    cin>>n>>m>>st>>en;
    for(int i=0 ;i <m ;i ++){
        scanf("%lld%lld%lld",&x,&y,&d);
        x1[i] = x;
        y1[i] = y;
        d1[i] = d;
        p[x].push_back(mp(y,d));
        p[y].push_back(mp(x,d));
    }

    dik(0);
    ll res = dp[0][en]*dp[0][en];

    res %= mod;
    swap(st,en);
    dik(1);
    swap(st,en);


    for(int i=1 ;i <=n ;i ++){
        if(dist[0][i] != dist[1][i])continue;
        if(dist[0][i] + dist[1][i] != dist[0][en])continue;
        vis[i] = 1;
        ll r = dp[0][i]*dp[1][i];
        r %= mod;
        res -= r;
        res %= mod;
        res += mod;
        res %= mod;
    }
    priority_queue<pll,vector<pll> ,greater<pll> >q;
    q.push(mp(dist[0][st],st));
    while(!q.empty()){
        int t = q.top().sc;
        q.pop();
        for(int i=0 ;i <p[t].size() ; i++){
            x= p[t][i].fr;
            d = p[t][i].sc;
            if(dist[0][t] + dist[1][x]+d != dist[0][en])continue;
            if(dist[0][t] +d < dist[1][x] && !vis[x]){
                z[x] -= z[t];
                q.push(mp(dist[0][x],x));
            }
            else if(!vis[x]){
                ll r= (dp[0][t]-z[t])*dp[1][x];
                z[x] -= dp[0][t];
                r %= mod;
                res -= r;
                res %= mod;
                res += mod;
                res %= mod;
            }
        }
    }

    cout<<res<<endl;
    return 0;
}


Compiler output:
a.cc:44:14: error: 'int y1 [100100]' redeclared as different kind of entity
   44 | int y1[100100];
      |              ^
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
  257 | __MATHCALL (y1,, (_Mdouble_));
      | ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:55:13: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   55 |         y1[i] = y;
      |             ^
a.cc:55:15: error: assignment of read-only location '*(y1 + ((sizetype)i))'
   55 |         y1[i] = y;
      |         ~~~~~~^~~