Language: C++

#include<bits/stdc++.h>
#define x first
#define y second
#define ll long long
#define pii pair<int, int>
#define maxn 1005
#define INF 0x7FFFFFFF
#define dbg(n) cout << n << endl
#define mod 1000000007
using namespace std;

inline void read(int &x){
	int f = 1; x = 0; char s = getchar();
    while(s > '9' || s < '0'){
		if(s == '-') f = -1;
		s = getchar();
	}
    while(s <= '9' && s >= '0'){
		x = x * 10 + s - '0';
		s = getchar();
	}
    x = x * f;
}

struct E{
	int f, t, c;
	E(int f, int t, int c) : f(f), t(t), c(c){
	};
};

int G1[1005];
vector<int> GG1[1005];

int main(){
	int n, m, f, t, c;
	read(n), read(m);
	for(int i = 0; i <= n; ++i)
		for(int j = 0; j <= n; ++j)
			G1[i][j] = INF;
	for(int i = 0; i < m; ++i){
		read(f); read(t); read(c);
		G1[f][t] = c;
		GG1[f].push_back(E(f, t, c));
	}
	for(int i = 0; i <= n; ++i)
		for(int j = 0; j <= n; ++j)
			for(int k = 0; k <= n; ++k)
				G1[i][j] = min(G1[i][j], G1[i][k] + G1[k][j]);
	int ans = 0;
	for(int i = 0; i <= n; ++i)
		for(int j = 0; j < GG[i].size(); ++j)
			if(GG1[i][j].c > G1[i][GG1[i][j].t]) ans++;
	cout << ans << endl;
		
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:30: error: invalid types 'int[int]' for array subscript
   39 |                         G1[i][j] = INF;
      |                              ^
a.cc:42:22: error: invalid types 'int[int]' for array subscript
   42 |                 G1[f][t] = c;
      |                      ^
a.cc:43:33: error: no matching function for call to 'std::vector<int>::push_back(E)'
   43 |                 GG1[f].push_back(E(f, t, c));
      |                 ~~~~~~~~~~~~~~~~^~~~~~~~~~~~
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:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'E' to 'const std::vector<int>::value_type&' {aka 'const int&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'E' to 'std::vector<int>::value_type&&' {aka 'int&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:48:38: error: invalid types 'int[int]' for array subscript
   48 |                                 G1[i][j] = min(G1[i][j], G1[i][k] + G1[k][j]);
      |                                      ^
a.cc:48:53: error: invalid types 'int[int]' for array subscript
   48 |                                 G1[i][j] = min(G1[i][j], G1[i][k] + G1[k][j]);
      |                                                     ^
a.cc:48:63: error: invalid types 'int[int]' for array subscript
   48 |                                 G1[i][j] = min(G1[i][j], G1[i][k] + G1[k][j]);
      |                                                               ^
a.cc:48:74: error: invalid types 'int[int]' for array subscript
   48 |                                 G1[i][j] = min(G1[i][j], G1[i][k] + G1[k][j]);
      |                                                                          ^
a.cc:51:36: error: 'GG' was not declared in this scope; did you mean 'GG1'?
   51 |                 for(int j = 0; j < GG[i].size(); ++j)
      |                                    ^~
      |                                    GG1
a.cc:52:38: error: request for member 'c' in 'GG1[i].std::vector<int>::operator[](((std::vector<int>::size_type)j))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   52 |                         if(GG1[i][j].c > G1[i][GG1[i][j].t]) ans++;
      |                                      ^
a.cc:52:58: error: request for member 't' in 'GG1[i].std::vector<int>::operator[](((std::vector<int>::size_type)j))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   52 |                         if(GG1[i][j].c > G1[i][GG1[i][j].t]) ans++;
      |                                                          ^