Language: C++

/*Aonyx Cinerea*/
#include <bits/stdc++.h>
using namespace std;
typedef long long LL'
typedef pair<LL, LL> Pair;
const LL MAXN = 100000 + 17;
const LL MOD = 1e9 + 7;

LL n, m, S, T, d1[MAXN], d2[MAXN], dp1[MAXN], dp2[MAXN];
vector<Pair> Adj[MAXN];

void SPFA(LL s, LL dis[], LL dp[])
{
    static bool vis[MAXN];   memset(vis, 0, sizeof(vis));
    queue<LL> Q;
    memset(dis, -1, sizeof(LL)*100000);
    Q.push(s);  vis[s] = 1;  dp[s] = 1;   dis[s] = 0;
    while(!Q.empty())
    {
        LL u = Q.front();  Q.pop();    vis[u] = 0;
        for(const Pair& e: Adj[u])
        {
            LL v = e.first, w = e.second;
            if(dis[v]==-1 || dis[v] > dis[u] + w)
            {
                dis[v] = dis[u] + w;
                dp[v] = dp[u];
                if(!vis[v])
                    {vis[v] = 1;  Q.push(v);}
            }
            else if(dis[v] == dis[u] + w)
                (dp[v] += dp[u]) %= MOD;
        }
    }
}

int main()
{
    ios::sync_with_stdio(false);    cin.tie(0);

    cin >> n >> m >> S >> T;
    for(LL i=1; i<=m; ++i)
    {
        LL u, v, w;    cin >> u >> v >> w;
        Adj[u].emplace_back(v, w);
        Adj[v].emplace_back(u, w);
    }

    SPFA(S, d1, dp1);   SPFA(T, d2, dp2);
    LL ans = dp1[T] * dp1[T] % MOD;
    for(LL i=1; i<=n; ++i)
        if(d1[i] == d2[i] && d1[i]*2 == d1[T])
            (ans -= (dp1[i] * dp1[i] % MOD) * (dp2[i] * dp2[i] % MOD));

    for(LL i=1; i<=n; ++i)
        for(const Pair& e: Adj[i])
        {
            LL v = e.first, w = e.second;
            if(d1[i]*2 < d1[T] && d2[v]*2 < d1[T] && d1[i] + w + d2[v] == d1[T])
                (ans -= (dp1[i] * dp1[i] % MOD) * (dp2[v] * dp2[v] % MOD)) %= MOD;
        }

    cout << (ans + MOD) % MOD;
}


Compiler output:
a.cc:4:21: warning: missing terminating ' character
    4 | typedef long long LL'
      |                     ^
a.cc:4:21: error: missing terminating ' character
a.cc:5:1: error: expected initializer before 'typedef'
    5 | typedef pair<LL, LL> Pair;
      | ^~~~~~~
a.cc:6:7: error: 'LL' does not name a type
    6 | const LL MAXN = 100000 + 17;
      |       ^~
a.cc:7:7: error: 'LL' does not name a type
    7 | const LL MOD = 1e9 + 7;
      |       ^~
a.cc:9:1: error: 'LL' does not name a type
    9 | LL n, m, S, T, d1[MAXN], d2[MAXN], dp1[MAXN], dp2[MAXN];
      | ^~
a.cc:10:8: error: 'Pair' was not declared in this scope
   10 | vector<Pair> Adj[MAXN];
      |        ^~~~
a.cc:10:12: error: template argument 1 is invalid
   10 | vector<Pair> Adj[MAXN];
      |            ^
a.cc:10:12: error: template argument 2 is invalid
a.cc:10:18: error: 'MAXN' was not declared in this scope
   10 | vector<Pair> Adj[MAXN];
      |                  ^~~~
a.cc:12:6: error: variable or field 'SPFA' declared void
   12 | void SPFA(LL s, LL dis[], LL dp[])
      |      ^~~~
a.cc:12:11: error: 'LL' was not declared in this scope
   12 | void SPFA(LL s, LL dis[], LL dp[])
      |           ^~
a.cc:12:17: error: 'LL' was not declared in this scope
   12 | void SPFA(LL s, LL dis[], LL dp[])
      |                 ^~
a.cc:12:27: error: 'LL' was not declared in this scope
   12 | void SPFA(LL s, LL dis[], LL dp[])
      |                           ^~
a.cc: In function 'int main()':
a.cc:41:12: error: 'n' was not declared in this scope; did you mean 'yn'?
   41 |     cin >> n >> m >> S >> T;
      |            ^
      |            yn
