Language: C++

#include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<deque>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define ll __int64
//#define __int64 long long
#define P pair<ll,ll>
string s;

int n,m;
vector<P>G[1000];
bool ok[100][100];
int dist[100];
const int INF=100000000;

void daiku(int from,int to){
	priority_queue<P,vector<P>,greater<P>()>bfs;
	bfs.push(mp(0,from));
	rep(i,n)dist[i]=INF;

	while(!bfs.empty()){
		P t=bfs.top();
		bfs.pop();
		int next=t.second,cost=t.first;
		if(dist[next]!=INF)continue;
		dist[next]=cost;
		rep(i,G[next].size()){
			bfs.push(mp(cost+G[next][i].second,G[next][i].first));
		}
	}
	//cout<<from<<" "<<to<<" "<<dist[to]<<endl;
	int now=to;

	rep(co,n){
		if(now==from)break;
		rep(i,G[now].size()){
			int next=G[now][i].first,cost=G[now][i].second;
			if(dist[next]+cost==dist[now]){
				ok[now][next]=ok[next][now]=1;
				//cout<<now<<" "<<next<<endl;
				now=next;

			}
		}
	}
	//cout<<"B"<<endl;
}

int main(){
	cin>>n>>m;	
	int a,b,c;
	rep(i,m){
		cin>>a>>b>>c;
		a--;b--;
		G[a].pb(mp(b,c));
		G[b].pb(mp(a,c));
	}
	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			daiku(i,j);
		}
	}
	int ans=0;
	rep(i,n){
		rep(j,G[i].size())if(!ok[i][G[i][j].first])ans++;
	}
	if(ans>0)ans/=2;
	cout<<ans<<endl;
}

Compiler output:
a.cc:16:12: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   16 | #define ll __int64
      |            ^~~~~~~
a.cc:18:16: note: in expansion of macro 'll'
   18 | #define P pair<ll,ll>
      |                ^~
a.cc:22:8: note: in expansion of macro 'P'
   22 | vector<P>G[1000];
      |        ^
a.cc:16:12: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   16 | #define ll __int64
      |            ^~~~~~~
a.cc:18:19: note: in expansion of macro 'll'
   18 | #define P pair<ll,ll>
      |                   ^~
a.cc:22:8: note: in expansion of macro 'P'
   22 | vector<P>G[1000];
      |        ^
a.cc:18:21: error: template argument 1 is invalid
   18 | #define P pair<ll,ll>
      |                     ^
a.cc:22:8: note: in expansion of macro 'P'
   22 | vector<P>G[1000];
      |        ^
a.cc:18:21: error: template argument 2 is invalid
   18 | #define P pair<ll,ll>
      |                     ^
a.cc:22:8: note: in expansion of macro 'P'
   22 | vector<P>G[1000];
      |        ^
a.cc:22:9: error: template argument 1 is invalid
   22 | vector<P>G[1000];
      |         ^
a.cc:22:9: error: template argument 2 is invalid
a.cc: In function 'void daiku(int, int)':
a.cc:16:12: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   16 | #define ll __int64
      |            ^~~~~~~
a.cc:18:16: note: in expansion of macro 'll'
   18 | #define P pair<ll,ll>
      |                ^~
a.cc:28:24: note: in expansion of macro 'P'
   28 |         priority_queue<P,vector<P>,greater<P>()>bfs;
      |                        ^
a.cc:18:21: error: template argument 1 is invalid
   18 | #define P pair<ll,ll>
      |                     ^
a.cc:28:24: note: in expansion of macro 'P'
   28 |         priority_queue<P,vector<P>,greater<P>()>bfs;
      |                        ^
a.cc:28:34: error: template argument 1 is invalid
   28 |         priority_queue<P,vector<P>,greater<P>()>bfs;
      |                                  ^
a.cc:28:34: error: template argument 2 is invalid
a.cc:28:45: error: template argument 1 is invalid
   28 |         priority_queue<P,vector<P>,greater<P>()>bfs;
      |                                             ^
