criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <iomanip>
#define ALL(x) (x).begin(), (x).end()
#define dll(x) scanf("%I64d",&x)
#define xll(x) printf("%I64d\n",x)
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define rep(i,x,n) for(int i=x;i<n;i++)
#define repd(i,x,n) for(int i=x;i<=n;i++)
#define pii pair<int,int>
#define pll pair<long long ,long long>
#define gbtb ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MSC0(X) memset((X), '\0', sizeof((X)))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define eps 1e-6
#define gg(x) getInt(&x)
#define db(x) cout<<"== [ "<<x<<" ] =="<<endl;
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll powmod(ll a,ll b,ll MOD){ll ans=1ll;while(b){if(b&1)ans=ans*a%MOD;a=a*a%MOD;b>>=1;}return ans;}
inline void getInt(int* p);
const int maxn=1000010;
const int inf=100000000;
/*** TEMPLATE CODE * * STARTS HERE ***/
int d[500][500];
int n,m;
int a[500];
int b[500];
int c[500];
int main()
{
	//    freopen("C:\\Users\\DH_M\\Desktop\\code_io\\in.txt.txt","r",stdin);
	//    freopen("C:\\Users\\DH_M\\Desktop\\code_io\\out.txt.txt","w",stdout);
	gbtb;
	cin>>n>>m;
	repd(i,1,m)
	{
		cin>>a[i]>>b[i]>>c[i];
	}
	repd(i,1,n)
	{
		repd(j,1,n)
		{
			d[i][j] = d[j][i] = i==j?0:inf;
		}
	}
	repd(i,1,m)
	{
		dist[a[i]][b[i]]=min(dist[a[i]][b[i]],c[i]);
        dist[b[i]][a[i]]=min(dist[b[i]][a[i]],c[i]);
	}
	repd(k,1,m)
	{
		repd(i,1,n)
		{
			repd(j,1,n)
			{
				d[i][j]=d[j][i]=min(d[j][i],d[i][a[k]]+d[b[k]][j]+c[k]);
			}
		}
	}
	int ans=0;
	repd(k,1,m)
	{
		if(d[a[k]][b[k]]<c[k])
		{
			ans++;
		}
	}
	cout<<ans<<endl;

	
	
    return 0;
}

inline void getInt(int* p) {char ch;do {ch = getchar();} 
while (ch == ' ' || ch == '\n');if (ch == '-') {*p = -(getchar() - '0');
while ((ch = getchar()) >= '0' && ch <= '9') {*p = *p * 10 - ch + '0';}}
else {*p = ch - '0';while ((ch = getchar()) >= '0' && ch <= '9') 
{*p = *p * 10 + ch - '0';}}}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:17: error: 'dist' was not declared in this scope
   64 |                 dist[a[i]][b[i]]=min(dist[a[i]][b[i]],c[i]);
      |                 ^~~~
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define PB push_back
#define MP make_pair
#define ALL(a)  (a).begin(),(a).end()
#define REP(i,n) for(int i=0;i<(n);i++)
int d[100][100];
int main(){
    int n,m;
    int a[1000],b[1000],c[1000];
    cin>>n>>m;
    REP(i,n)REP(j,n)d[i][j]=1e9;
    REP(i,n)d[i][j]=0;
    REP(i,m){
        cin>>a[i]>>b[i]>>c[i];
        a[i]--;b[i]--:
        d[a[i]][b[i]]=d[b[i]][a[i]]=c[i];
    }
    REP(k,n)
        REP(i,n)
            REP(j,n)
                d[i][j]=min(d[i][j],d[i][k]+d[k][j]);

    int cnt=0;
    REP(i,m)if(d[a[i]][b[i]]<c[i])cnt++;
    cout<<cnt<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: 'j' was not declared in this scope
   13 |     REP(i,n)d[i][j]=0;
      |                  ^
a.cc:16:22: error: expected ';' before ':' token
   16 |         a[i]--;b[i]--:
      |                      ^
      |                      ;
Language: C++

#include <iostream>
#include <vector>
#include <utility>
using namespace std;

int d[110][110] = {};
int n, m, inf = 1e9 + 7, a[1010], b[1010], c[1010], ans;
bool used[1010];

void warshall_floyd(int n)
{
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            for (int k = 0; k < n; k++)
            {
                d[j][k] = min(d[j][k], d[j][i] + d[i][k]);
            }
        }
    }
}