a.cc:41:17: error: 'm' was not declared in this scope; did you mean 'tm'?
   41 |     cin >> n >> m >> S >> T;
      |                 ^
      |                 tm
a.cc:41:22: error: 'S' was not declared in this scope
   41 |     cin >> n >> m >> S >> T;
      |                      ^
a.cc:41:27: error: 'T' was not declared in this scope
   41 |     cin >> n >> m >> S >> T;
      |                           ^
a.cc:42:9: error: 'LL' was not declared in this scope
   42 |     for(LL i=1; i<=m; ++i)
      |         ^~
a.cc:42:17: error: 'i' was not declared in this scope
   42 |     for(LL i=1; i<=m; ++i)
      |                 ^
a.cc:44:11: error: expected ';' before 'u'
   44 |         LL u, v, w;    cin >> u >> v >> w;
      |           ^~
      |           ;
a.cc:44:31: error: 'u' was not declared in this scope
   44 |         LL u, v, w;    cin >> u >> v >> w;
      |                               ^
a.cc:44:36: error: 'v' was not declared in this scope
   44 |         LL u, v, w;    cin >> u >> v >> w;
      |                                    ^
a.cc:44:41: error: 'w' was not declared in this scope
   44 |         LL u, v, w;    cin >> u >> v >> w;
      |                                         ^
a.cc:45:9: error: 'Adj' was not declared in this scope
   45 |         Adj[u].emplace_back(v, w);
      |         ^~~
a.cc:49:13: error: 'd1' was not declared in this scope; did you mean 'y1'?
   49 |     SPFA(S, d1, dp1);   SPFA(T, d2, dp2);
      |             ^~
      |             y1
a.cc:49:17: error: 'dp1' was not declared in this scope
   49 |     SPFA(S, d1, dp1);   SPFA(T, d2, dp2);
      |                 ^~~
a.cc:49:5: error: 'SPFA' was not declared in this scope
   49 |     SPFA(S, d1, dp1);   SPFA(T, d2, dp2);
      |     ^~~~
a.cc:49:33: error: 'd2' was not declared in this scope
   49 |     SPFA(S, d1, dp1);   SPFA(T, d2, dp2);
      |                                 ^~
a.cc:49:37: error: 'dp2' was not declared in this scope; did you mean 'dup2'?
   49 |     SPFA(S, d1, dp1);   SPFA(T, d2, dp2);
      |                                     ^~~
      |                                     dup2
a.cc:50:5: error: 'LL' was not declared in this scope
   50 |     LL ans = dp1[T] * dp1[T] % MOD;
      |     ^~
a.cc:51:11: error: expected ';' before 'i'
   51 |     for(LL i=1; i<=n; ++i)
      |           ^~
      |           ;
a.cc:51:17: error: 'i' was not declared in this scope
   51 |     for(LL i=1; i<=n; ++i)
      |                 ^
a.cc:53:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   53 |             (ans -= (dp1[i] * dp1[i] % MOD) * (dp2[i] * dp2[i] % MOD));
      |              ^~~
      |              abs
a.cc:53:40: error: 'MOD' was not declared in this scope
   53 |             (ans -= (dp1[i] * dp1[i] % MOD) * (dp2[i] * dp2[i] % MOD));
      |                                        ^~~
a.cc:55:11: error: expected ';' before 'i'
   55 |     for(LL i=1; i<=n; ++i)
      |           ^~
      |           ;
a.cc:55:17: error: 'i' was not declared in this scope
   55 |     for(LL i=1; i<=n; ++i)
      |                 ^
a.cc:56:19: error: 'Pair' does not name a type
   56 |         for(const Pair& e: Adj[i])
      |                   ^~~~
a.cc:61:10: error: expected ';' before 'cout'
   61 |         }
      |          ^
      |          ;
   62 | 
   63 |     cout << (ans + MOD) % MOD;
      |     ~~~~  
a.cc:63:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   63 |     cout << (ans + MOD) % MOD;
      |              ^~~
      |              abs
a.cc:63:20: error: 'MOD' was not declared in this scope
   63 |     cout << (ans + MOD) % MOD;
      |                    ^~~
a.cc:64:1: error: expected primary-expression before '}' token
   64 | }
      | ^
a.cc:63:31: error: expected ')' before '}' token
   63 |     cout << (ans + MOD) % MOD;
      |                               ^
      |                               )
   64 | }
      | ~                              
a.cc:56:12: note: to match this '('
   56 |         for(const Pair& e: Adj[i])
      |            ^
a.cc:64:1: error: expected primary-expression before '}' token
   64 | }
      | ^