Language: C++

#include<bits/stdc++.h>
using namespace std;

#define INF 10000000

int main(){

    int n, m; cin >> n >> m;
    vector<vector<int> > dist(n, vector<int> (n, INF));
    for(int i = 0; i < n; i++) dist[i][i] = 0;
    vector<int> a(m);
    vector<int> b(m);
    vector<int> c(m);

    for(int i = 0; i < m; i++){
        cin >> a[i] >> b[i] >> c[i];
        a[i]--;
        b[i]--;
        c[i];
    
        dist[a[i]][b[i]] = dist[b[i]][a[i]] = c[i];
    }


    //わー
    for(int k = 0; k < n; k++){
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
            }
        }
    }


    int ans = 0;
    for(int i = 0; i < m; i++){
        if(dist[a[i]][b[i]] == c[i]) ans++;
    }

    cout << m - ans << endl;
    return 0;
}#include<bits/stdc++.h>
using namespace std;

#define INF 10000000

int main(){

    int n, m; cin >> n >> m;
    vector<vector<int> > dist(n, vector<int> (n, INF));
    for(int i = 0; i < n; i++) dist[i][i] = 0;
    vector<int> a(m);
    vector<int> b(m);
    vector<int> c(m);

    for(int i = 0; i < m; i++){
        cin >> a[i] >> b[i] >> c[i];
        a[i]--;
        b[i]--;
        c[i];
    
        dist[a[i]][b[i]] = dist[b[i]][a[i]] = c[i];
    }


    //わー
    for(int k = 0; k < n; k++){
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
            }
        }
    }


    int ans = 0;
    for(int i = 0; i < m; i++){
        if(dist[a[i]][b[i]] == c[i]) ans++;
    }

    cout << m - ans << endl;
    return 0;
}

Compiler output:
a.cc:42:2: error: stray '#' in program
   42 | }#include<bits/stdc++.h>
      |  ^
a.cc: In function 'int main()':
a.cc:19:12: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   19 |         c[i];
      |            ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: declared here
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
a.cc: At global scope:
a.cc:42:3: error: 'include' does not name a type
   42 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:47:5: error: redefinition of 'int main()'
   47 | int main(){
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main(){
      |     ^~~~
a.cc: In function 'int main()':
a.cc:60:12: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   60 |         c[i];
      |            ^
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: declared here
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~