int main()
{
    cin >> n >> m;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            d[i][j] = (i == j ? 0 : inf);
        }
    }
    for (int i = 0; i < m; i++)
    {
        scanf("%d%d%d", % a[i], &b[i], &c[i]);
        a[i]--, b[i]--, d[a[i]][b[i]] = c[i], d[b[i]][a[i]] = c[i];
    }
    warshall_floyd(n);
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            if (i == j)
                continue;
            for (int k = 0; k < m; k++)
            {
                used[k] = used[k] || d[i][a[k]] + c[k] + d[b[k]][j] == d[i][j] || d[i][b[k]] + c[k] + d[a[k]][j] == d[i][j];
            }
        }
    }
    for (int i = 0; i < m; i++)
        ans += !used[i];
    printf("%d\n", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:25: error: expected primary-expression before '%' token
   36 |         scanf("%d%d%d", % a[i], &b[i], &c[i]);
      |                         ^
Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<ctime>
#include<cstdio>
#include<string>
//#include<string>
//#include<sstream>
using namespace std; 
const int MAX_V=10000+5;
const int INF=1<<30;
int pre[MAX_V];
int cost[MAX_V][MAX_V];//cost[u][v]表示边e=(u,v)的权值（不存在这条边时设为INF）
bool visited[MAX_V][MAX_V];
int d[MAX_V];//顶点s出发的最短距离
bool used[MAX_V];//已经使用过的图
int V,E;//顶点数，边数
//求从起点s出发到各个顶点的最短距离
void dijkstra(int s)
{
    fill(d+1,d+V+1,INF);
    fill(used+1,used+V+1,false);
    fill(pre+1,pre+V+1,-1);
    d[s]=0;
    while(true)
    {
        int v=-1;
        //从尚未使用过的顶点中选择一个距离最小的顶点
        for(int u=1; u<=V; u++)
        {
            if(!used[u]&&(v==-1||d[u]<d[v]))
                v=u;
        }
        if(v==-1)
            break;
        used[v]=true;
        for(int u=1; u<=V; u++)
        {
            if(d[u]>d[v]+cost[v][u])
            {
                d[u]=d[v]+cost[v][u];
                pre[u]=v;
            }
        }
    }
}
vector<int> get_path(int t)
{
    vector<int>path;
    for(; t!=-1; t=pre[t])
        path.push_back(t);
    reverse(path.begin(),path.end());
    return path;
}
int main()
{
    scanf("%d%d",&V,&E);
    int a,b,c;
    for(int i=1;i<=V;i++)
    {
        for(int j=1;j<=V;j++)
            cost[i][j]=INF;
    }
    for(int i=0;i<E;i++)
    {
        scanf("%d%d%d",&a,&b,&c);
        cost[a][b]=cost[b][a]=c;
    }
    memset(visited,false,sizeof(visited));
    int ans=E;
    for(int i=1;i<=V;i++)
    {
        dijkstra(i);
        for(int j=1;j<=V;j++)
        {
            if(i==j)
                continue;
            vector<int>v=get_path(j);
            for(int i=0;i<v.size()-1;i++)
            {
                int a=v[i];
                int b=v[i+1];
                if(!visited[v[i]][v[i+1]]&&!visited[v[i+1]][v[i]])
                {
                    visited[v[i]][v[i+1]]=visited[v[i+1]][v[i]]=true;
                    ans--;
                }
            }
        }
    }
    printf("%d\n",ans);
    return 0;
}


Compiler output:
a.cc:49:1: error: 'vector' does not name a type
   49 | vector<int> get_path(int t)
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:80:13: error: 'vector' was not declared in this scope
   80 |             vector<int>v=get_path(j);
      |             ^~~~~~
a.cc:8:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    7 | #include<cstdio>
  +++ |+#include <vector>
    8 | #include<string>
a.cc:80:20: error: expected primary-expression before 'int'
   80 |             vector<int>v=get_path(j);
      |                    ^~~
a.cc:81:27: error: 'v' was not declared in this scope
   81 |             for(int i=0;i<v.size()-1;i++)
      |                           ^
Language: C

//答え見たよ！！！
#include<stdio.h>
#define INFINITY 9999999

struct Neighborhood{
  int dist;//結ばれた2つのノードの距離
  int no;//辺の番号
};

int main(){
  int i, j;
  //入力
  int N, M;
  scanf("%d %d", &N, &M);
  int a[M+1], b[M+1], c[M+1];//a[0], b[0], c[0]は使わない
  for(i=1; i<=M; i++)
    scanf("%d %d %d", &a[i], &b[i], &c[i]);
  //入力ここまで
  int dist[N+1][N+1];//最短距離
  //初期値の設定
  for(j=1; j<=N; j++){
    for(i=1; i<=N; i++){
      if(i=j){
        dist[i][j] = 0;
      }else{
        dist[i][j] = INFINITY;
      }
    }
  }
  
  struct Neighborhood nbh[N+1][N+1];
  //頂点が直接結ばれているならばを距離と辺の番号を代入
  for(i=1; i<=M; i++){
    nbh[a[i]][b[i]].dist = c[i];
    nbh[b[i]][a[i]].dist = c[i];
    nbh[a[i]][b[i]].no = i;
    nbh[b[i]][a[i]].no = i;
  }
  
  //各頂点を始点とした最短経路をDijkstra法で求め、
  //それぞれの辺が最短経路に含まれるかをみる
  int s;//スタートとして使用
  int t;//暫定的な起点として使用
  int from[N+1];//点sを起点とする最短距離において、各頂点に対しどの辺から来たかを代入する
  int fix[N+1];//各頂点について値が確定したら1、そうでないなら0
  int temp_min;//最小値を記録
  int min_edge;//最小値をもつ頂点
  int cnt;//N-1回最短距離を確定させるためのカウンター
  int use[M+1];//各辺について最短経路として使われたら1
  for(s=1; s<N; s++){
    for(i=1; i<=N; i++)
      fix[i] = 0;
    fix[s] = 1;
    t = s;
    for(cnt=1; cnt<N; cnt++){
      //このときdist(s,t)は確定していることに注意
      //頂点tに隣り合っていてなおかつ確定していない場所をすべて探索する
      for(i=1; i<=N; i++){
        if(nbh[t][i] && !fix[i]){
          dist[s][i] = dist[s][t] + nbh[t][i];
          from[i] = nbh[t][i].no;
        }
      }
      //このとき未確定の頂点のうち距離が最小のものが確定する
      temp_min = 9999;
      for(i=1; i<=N; i++){
        if(!fix[i] && dist[s][i] < temp_min){
          temp_min = dist[s][i];
          min_edge = i;
        }
      }
      fix[min_edge] = 1;
      t = min_edge;
    }
    //頂点s始点のすべての最短距離が出たので使われた経路を記録する
    for(i=1; i<=N; i++)
      use[from[i]] = 1;
  }
  //すべての頂点を始点とした最短距離を探索し終わったので
  int ans = 0;//最短経路に含まれない辺の本数を数え上げる
  for(i=1; i<=M; i++){
    if(!use[i])
      ans++;
  }
  printf("%d\n", ans);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:59:12: error: used struct type value where scalar is required
   59 |         if(nbh[t][i] && !fix[i]){
      |            ^~~
main.c:60:35: error: invalid operands to binary + (have 'int' and 'struct Neighborhood')
   60 |           dist[s][i] = dist[s][t] + nbh[t][i];
      |                        ~~~~~~~~~~ ^ ~~~~~~~~~
      |                               |           |
      |                               int         struct Neighborhood
Language: C

//答え見たよ！！！
#include<stdio.h>
#define INFINITY 9999999

struct Neighborhood{
  int dist;//結ばれた2つのノードの距離
  int no;//辺の番号
};

int main(){
  int i, j;
  //入力
  int N, M;
  scanf("%d %d", &N, &M);
  int a[M+1], b[M+1], c[M+1];//a[0], b[0], c[0]は使わない
  for(i=1; i<=M; i++)
    scanf("%d %d %d", &a[i], &b[i], &c[i]);
  //入力ここまで
  int dist[N+1][N+1];//最短距離
  //初期値の設定
  for(j=1; j<=N; j++){
    for(i=1; i<=N; i++){
      if(i=j){
        dist[i][j] = 0;
      }else{
        dist[i][j] = INFINITY;
      }
    }
  }
  
  Neighborhood nbh[N+1][N+1];
  //頂点が直接結ばれているならばを距離と辺の番号を代入
  for(i=1; i<=M; i++){
    nbh[a[i]][b[i]].dist = c[i];
    nbh[b[i]][a[i]].dist = c[i];
    nbh[a[i]][b[i]].no = i;
    nbh[b[i]][a[i]].no = i;
  }
  
  //各頂点を始点とした最短経路をDijkstra法で求め、
  //それぞれの辺が最短経路に含まれるかをみる
  int s;//スタートとして使用
  int t;//暫定的な起点として使用
  int from[N+1];//点sを起点とする最短距離において、各頂点に対しどの辺から来たかを代入する
  int fix[N+1];//各頂点について値が確定したら1、そうでないなら0
  int temp_min;//最小値を記録
  int min_edge;//最小値をもつ頂点
  int cnt;//N-1回最短距離を確定させるためのカウンター
  int use[M+1];//各辺について最短経路として使われたら1
  for(s=1; s<N; s++){
    for(i=1; i<=N; i++)
      fix[i] = 0;
    fix[s] = 1;
    t = s;
    for(cnt=1; cnt<N; cnt++){
      //このときdist(s,t)は確定していることに注意
      //頂点tに隣り合っていてなおかつ確定していない場所をすべて探索する
      for(i=1; i<=N; i++){
        if(nbh[t][i] && !fix[i]){
          dist[s][i] = dist[s][t] + nbh[t][i];
          from[i] = nbh[t][i].no;
        }
      }
      //このとき未確定の頂点のうち距離が最小のものが確定する
      temp_min = 9999;
      for(i=1; i<=N; i++){
        if(!fix[i] && dist[s][i] < temp_min){
          temp_min = dist[s][i];
          min_edge = i;
        }
      }
      fix[min_edge] = 1;
      t = min_edge;
    }
    //頂点s始点のすべての最短距離が出たので使われた経路を記録する
    for(i=1; i<=N; i++)
      use[from[i]] = 1;
  }
  //すべての頂点を始点とした最短距離を探索し終わったので
  int ans = 0;//最短経路に含まれない辺の本数を数え上げる
  for(i=1; i<=M; i++){
    if(!use[i])
      ans++;
  }
  printf("%d\n", ans);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:31:3: error: unknown type name 'Neighborhood'; use 'struct' keyword to refer to the type
   31 |   Neighborhood nbh[N+1][N+1];
      |   ^~~~~~~~~~~~
      |   struct 
main.c:34:20: error: request for member 'dist' in something not a structure or union
   34 |     nbh[a[i]][b[i]].dist = c[i];
      |                    ^
main.c:35:20: error: request for member 'dist' in something not a structure or union
   35 |     nbh[b[i]][a[i]].dist = c[i];
      |                    ^
main.c:36:20: error: request for member 'no' in something not a structure or union
   36 |     nbh[a[i]][b[i]].no = i;
      |                    ^
main.c:37:20: error: request for member 'no' in something not a structure or union
   37 |     nbh[b[i]][a[i]].no = i;
      |                    ^
main.c:61:30: error: request for member 'no' in something not a structure or union
   61 |           from[i] = nbh[t][i].no;
      |                              ^
Language: C

//答え見たよ！！！
#include<stdio.h>
#define INFINITY 9999999

struct Neighborhood{
  int dist;//結ばれた2つのノードの距離
  int no;//辺の番号
}

int main(){
  int i, j;
  //入力
  int N, M;
  scanf("%d %d", &N, &M);
  int a[M+1], b[M+1], c[M+1];//a[0], b[0], c[0]は使わない
  for(i=1; i<=M; i++)
    scanf("%d %d %d", &a[i], &b[i], &c[i]);
  //入力ここまで
  int dist[N+1][N+1];//最短距離
  //初期値の設定
  for(j=1; j<=N; j++){
    for(i=1; i<=N; i++){
      if(i=j){
        dist[i][j] = 0;
      }else{
        dist[i][j] = INFINITY;
      }
    }
  }
  
  Neighborhood nbh[N+1][N+1];
  //頂点が直接結ばれているならばを距離と辺の番号を代入
  for(i=1; i<=M; i++){
    nbh[a[i]][b[i]].dist = c[i];
    nbh[b[i]][a[i]].dist = c[i];
    nbh[a[i]][b[i]].no = i;
    nbh[b[i]][a[i]].no = i;
  }
  
  //各頂点を始点とした最短経路をDijkstra法で求め、
  //それぞれの辺が最短経路に含まれるかをみる
  int s;//スタートとして使用
  int t;//暫定的な起点として使用
  int from[N+1];//点sを起点とする最短距離において、各頂点に対しどの辺から来たかを代入する
  int fix[N+1];//各頂点について値が確定したら1、そうでないなら0
  int temp_min;//最小値を記録
  int min_edge;//最小値をもつ頂点
  int cnt;//N-1回最短距離を確定させるためのカウンター
  int use[M+1];//各辺について最短経路として使われたら1
  for(s=1; s<N; s++){
    for(i=1; i<=N; i++)
      fix[i] = 0;
    fix[s] = 1;
    t = s;
    for(cnt=1; cnt<N; cnt++){
      //このときdist(s,t)は確定していることに注意
      //頂点tに隣り合っていてなおかつ確定していない場所をすべて探索する
      for(i=1; i<=N; i++){
        if(nbh[t][i] && !fix[i]){
          dist[s][i] = dist[s][t] + nbh[t][i];
          from[i] = nbh[t][i].no;
        }
      }
      //このとき未確定の頂点のうち距離が最小のものが確定する
      temp_min = 9999;
      for(i=1; i<=N; i++){
        if(!fix[i] && dist[s][i] < temp_min){
          temp_min = dist[s][i];
          min_edge = i;
        }
      }
      fix[min_edge] = 1;
      t = min_edge;
    }
    //頂点s始点のすべての最短距離が出たので使われた経路を記録する
    for(i=1; i<=N; i++)
      use[from[i]] = 1;
  }
  //すべての頂点を始点とした最短距離を探索し終わったので
  int ans = 0;//最短経路に含まれない辺の本数を数え上げる
  for(i=1; i<=M; i++){
    if(!use[i])
      ans++;
  }
  printf("%d\n", ans);
  return 0;
}


Compiler output:
main.c:10:1: error: expected ';', identifier or '(' before 'int'
   10 | int main(){
      | ^~~
main.c: In function 'main':
main.c:31:3: error: unknown type name 'Neighborhood'; use 'struct' keyword to refer to the type
   31 |   Neighborhood nbh[N+1][N+1];
      |   ^~~~~~~~~~~~
      |   struct 
main.c:34:20: error: request for member 'dist' in something not a structure or union
   34 |     nbh[a[i]][b[i]].dist = c[i];
      |                    ^
main.c:35:20: error: request for member 'dist' in something not a structure or union
   35 |     nbh[b[i]][a[i]].dist = c[i];
      |                    ^
main.c:36:20: error: request for member 'no' in something not a structure or union
   36 |     nbh[a[i]][b[i]].no = i;
      |                    ^
main.c:37:20: error: request for member 'no' in something not a structure or union
   37 |     nbh[b[i]][a[i]].no = i;
      |                    ^
main.c:61:30: error: request for member 'no' in something not a structure or union
   61 |           from[i] = nbh[t][i].no;
      |                              ^
Language: C

//答え見たよ！！！
#include<stdio.h>
#define INFINITY 9999999

int main(){
  int i, j;
  //入力
  int N, M;
  scanf("%d %d", &N, &M);
  int a[M+1], b[M+1], c[M+1];//a[0], b[0], c[0]は使わない
  for(i=1; i<=M; i++)
    scanf("%d %d %d", &a[i], &b[i], &c[i]);
  //入力ここまで
  int ans = M;//最短経路に含まれない辺の本数
  int dist[N+1][N+1];//最短距離
  int nbh[N+1][N+1];//隣接しているか?
  //初期値の設定
  for(j=1; j<=N; j++){
    for(i=1; i<=N; i++){
      if(i=j){
        dist[i][j] = 0;
      }else{
        dist[i][j] = INFINITY;
      }
    }
  }
  //隣接している場所へ距離を代入
  for(i=1; i<=M; i++){
    nbh[a[i]][b[i]] = c[i];
    nbh[b[i]][a[i]] = c[i];
  }
  
  int s;//スタートとして使用
  int t;//暫定的な起点として使用
  //各頂点を始点とした最短経路をDijkstra法で求め、
  //それぞれの辺が最短経路に含まれるかをみる
  for(s=1; s<N; s++){
    t = s;
    for(i=1; i<=M; i++){
      if(nbh[t][i])
        dist[s][i] = dist[s][t] + nbh[t][i];
      
      
    


Compiler output:
main.c: In function 'main':
main.c:41:9: error: expected declaration or statement at end of input
   41 |         dist[s][i] = dist[s][t] + nbh[t][i];
      |         ^~~~
main.c:41:9: error: expected declaration or statement at end of input
main.c:41:9: error: expected declaration or statement at end of input
Language: C++

//Warshall-Floyd

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main(void){
    int N, M;
    cin >> N >> M;
    vector<int> a(M), b(M);
    vector<long long> c(M);
    vector<vector<long long>> d(N, vector<long long>(N, LLONG_MAX / 2));
    vector<vector<vector<int>>> p(N, vector<vector<int>>(N, vector<int>(0)));
    for(int i = 0; i < M; i++){
        cin >> a[i];
        cin >> b[i];
        cin >> c[i];
        a[i]--;
        b[i]--;
        d[a[i]][b[i]] = c[i];
        d[b[i]][a[i]] = c[i];
        p[a[i]][b[i]].push_back(i);
        p[b[i]][a[i]].push_back(i);
    }
    
    for(int i = 0; i < N; i++){
        for(int j = 0; j < N; j++){
            for(int k = 0; k < N; k++){
                if(d[j][k] > d[j][i] + d[i][k]){
                    d[j][k] = d[k][j] = d[j][i] + d[i][k];

                    p[j][k].clear();
                    p[j][k].resize(p[j][i].size() + p[i][k].size());
                    p[j][k] = p[j][i];
                    for(auto itr = p[i][k].begin(); itr != p[i][k].end(); itr++) p[j][k].push_back(*itr);

                    p[k][j].clear();
                    p[k][j].resize(p[j][k].size());
                    for(auto itr = p[j][k].rbegin(); itr != p[j][k].rend(); itr++) p[k][j].push_back(*itr);
                }
            }
        }
    }

    vector<bool> check(M, false);
    for(int i = 0; i < N; i++){
        for(int j = 0; j < N; j++){
            // cout << i << " " << j << " " << d[i][j] << " ";
            for(auto itr = p[i][j].begin(); itr != p[i][j].end(); itr++){
                // cout <<  " " << *itr;
                check[*itr] = true;
            }
            // cout << endl;
        }
    }
    int ans = 0;
    for(auto itr = check.begin(); itr != check.end(); itr++) if(!*itr) ans++;
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:57: error: 'LLONG_MAX' was not declared in this scope
   14 |     vector<vector<long long>> d(N, vector<long long>(N, LLONG_MAX / 2));
      |                                                         ^~~~~~~~~
a.cc:6:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include<algorithm>
  +++ |+#include <climits>
    6 |
Language: C++

#include <stdio.h>
#include <algorithm>
#include <

int main()
{
	int n, m, distance[100][100]{}, edge[100][100]{};
	std::fill(distance[0], distance[0] + 10000, 1000000000);
	scanf("%d%d", &n, &m);
	for (int i = 0; i < m; i++)
	{
		int a, b, c;
		scanf("%d%d%d", &a, &b, &c);
		a--; b--;
		distance[a][b] = distance[b][a]
		= edge[a][b] = edge[b][a] = c;
	}
	for (int i = 0; i < n; i++)
		distance[i][i] = 0;

	for (int i = 0; i < n; i++)
		for (int j = i + 1; j < n; j++)
			for (int k = 0; k < n; k++)
			{
				distance[j][i] = distance[i][j]
				 = std::min(distance[i][j], distance[i][k] + distance[k][j]);
			}
	
	int count{};
	for(int i = 0; i < n; i++)
		for (int j = i + 1; j < n; j++)
			if (distance[i][j] < edge[i][j])
				count++;
	printf("%d\n", count);

	return 0;
}

Compiler output:
a.cc:3:11: error: missing terminating > character
    3 | #include <
      |           ^
a.cc:3:10: error: empty filename in #include
    3 | #include <
      |          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m;cin>>n>>m;
  int d[n+1][n+1];
  for(int i=0;i<=n;i++)for(int j=0;j<=n;j++)d[i][j]=-1;
  int s[n+1][n+1];
  int a[m],b[m],c[m];
  for(int i=0;i<m;i++){
    cin>>a[i]>>b[i]>>c[i];
    d[a[i]][b[i]]=c[i];
    d[b[i]][a[i]]=c[i];
  }
  for(int i=1;i<=n;i++){
    s[i][i]=0;
    bool used[n+1];
    for(int j=0;j<=n;j++)used[j]=false;
    for(;;){
      int v=-1;
      for(int j=1;j<=n;j++){
        if(used[i]==false||s[i][j]<s[i][v])v=j;
      }
      if(v==-1)break;
      used[v]=true;
      for(int j=1;j<=n;j++){
        if(d[v][j]>=0){
          s[i][j]=min(s[i][j],s[i][v]+d[v][j]);
        }
      }
    }
  }
  int ans=0;
  for(int i=0;i<m;i++){
    int f=a[i];
    int se=b[i];
    for(int j=1;j<=n;j++){
      if(s[f][j]+s[j][se]<c[i]){
        ans++;
        break;
      }
    }
    cout<<ans<<endl;
  }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:43:4: error: expected '}' at end of input
   43 |   }
      |    ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#define MAX 100000007
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;
typedef pair<ll, ll> P;
priority_queue<P, vector<P>, greater<P>> pque;

ll ans=0;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int N,M;
  int a[100]={0},b[100]={0},c[100]={0};
  int dist[1000][1000]=100000000;
  cin >> N >> M;
  for(int i=0;i<M;i++){
    cin >> a[i] >> b[i] >> c[i];
    a[i]--,b[i]--;
  }
  for(int i=0;i<N;i++){
    for(int j=0;j<N;j++){
      if(i==j){
        dist[i][j]=0;
      }else {
        dist[i][j]=100000000;
      }
    }
  }
  for(int i=0;i<M;i++){
    dist[a[i]][b[i]]=min(dist[a[i]][b[i]],c[i]);
    dist[b[i]][a[i]]=min(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=M;
  for(int i = 0; i < M; ++i){
    bool shortest=false;
    for(int j = 0; j < N; ++j) if(dist[j][a[i]]+c[i]==dist[j][b[i]]) shortest=true;
    if(shortest==true){
    ans=ans-1;
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:24: error: array must be initialized with a brace-enclosed initializer
   29 |   int dist[1000][1000]=100000000;
      |                        ^~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#define MAX 100000007
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;
typedef pair<ll, ll> P;
priority_queue<P, vector<P>, greater<P>> pque;

ll ans=0;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int N,M;
  int a[100]={0},b[100]={0},c[100]={0};
  int dist[1000][1000]=MAX;
  cin >> N >> M;
  for(int i=0;i<M;i++){
    cin >> a[i] >> b[i] >> c[i];
    a[i]--,b[i]--;
  }
  for(int i=0;i<N;i++){
    for(int j=0;j<N;j++){
      if(i==j){
        dist[i][j]=0;
      }else {
        dist[i][j]=MAX;
      }
    }
  }
  for(int i=0;i<M;i++){
    dist[a[i]][b[i]]=min(dist[a[i]][b[i]],c[i]);
    dist[b[i]][a[i]]=min(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=M;
  for(int i = 0; i < M; ++i){
    bool shortest=false;
    for(int j = 0; j < N; ++j) if(dist[j][a[i]]+c[i]==dist[j][b[i]]) shortest=true;
    if(shortest==true){
    ans=ans-1;
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: array must be initialized with a brace-enclosed initializer
   15 | #define MAX 100000007
      |             ^~~~~~~~~
a.cc:29:24: note: in expansion of macro 'MAX'
   29 |   int dist[1000][1000]=MAX;
      |                        ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#define MAX 100000007
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;
typedef pair<ll, ll> P;
priority_queue<P, vector<P>, greater<P>> pque;

ll ans=0;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int N,M;
  int a[100]={0},b[100]={0},c[1000]={0};
  int dist[1000][1000]={0};
  cin >> N >> M;
  for(int i=0;i<M;i++){
    cin >> a[i] >> b[i] >> c[i];
    a[i]--,b[i]--;
  }
  for(int i=0;i<N;i++){
    for(int j=0;j<N;j++){
      if(i==j){
        dist[i][j]=0;
      }else {
        dist[i][j]=MAX;
      }
    }
  }
  for(int i=0;i<M;i++){
    dist[a[i]][b[i]]=min(dist[a[i]][b[i]],c[i]);
    dist[b[i]][a[i]]=dist[a[i]][b[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=M;
  for(int i = 0; i < M; ++i){
    bool shortest=false;
    for(int j = 0; j < N; ++j) if(dist[j][a[i]]+c[i]=<=dist[j][b[i]]) shortest=true;
    if(shortest==true){
    ans=ans-1;
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:54: error: expected primary-expression before '<=' token
   58 |     for(int j = 0; j < N; ++j) if(dist[j][a[i]]+c[i]=<=dist[j][b[i]]) shortest=true;
      |                                                      ^~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#define MAX 100000007
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;
typedef pair<ll, ll> P;
priority_queue<P, vector<P>, greater<P>> pque;

ll ans=0;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int N,M;
  int a[100]={0},b[100]={0},c[1000]={0};
  int dist[1000][1000]={0};
  cin >> N >> M;
  for(int i=0;i<M;i++){
    cin >> a[i] >> b[i] >> c[i];
    a[i]--,b[i]--;
  }
  for(int i=0;i<N;i++){
    for(int j=0;j<N;j++){
      if(i==j){
        dist[i][j]=0;
      }else {
        dist[i][j]=MAX;
      }
    }
  }
  for(int i=0;i<M;i++){
    dist[a[i]][b[i]]=min(dist[a[i]][b[i]],c[i]);
    dist[b[i]][a[i]]=dist[a[i]][b[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=m;
  for(int i = 0; i < m; ++i){
    bool shortest=false;
    for(int j = 0; j < n; ++j) if(dist[j][a[i]]+c[i]=<=dist[j][b[i]]) shortest=true;
    if(shortest==true){
    ans=ans-1;
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:22: error: 'n' was not declared in this scope
   48 |   for(int k = 0; k < n; ++k){
      |                      ^
a.cc:55:11: error: 'm' was not declared in this scope
   55 |   int ans=m;
      |           ^
a.cc:58:24: error: 'n' was not declared in this scope
   58 |     for(int j = 0; j < n; ++j) if(dist[j][a[i]]+c[i]=<=dist[j][b[i]]) shortest=true;
      |                        ^
a.cc:58:54: error: expected primary-expression before '<=' token
   58 |     for(int j = 0; j < n; ++j) if(dist[j][a[i]]+c[i]=<=dist[j][b[i]]) shortest=true;
      |                                                      ^~
Language: C++

//#include <bits/stdc++.h>
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <climits>
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define ROF(i, j, k) for(int i = (int)(j); i >= (int)(k); --i)
#define FORLL(i, n, m) for(long long i = n; i < (long long)(m); i++)
#define SORT(v, n) sort(v, v+n)
#define REVERSE(v) reverse((v).begin(), (v).end())

using namespace std;
using ll = long long;
const ll MOD=1000000007LL;
typedef pair<int, int> P;

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }

const int MAX_V = 110;
int d[MAX_V][MAX_V];

void setCost(int d[MAX_V][MAX_V], int s, int e, int cost){
    d[s][e] = d[e][s] = cost;
}

int
main(void){  
  int n, m;  
  cin >> n >> m;
  const int V = n;  
  REP(i, V){
    REP(j, V){
      if (i == j) d[i][j] = 0;
      else d[i][j] = MOD;
    }
  }
  
  ll a[n], b[n], c[n];
  REP(i, m){
    cin >> a[i] >> b[i] >> c[i];
    setCost(d, a[i]-1, b[i]-1, c[i]);
  }
  
  // Warshall Floyd
  REP(k, V){
    REP(i, V){
      REP(j, V){
	d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
      }
    }
  }

  int ans=0;
  FOr(i, 1, m+1){
    if(d[a[i]][b[i]] < c[i]) ++ans;
  }

  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:75:7: error: 'i' was not declared in this scope
   75 |   FOr(i, 1, m+1){
      |       ^
a.cc:75:3: error: 'FOr' was not declared in this scope; did you mean 'FOR'?
   75 |   FOr(i, 1, m+1){
      |   ^~~
      |   FOR
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll MOD = 110;

const ll MAX_N = 100010;
const ll INF = 1e12;

vector<pair<ll, ll> > g[MAX_N]; // firstに最短距離, secondに頂点番号
ll d[MAX_N];
int n; // 頂点数

bool used[MAX_N][MAX_N];

int pr[MAX_N]; // 最短路の直前の頂点

// bellman ford法で負辺がない場合。計算量はO(|E|log|V|)
void dijkstra(int s){
  priority_queue<pair<ll, ll>, vector<pair<ll, ll> >, greater<pair<ll, ll> > > PQ;
  for(int i=1;i<=n;i++) d[i] = INF;
  for(int i=1;i<=n;i++) pr[i] = -1;
  d[s] = 0;
  PQ.push(make_pair(0, s));

  while(!PQ.empty()){
    pair<ll, ll> p = PQ.top(); PQ.pop();
    int v = p.second;
    if(d[v] < p.first) continue;
    for(auto gvi: g[v]){
      ll cost = gvi.first;
      int u = gvi.second;
      if(d[u] > d[v] + cost){
        d[u] = d[v] + cost;
        PQ.push(make_pair(d[u], u));
        pr[u] = v;
      }
    }
  }
}

// 頂点tへの最短路
void get_path(int t){
  for(;t!=-1;t=pr[t]){
    used[t][pr[t]] = true;
    used[pr[t]][t] = true;
  }
}

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int m; cin >> n >> m;
  for(int i=1;i<=n;i++){
    for(int j=1;j<=n;j++){
      used[i][j] = true;
    }
  }
  for(int i=0;i<m;i++){
    ll a, b, c; cin >> a >> b >> c;
    g[a].push_back(make_pair(c, b));
    g[b].push_back(make_pair(c, a));
    used[a][b] = false;
    used[b][a] = false;
  }
  for(int i=1;i<=n;i++){
    dijkstra(i);
    for(int j=i+1;j<=n;j++){
      // cout << i << " " << j << " " << d[j] << endl;
      get_path(j);
    }
  }
  int cnt = 0;
  for(int i=1;i<=n;i++){
    for(int j=i+1;j<=n;j++){
      if(used[i][j] == false) cnt++;
    }
  }
  cout << cnt << endl;
}

Compiler output:
/tmp/ccIoRXMM.o: in function `dijkstra(int)':
a.cc:(.text+0x74): relocation truncated to fit: R_X86_64_PC32 against symbol `pr' defined in .bss section in /tmp/ccIoRXMM.o
a.cc:(.text+0x2d6): relocation truncated to fit: R_X86_64_PC32 against symbol `pr' defined in .bss section in /tmp/ccIoRXMM.o
/tmp/ccIoRXMM.o: in function `get_path(int)':
a.cc:(.text+0x37d): relocation truncated to fit: R_X86_64_PC32 against symbol `pr' defined in .bss section in /tmp/ccIoRXMM.o
a.cc:(.text+0x3b3): relocation truncated to fit: R_X86_64_PC32 against symbol `pr' defined in .bss section in /tmp/ccIoRXMM.o
a.cc:(.text+0x3e9): relocation truncated to fit: R_X86_64_PC32 against symbol `pr' defined in .bss section in /tmp/ccIoRXMM.o
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll MOD = 110;

const ll MAX_N = 100010;
const ll INF = 1e12;

vector<pair<ll, ll> > g[MAX_N]; // firstに最短距離, secondに頂点番号
ll d[MAX_N];
int n; // 頂点数

bool used[MAX_N][MAX_N];

int pr[MAX_N]; // 最短路の直前の頂点

// bellman ford法で負辺がない場合。計算量はO(|E|log|V|)
void dijkstra(int s){
  priority_queue<pair<ll, ll>, vector<pair<ll, ll> >, greater<pair<ll, ll> > > PQ;
  for(int i=1;i<=n;i++) d[i] = INF;
  for(int i=1;i<=n;i++) pr[i] = -1;
  d[s] = 0;
  PQ.push(make_pair(0, s));

  while(!PQ.empty()){
    pair<ll, ll> p = PQ.top(); PQ.pop();
    int v = p.second;
    if(d[v] < p.first) continue;
    for(auto gvi: g[v]){
      ll cost = gvi.first;
      int u = gvi.second;
      if(d[u] > d[v] + cost){
        d[u] = d[v] + cost;
        PQ.push(make_pair(d[u], u));
        pr[u] = v;
      }
    }
  }
}

// 頂点tへの最短路
void get_path(int t){
  for(;t!=-1;t=pr[t]){
    used[t][pr[t]] = true;
    used[pr[t]][t] = true;
  }
}

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int m; cin >> n >> m;
  for(int i=1;i<=n;i++){
    for(int j=1;j<=n;j++){
      used[i][j] = true;
    }
  }
  for(int i=0;i<m;i++){
    ll a, b, c; cin >> a >> b >> c;
    g[a].push_back(make_pair(c, b));
    g[b].push_back(make_pair(c, a));
    used[a][b] = false;
    used[b][a] = false;
  }
  for(int i=1;i<=n;i++){
    dijkstra(i);
    for(int j=i+1;j<=n;j++){
      // cout << i << " " << j << " " << d[j] << endl;
      get_path(j);
    }
  }
  int cnt = 0;
  for(int i=1;i<=n;i++){
    for(int j=i+1;j<=n;j++){
      if(used[i][j] == false) cnt++;
    }
  }
  cout << cnt << endl;
}

Compiler output:
/tmp/cc4VS7b2.o: in function `dijkstra(int)':
a.cc:(.text+0x74): relocation truncated to fit: R_X86_64_PC32 against symbol `pr' defined in .bss section in /tmp/cc4VS7b2.o
a.cc:(.text+0x2d6): relocation truncated to fit: R_X86_64_PC32 against symbol `pr' defined in .bss section in /tmp/cc4VS7b2.o
/tmp/cc4VS7b2.o: in function `get_path(int)':
a.cc:(.text+0x37d): relocation truncated to fit: R_X86_64_PC32 against symbol `pr' defined in .bss section in /tmp/cc4VS7b2.o
a.cc:(.text+0x3b3): relocation truncated to fit: R_X86_64_PC32 against symbol `pr' defined in .bss section in /tmp/cc4VS7b2.o
a.cc:(.text+0x3e9): relocation truncated to fit: R_X86_64_PC32 against symbol `pr' defined in .bss section in /tmp/cc4VS7b2.o
collect2: error: ld returned 1 exit status
Language: C++

n,m = list(map(int,input().split()))

d = []
for i in range(m):
    a,b,c = list(map(int,input().split()))
    d.append([a-1,b-1,c])

e = [[100000 for i in range(n)] for j in range(n)]

for i in range(n):
    e[i][i] = 0
for i in d:
    e[i[0]][i[1]] = i[2]
    e[i[1]][i[0]] = i[2]

for k in range(n):
    for i in range(n):
        for j in range(n):
            e[i][j] = min(e[i][j],e[i][k]+e[k][j])

ans = 0

for i in d:
    if e[i[0]][i[1]] != i[2]:
        ans += 1
print(ans)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n,m = list(map(int,input().split()))
      | ^
Language: C++

// 無向グラフにしてある.
#include <bits/stdc++.h>
using namespace std;

/* define const */
const int Nmax = 100;
const int M = 10000;
/* finish defineing const */

int graph[Nmax+10][Nmax+10];
int g_tmp[Nmax+10][Nmax+10];
int a[Nmax+10];
int b[Nmax+10];
int c[Nmax+10];
int n,m;

int main()
{
  for (int i = 0; i < Nmax+10; i++) {
    for (int j = 0; j < Nmax+10; j++) {
      d[i][j] = M;
      if (i != j) {
	graph[i][j] = M;
	g_tmp[i][j] = M;
      }
      else {
	graph[i][j] = 0;
	g_tmp[i][j] = 0;
      }
    }
  }
  
  cin >> n >> m;
  for (int i = 1; i <= m; i++) cin >> a[i] >> b[i] >> c[i];
  for (int i = 1; i <= m; i++) {
    graph[a[i]][b[i]] = c[i];
    g_tmp[a[i]][b[i]] = c[i];
    graph[b[i]][a[i]] = c[i]; // 有効グラフならこの行はコメントアウト
    g_tmp[b[i]][a[i]] = c[i]; // 有効グラフならこの行はコメントアウト
  }

  for (int k = 1; k <= n; k++) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
	if (g_tmp[i][j] > g_tmp[i][k]+g_tmp[k][j])
	  g_tmp[i][j] = g_tmp[i][k]+g_tmp[k][j];
      }
    }
  }

  long cnt = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i+1; j <= n; j++) {
      if (graph[i][j] < M && graph[i][j] > g_tmp[i][j]) {
	++cnt;
      }
    }
  }
  cout << cnt << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:7: error: 'd' was not declared in this scope
   21 |       d[i][j] = M;
      |       ^
Language: C++

int main(void){
const int inf = 100000000;

int n,m; cin>>n>>m;
int a[1000],b[1000],c[1000],dist[100][100];
for(inti=0;i< cin >> a[i] >> a[i]--,b[i]--;
}
for(inti=0;i< for(int j = 0;
m; ++i){
b[i] >> c[i];
n; ++i){ j<n;++j){
} }
if(i==j)
    dist[i][j]=0;
else
    dist[i][j]=inf;
for(inti=0;i<m;++i){ dist[a[i]][b[i]]=min(dist[a[i]][b[i]],c[i]); dist[b[i]][a[i]]=min(dist[b[i]][a[i]],c[i]);
}
for(intk=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=m; for(inti=0;i<m;++i){
        bool shortest=false;
        for(int j = 0; j < n; ++j) if(dist[j][a[i]]+c[i]==dist[j][b[i]]) shortest=true;
        if(shortest==true){
ans=ans-1; }
}
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:10: error: 'cin' was not declared in this scope
    4 | int n,m; cin>>n>>m;
      |          ^~~
a.cc:6:5: error: 'inti' was not declared in this scope; did you mean 'int'?
    6 | for(inti=0;i< cin >> a[i] >> a[i]--,b[i]--;
      |     ^~~~
      |     int
a.cc:6:12: error: 'i' was not declared in this scope
    6 | for(inti=0;i< cin >> a[i] >> a[i]--,b[i]--;
      |            ^
a.cc:7:1: error: expected primary-expression before '}' token
    7 | }
      | ^
a.cc:6:44: error: expected ')' before '}' token
    6 | for(inti=0;i< cin >> a[i] >> a[i]--,b[i]--;
      |    ~                                       ^
      |                                            )
    7 | }
      | ~                                           
a.cc:7:1: error: expected primary-expression before '}' token
    7 | }
      | ^
a.cc: At global scope:
a.cc:8:1: error: expected unqualified-id before 'for'
    8 | for(inti=0;i< for(int j = 0;
      | ^~~
a.cc:8:12: error: 'i' does not name a type
    8 | for(inti=0;i< for(int j = 0;
      |            ^
a.cc:9:1: error: 'm' does not name a type
    9 | m; ++i){
      | ^
a.cc:9:4: error: expected unqualified-id before '++' token
    9 | m; ++i){
      |    ^~
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<int,int>
string s;

int n,m;
vector<P>G[1005];
bool ok[105][105];
bool is[105][105];
int dist[105];
int d[105][105];
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(i,n)d[from][i]=dist[i];
}

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));
		is[a][b]=is[b][a]=1;
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			if(i!=j)daiku(i,j);
		}
	}

	int ans=0;
	rep(i,n){
		rep(j,n)cout<<d[i][j]<<" ";
		cout<<endl;
	}
	cout<<ans<<endl;
}
*/

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
#define REP(i,n) for(int i = 0;i < (n);i++)
#define P pair<int,int>
#define pb push_back
#define mk make_pair
using namespace std;
const int INF = 1e9;

typedef long long ll;

#define MAX_V 10000

struct edge {
    int to;
    int cost;
};


int V;
vector<edge> G[MAX_V];
int d[MAX_V];


void dijkstra(int s) {
    priority_queue<P, vector<P>, greater<P> > que;
    fill(d, d+V, INF);
    d[s] = 0;
    que.push(P(0, s));

    while (!que.empty()) {
        P p = que.top();
        que.pop();
        int v = p.second;
        if (d[v] < p.first) continue;

        for (int i=0; i<G[v].size(); ++i) {
            edge e = G[v][i];
            if (d[e.to] > d[v] + e.cost) {
                d[e.to] = d[v] + e.cost;
                que.push(P(d[e.to], e.to));
            }
        }
    }
}



int main(){
  int E,r;
  cin >> V >> E;
  REP(i,E){
    int f,t,c;
    cin >> f >> t >> c;
    f--;
    t--;
    edge e = {t,c};
    G[f].pb(e);
    e = {f,c}
    G[t].pb(e);
  }
  ll path[V][V];
  
  REP(i,V){

    dijkstra(i);
    REP(j,V){
      path[i][j] = d[j];
    }
  }
  
  ll sum = 0;
  REP(i,V){
    for(int j = i+1;j < V;j++){
      REP(k,G[j].size()){
	ll p = path[i][j]+G[j][k].cost;
	if(path[i][G[j][k].to] != p)
	  sum++;
      }
    }
  }
  cout << sum << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:14: error: expected ';' before 'G'
   58 |     e = {f,c}
      |              ^
      |              ;
   59 |     G[t].pb(e);
      |     ~
Language: C++

#include <cstdio>
#define INF 10000000;
using namespace std;
int n,m;
long long dp[100][100];
int a[1000],b[1000],c[1000];

void initialize(void){
	for(int lp1=0;lp1<100;lp1++){
		for(int lp2=0;lp2<100;lp2++){
			if(lp1==lp2){
				dp[lp1][lp2]=0;
			}else{
				dp[lp1][lp2]=INF;
			}
		}
	}
}

void input(void){
	int edge_a,edge_b,edge_c;
	scanf("%d %d",&n,&m);
	for(int lp1=0;lp1<m;lp1++){
		scanf("%d %d %d",&edge_a,&edge_b,&edge_c);
		a[lp1]=edge_a;
		b[lp1]=edge_b;
		c[lp1]=edge_c;
		dp[edge_a-1][edge_b-1]=edge_c;
		dp[edge_b-1][edge_a-1]=edge_c;
	}
}

void shortestpath(void){
	for(int lp1=0;lp1<n;lp1++){
		for(int lp2=0;lp2<n;lp2++){
			for(int lp3=0;lp3<n;lp3++){
				dp[lp2][lp3]=std:min(dp[lp2][lp3],dp[lp2][lp1]+dp[lp1][lp3]);
			}
		}
	}
} 

void pathprint(void){
	printf("pathprint called\n");
	for(int lp1=0;lp1<n;lp1++){
		for(int lp2=0;lp2<n;lp2++){
			printf("%d to %d is %d\n",lp1,lp2,dp[lp1][lp2]);
		}
	}
}

int solve(void){
	bool shortest=false;
	int answer=0;
	for(int lp1=0;lp1<m;lp1++){
		if(c[lp1]>dp[a[lp1]-1][b[lp1]-1]) answer++;
	}
	return answer;
}

int main(void){
	initialize();
	input();
	//pathprint();
	shortestpath();
	//printf("going to call pathprint2\n");
	//pathprint();
	printf("%d\n",solve());
	return 0;
}
	


Compiler output:
a.cc: In function 'void shortestpath()':
a.cc:37:49: error: found ':' in nested-name-specifier, expected '::'
   37 |                                 dp[lp2][lp3]=std:min(dp[lp2][lp3],dp[lp2][lp1]+dp[lp1][lp3]);
      |                                                 ^
      |                                                 ::
a.cc:37:50: error: 'min' is not a member of 'std'
   37 |                                 dp[lp2][lp3]=std:min(dp[lp2][lp3],dp[lp2][lp1]+dp[lp1][lp3]);
      |                                                  ^~~
Language: C++

#include <cstdio>
#define INF 10000000;
using namespace std;
int n,m;
long long dp[100][100];
int a[1000],b[1000],c[1000];

void initialize(void){
	for(int lp1=0;lp1<100;lp1++){
		for(int lp2=0;lp2<100;lp2++){
			if(lp1==lp2){
				dp[lp1][lp2]=0;
			}else{
				dp[lp1][lp2]=INF;
			}
		}
	}
}

void input(void){
	int edge_a,edge_b,edge_c;
	scanf("%d %d",&n,&m);
	for(int lp1=0;lp1<m;lp1++){
		scanf("%d %d %d",&edge_a,&edge_b,&edge_c);
		a[lp1]=edge_a;
		b[lp1]=edge_b;
		c[lp1]=edge_c;
		dp[edge_a-1][edge_b-1]=edge_c;
		dp[edge_b-1][edge_a-1]=edge_c;
	}
}

void shortestpath(void){
	for(int lp1=0;lp1<n;lp1++){
		for(int lp2=0;lp2<n;lp2++){
			for(int lp3=0;lp3<n;lp3++){
				dp[lp2][lp3]=min(dp[lp2][lp3],dp[lp2][lp1]+dp[lp1][lp3]);
			}
		}
	}
} 

void pathprint(void){
	printf("pathprint called\n");
	for(int lp1=0;lp1<n;lp1++){
		for(int lp2=0;lp2<n;lp2++){
			printf("%d to %d is %d\n",lp1,lp2,dp[lp1][lp2]);
		}
	}
}

int solve(void){
	bool shortest=false;
	int answer=0;
	for(int lp1=0;lp1<m;lp1++){
		if(c[lp1]>dp[a[lp1]-1][b[lp1]-1]) answer++;
	}
	return answer;
}

int main(void){
	initialize();
	input();
	//pathprint();
	shortestpath();
	//printf("going to call pathprint2\n");
	//pathprint();
	printf("%d\n",solve());
	return 0;
}
	


Compiler output:
a.cc: In function 'void shortestpath()':
a.cc:37:46: error: 'min' was not declared in this scope
   37 |                                 dp[lp2][lp3]=min(dp[lp2][lp3],dp[lp2][lp1]+dp[lp1][lp3]);
      |                                              ^~~
Language: C++

#include <iostream>
#include <tuple>
#include <queue>
#include <algorithm>
using namespace std;
typedef tuple<int, int, int> tiii;
const int INF = 1 << 29;
int N, M;
int A[100][100];
int a, b, c;
queue<tiii> q;
int main(void) {
	cin >> N >> M;
	fill_n(A, N * N, INF);
	for (int i = 0; i < M; ++i) {
		cin >> a >> b >> c;
		--a; --b;
		A[a][b] = A[b][a] = c;
		q.push(tiii(a, b, c));
	}
	for (int k = 0; k < N; ++k) for (int i = 0; i < N; ++i) for (int j = 0; j < N; ++j) A[i][j] = min(A[i][j], A[i][k] + A[k][j]);
	int ans = M;
	while (!q.empty()) {
		tie(a, b, c) = q.front(); q.pop();
		if (A[a][b] == c) --M;
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'typename __gnu_cxx::__enable_if<std::__is_scalar<_Tp>::__value, void>::__type std::__fill_a1(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = int (*)[100]; _Tp = int; typename __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type = void]':
/usr/include/c++/14/bits/stl_algobase.h:998:21:   required from 'void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = int (*)[100]; _Tp = int]'
  998 |     { std::__fill_a1(__first, __last, __value); }
      |       ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1154:20:   required from '_OutputIterator std::__fill_n_a(_OutputIterator, _Size, const _Tp&, random_access_iterator_tag) [with _OutputIterator = int (*)[100]; _Size = int; _Tp = int]'
 1154 |       std::__fill_a(__first, __first + __n, __value);
      |       ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1183:29:   required from '_OI std::fill_n(_OI, _Size, const _Tp&) [with _OI = int (*)[100]; _Size = int; _Tp = int]'
 1183 |       return std::__fill_n_a(__first, std::__size_to_integer(__n), __value,
      |              ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1184 |                                std::__iterator_category(__first));
      |                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:14:8:   required from here
   14 |         fill_n(A, N * N, INF);
      |         ~~~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:952:18: error: incompatible types in assignment of 'const int' to 'int [100]'
  952 |         *__first = __tmp;
      |         ~~~~~~~~~^~~~~~~