a.cc:28:48: error: template argument 1 is invalid
   28 |         priority_queue<P,vector<P>,greater<P>()>bfs;
      |                                                ^
a.cc:28:48: error: template argument 2 is invalid
a.cc:28:48: error: template argument 3 is invalid
a.cc:29:13: error: request for member 'push' in 'bfs', which is of non-class type 'int'
   29 |         bfs.push(mp(0,from));
      |             ^~~~
a.cc:32:20: error: request for member 'empty' in 'bfs', which is of non-class type 'int'
   32 |         while(!bfs.empty()){
      |                    ^~~~~
a.cc:33:25: error: request for member 'top' in 'bfs', which is of non-class type 'int'
   33 |                 P t=bfs.top();
      |                         ^~~
a.cc:34:21: error: request for member 'pop' in 'bfs', which is of non-class type 'int'
   34 |                 bfs.pop();
      |                     ^~~
a.cc:35:28: error: request for member 'second' in 't', which is of non-class type 'int'
   35 |                 int next=t.second,cost=t.first;
      |                            ^~~~~~
a.cc:37:28: error: 'cost' was not declared in this scope; did you mean 'const'?
   37 |                 dist[next]=cost;
      |                            ^~~~
      |                            const
a.cc:38:31: error: request for member 'size' in 'G[next]', which is of non-class type 'int'
   38 |                 rep(i,G[next].size()){
      |                               ^~~~
a.cc:13:32: note: in definition of macro 'rep'
   13 | #define rep(i,a) for(int i=0;i<a;i++)
      |                                ^
a.cc:39:29: error: request for member 'push' in 'bfs', which is of non-class type 'int'
   39 |                         bfs.push(mp(cost+G[next][i].second,G[next][i].first));
      |                             ^~~~
a.cc:39:49: error: invalid types 'int[int]' for array subscript
   39 |                         bfs.push(mp(cost+G[next][i].second,G[next][i].first));
      |                                                 ^
a.cc:39:67: error: invalid types 'int[int]' for array subscript
   39 |                         bfs.push(mp(cost+G[next][i].second,G[next][i].first));
      |                                                                   ^
a.cc:47:30: error: request for member 'size' in 'G[now]', which is of non-class type 'int'
   47 |                 rep(i,G[now].size()){
      |                              ^~~~
a.cc:13:32: note: in definition of macro 'rep'
   13 | #define rep(i,a) for(int i=0;i<a;i++)
      |                                ^
a.cc:48:40: error: invalid types 'int[int]' for array subscript
   48 |                         int next=G[now][i].first,cost=G[now][i].second;
      |                                        ^
a.cc:49:39: error: 'cost' was not declared in this scope; did you mean 'const'?
   49 |                         if(dist[next]+cost==dist[now]){
      |                                       ^~~~
      |                                       const
a.cc: In function 'int main()':
a.cc:15:12: error: request for member 'push_back' in 'G[a]', which is of non-class type 'int'
   15 | #define pb push_back
      |            ^~~~~~~~~
a.cc:66:22: note: in expansion of macro 'pb'
   66 |                 G[a].pb(mp(b,c));
      |                      ^~
a.cc:15:12: error: request for member 'push_back' in 'G[b]', which is of non-class type 'int'
   15 | #define pb push_back
      |            ^~~~~~~~~
a.cc:67:22: note: in expansion of macro 'pb'
   67 |                 G[b].pb(mp(a,c));
      |                      ^~
a.cc:76:28: error: request for member 'size' in 'G[i]', which is of non-class type 'int'
   76 |                 rep(j,G[i].size())if(!ok[i][G[i][j].first])ans++;
      |                            ^~~~
a.cc:13:32: note: in definition of macro 'rep'
   13 | #define rep(i,a) for(int i=0;i<a;i++)
      |                                ^
a.cc:76:49: error: invalid types 'int[int]' for array subscript
   76 |                 rep(j,G[i].size())if(!ok[i][G[i][j].first])ans++;
      |                                                 ^