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

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

static const int MAX_N = 100;

void dijkstra(vector<vector<pair<int, int> > > way)
{
    int d[way.size()];
    bool on[way.size()];
    for (int i = 0; i < way.size(); i++) {
        d[i] = INT_MAX;
        on[i] = false;
    }
    d[0] = 0;
    while (1) {
//        cout << "d:";
//        for (int i = 0; i < way.size(); i++) {
//            cout << " " << d[i];
//        }
//        cout << endl;
        int u, minv = INT_MAX;
        for (int i = 0; i < way.size(); i++) {
            if (minv > d[i] && !on[i]) {
                minv = d[i];
                u = i;
            }
        }
        if (minv == INT_MAX) break;
        on[u] = true;
        for (auto itr = way.at(u).begin(); itr != way.at(u).end(); ++itr) {
            if (!on[itr->first]) {
                d[itr->first] = min(d[itr->first], d[u] + itr->second);
            }
        }
    }
    for (int i = 0; i < way.size(); i++) {
        cout << i << " " << d[i] << endl;
    }
}

int main()
{
    int n;
    cin >> n;
    vector<vector<pair<int, int> > > way(n);
    int k, c, u, v;
    for (int i = 0; i < n; i++) {
        cin >> u >> k;
        for (int j = 0; j < k; j++) {
            cin >> v >> c;
            way.at(u).push_back(make_pair(v, c));
        }
    }
    dijkstra(way);
    return 0;
}

Compiler output:
a.cc: In function 'void dijkstra(std::vector<std::vector<std::pair<int, int> > >)':
a.cc:13:16: error: 'INT_MAX' was not declared in this scope
   13 |         d[i] = INT_MAX;
      |                ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <vector>
  +++ |+#include <climits>
    4 | using namespace std;
a.cc:23:23: error: 'INT_MAX' was not declared in this scope
   23 |         int u, minv = INT_MAX;
      |                       ^~~~~~~
a.cc:23:23: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include<iostream>
using namespace std;
static const int MAX=100;
static const int INFTY=(1<<21);
static const int WHITE=0;
static const int GRAY=1;
static const int BLACK=2;

int n,M[MAX][MAX];

void dik(){
int min;
int d[MAX],color[MAX];

for(int i=0;i<n;i++){
d[i]=INFTY;
color[i]=WHITE;
}

d[0]=0;
color[0]=GRAY;
while(1){
min=INFTY;
int u=-1;
for(int i=0;i<n;i++){
if(min>d[i]&&color[i]!=BLACK){
u=i;
min=d[i];
}
}
if(u==-1)break;
color[u]=BLACK;
for(int v=0;v<n;v++){
if(color[v]!=BLACK&&M[u][v]){
d[v]=d[u]+M[u][v]){
color[v]=GRAY;
}
}
}
}
for(int i=0;i<n;i++){
cout << i <<" "<<(d[i]==INTY ? -1 : d[i])<<endl;
}
}

int main(){
cin >> n;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
M[i][j]=INFTY;
}
}

int k,c,u,v;
for(int i=0;i<n;i++){
cin >> u >> k;
for(int j=0;j<k;j++){
cin >> v >> c;
M[u][v]=c;
}
}

dik();

return 0;
}

Compiler output:
a.cc: In function 'void dik()':
a.cc:35:18: error: expected ';' before ')' token
   35 | d[v]=d[u]+M[u][v]){
      |                  ^
      |                  ;
a.cc:42:25: error: 'INTY' was not declared in this scope; did you mean 'INFTY'?
   42 | cout << i <<" "<<(d[i]==INTY ? -1 : d[i])<<endl;
      |                         ^~~~
      |                         INFTY
Language: C++

#include<iostream>
using namespace std;
static const int MAX=100;
static const int INFTY=(1<<21);
static const int WHITE=0;
static const int GRAY=1;
static const int BLACK=2;

int n,M[MAX][MAX];

void dik(){
int min;
int d[MAX],color[MAX];

for(int i=0;i<n;i++){
d[i]=INFTY;
color[i]=WHITE;
}

d[0]=0;
color[0]=GRAY;
while(1){
min=INFTY;
int u=-1;
for(int i=0;i<n;i++){
if(min>d[i]&&color[i]!=BLACK){
u=i;
min=d[i];
}
}
if(u==-1)break;
color[u]=BLACK;
for(int v=0;v<n;v++){
if(color[v]!=BLACK&&M[u][v]){
d[v]=d[u]+M[u][v]){
color[v]=GRAY;
}
}
}
}
for(int i=0;i<n;i++){
cout << i <<" "<<(d[i]==INFTY ? -1 : d[i])<<endl;
}
}

int main(){
cin >> n;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
M[i][j]=INFTY;
}
}

int k,c,u,v;
for(int i=0;i<n;i++){
cin >> u >> k;
for(int j=0;j<k;j++){
cin >> v >> c;
M[u][v]=c;
}
}

dik();

return 0;
}

Compiler output:
a.cc: In function 'void dik()':
a.cc:35:18: error: expected ';' before ')' token
   35 | d[v]=d[u]+M[u][v]){
      |                  ^
      |                  ;
Language: C++

#include <stdio.h>
#include <iostream>
#include <queue>
using namespace std;

class Vertice;
class Edge;

class Vertice{
private:
	int id;
	int edge_num;
	int *vertice_id_list;
	Edge **edges;
	bool flag_fixed;
	int distance_min;
public:
	Vertice(int id, int edge_num_max);
	~Vertice(){ delete[] edges, vertice_id_list; }
	int getDistanceMin() const { return distance_min; }
	void addEdge(int vertice_id, Edge *edge);
	void addVertices(Vertice *vertices[]);
	void setDistance(int d);
	void serveDistance();
	void setFlagFixed(){ flag_fixed = true; }
};

class Edge{
private:
	int distance;
	Vertice *vertice;
public:
	Edge(int distance){ this->distance = distance; }
	void addVertice(Vertice *vertice){ this->vertice = vertice; }
	void setDistance(int distance){ vertice->setDistance(distance + this->distance); }
};

struct verticeComp {
	bool operator()(const Vertice *v1, const Vertice *v2)
	{
		return v1->getDistanceMin() > v2->getDistanceMin();
	}
};

priority_queue<Vertice*, vector<Vertice*>, verticeComp > PQ; 

Vertice::Vertice(int id, int edge_num_max)
{
	this->id = id;
	edge_num = 0;
	vertice_id_list = new int[edge_num_max];
	edges = new Edge*[edge_num_max];
	flag_fixed = false;
	distance_min = INT_MAX;
}

void Vertice::addEdge(int vertice_id, Edge *edge)
{
	edges[edge_num] = edge;
	vertice_id_list[edge_num] = vertice_id;
	edge_num++;
}

void Vertice::addVertices(Vertice *vertices[])
{
	for (int i = 0; i < edge_num; i++) {
		edges[i]->addVertice(vertices[vertice_id_list[i]]);
	}
}

void Vertice::setDistance(int d)
{
	if (flag_fixed) return;
	if (d < distance_min) distance_min = d;
	PQ.push(this);
}

void Vertice::serveDistance()
{
	if (PQ.empty()) return;
	for (int i = 0; i < edge_num; i++) {
		edges[i]->setDistance(distance_min);
	}
	Vertice *fixed_vertice = PQ.top();
	PQ.pop();
	fixed_vertice->setFlagFixed();
	fixed_vertice->serveDistance();
}

int main(void)
{
	Vertice **vertices;

	int n;
	cin >> n;
	vertices = new Vertice*[n];
	for (int i = 0; i < n; i++) {
		int u, k;
		cin >> u >> k;
		vertices[u] = new Vertice(u, k);
		for (int j = 0; j < k; j++) {
			int v, c;
			cin >> v >> c;
			vertices[u]->addEdge(v, new Edge(c));
		}
	}
	
	for (int i = 0; i < n; i++) {
		vertices[i]->addVertices(vertices);
	}

	vertices[0]->setDistance(0);
	vertices[0]->serveDistance();

	for (int i = 0; i < n; i++) {
		cout << i << " ";
		cout << vertices[i]->getDistanceMin() << endl;
	}

	return 0;
}

Compiler output:
a.cc: In constructor 'Vertice::Vertice(int, int)':
a.cc:54:24: error: 'INT_MAX' was not declared in this scope
   54 |         distance_min = INT_MAX;
      |                        ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <queue>
  +++ |+#include <climits>
    4 | using namespace std;
Language: C++

#include<bits/stdc++.h>
#define ll long long int
#define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n)
 
using namespace std;

static const int MAX = 100;
static const int INFTY = (1<<21);
static const int white =0;
static const int gray = 1;
static const int black = 2;

int n, M[MAX][MAX];

int dijkstra() {
  int u, minv;
  int d[MAX], color[MAX];

  REP(i, n) {
    d[i] = INFTY;
    color[i] = white;
  }

  d[0] = 0;
  color[0] = gray;

  while( 1 ) {
    minv = INFTY;
    u = -1;
    REP(i, n) {
      if (minv > d[i] && color[i] != black ) {
        u = i;
        minv = d[i];
      }
    }
    if (u == -1) break;
    color[u] = black;
    REP(v, n) {
      if (color[v] != black && M[u][v] != INFTY) {
        if (d[v] > d[u] + M[u][v]) {
          d[v] = d[u] + M[u][v];
          p[v] = u;
          color[v] = gray;
        }
      }
    }
  }
  REP(i, n) {
    cout << i << " " << (d[i] == INFTY ? -1 : d[i]) << endl;
  }
}

int main() {
  cin >> n;
  REP(i, n) {
    REP(j, n) {
      M[i][j] = INFTY;
    }
  }

  int k, c, u, v;
  REP(i, n) {
    cin >> u >> k;
    REP(j, k) {
      cin >> v >> c;
      M[u][v] = c;
    }
  }
  dijkstra();
  return 0;
}

Compiler output:
a.cc: In function 'int dijkstra()':
a.cc:44:11: error: 'p' was not declared in this scope
   44 |           p[v] = u;
      |           ^
a.cc:53:1: warning: no return statement in function returning non-void [-Wreturn-type]
   53 | }
      | ^
Language: C++

#include <iostream>
using namespace std;
static const int MAX = 100;
static const int INFTY = (1 << 21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;

int n, M[MAX][MAX];

void dijkstra()  {
  int minv;
  int d[MAX], color[MAX];
  
  for (int i = 0; i < n; i++)  {
    d[i] = INFTY;
    color[i] = WHITE;
  }
  
  d[0] = 0;
  color[0] = GRAY;
  while ( 1)  {
    minv = INFTY;
    int u = -1;
    for ( int i = 0; i < n; i++)  {
      if (minv > d[i] && color[i] != BALCK )  {
        u = i;
        minv = d[i];
      }
    }
    if (u == -1)  break;
    color[u] = BLACK;
    for (int v = 0; v < n; v++)  {
      if (color[v] != BLACK && M[u][v] != INFTY)  {
        if (d[v] > d[u] + M[u][v] )  {
          d[v] = d[u] + M[u][v];
          color[v] = GRAY;
        }
      }
    }
  }

  for (inti = 0; i < n; i++)  {
    cout << i << " " << ( d[i] == INFTY ? -1 : d[i]) << endl;
  }
}

int main()  {
  cin >> n;
  for (int i = 0; i < n; i++)  {
    for (int j = 0; j < n; j++)  {
      M[i][j] = INFTY;
    }
  }
  
  int k, c, u, v;
  for (int i = 0; i < n; i++)  {
    cin >> u >> k;
    for (int j = 0; j < k; j++)  {
      cin >> v >> c;
      M[u][v] = c;
    }
  }
 
  dijkstra();
  
  return 0;
} 

Compiler output:
a.cc: In function 'void dijkstra()':
a.cc:26:38: error: 'BALCK' was not declared in this scope; did you mean 'BLACK'?
   26 |       if (minv > d[i] && color[i] != BALCK )  {
      |                                      ^~~~~
      |                                      BLACK
a.cc:43:8: error: 'inti' was not declared in this scope; did you mean 'int'?
   43 |   for (inti = 0; i < n; i++)  {
      |        ^~~~
      |        int
a.cc:43:18: error: 'i' was not declared in this scope
   43 |   for (inti = 0; i < n; i++)  {
      |                  ^
Language: C++

#include <stdio.h>
#define INF (1<<21)

int main(void)
{
 int i,j,n,m,u,k,l,v,c,a[10000],b[10000],d[10000][10000];

 scand("%d",&n);
 
 for(i=0;i<n;i++){
 	scanf("%d %d",&u,&k);
 	a[i]=INF;
 	b[i]=0;
 	for(j=0;j<k;j++){
 		scanf("%d %d",&v,&c);
 		d[u][v]=c;
 	}
 }
 a[0]=0;
 
 while(1){
 	
 	l=-1;
 	m=INF;
 	
 	for(i=0;i<n;i++){
 		if(a[i]<m && b[i]=0){
 			m=a[i];
 			l=i;
 		}
 	}
 	
 	if(l==-1) break;
 	
 	b[l]=1;
 	
 	for(i=0;i<n;i++){
 		if(a[i]>=d[l][i]+a[l]) a[i]=d[l][i]+a[l];
 	}
 }
 
 for(i=0;i<n;i++){
 	if(a[i]==INF) printf("%d -1\n",i);
 	else printf("%d %d\n",i,a[i]);
 }
 
 return 0;
}

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:2: error: 'scand' was not declared in this scope; did you mean 'scanf'?
    8 |  scand("%d",&n);
      |  ^~~~~
      |  scanf
a.cc:27:27: error: lvalue required as left operand of assignment
   27 |                 if(a[i]<m && b[i]=0){
      |                    ~~~~~~~^~~~~~~
a.cc: At global scope:
a.cc:50:2: error: expected unqualified-id before 'return'
   50 |  return 0;
      |  ^~~~~~
a.cc:51:1: error: expected declaration before '}' token
   51 | }
      | ^
Language: C++

#include <stdio.h>
#define INF (1<<21)

int main(void)
{
 int i,j,n,m,u,k,l,v,c,a[10000],b[10000],d[10000][10000];

 scand("%d",&n);
 
 for(i=0;i<n;i++){
 	scanf("%d %d",&u,&k);
 	a[i]=INF;
 	b[i]=0;
 	for(j=0;j<k;j++){
 		scanf("%d %d",&v,&c);
 		d[u][v]=c;
 	}
 }
 a[0]=0;
 
 while(1){
 	
 	l=-1;
 	m=INF;
 	
 	for(i=0;i<n;i++){
 		if(a[i]<m && b[i]=0){
 			m=a[i];
 			l=i;
 		}
 	}
 	
 	if(l==-1) break;
 	
 	b[l]=1;
 	
 	for(i=0;i<n;i++){
 		if(a[i]>=d[l][i]+a[l]) a[i]=d[l][i]+a[l];
 	}
 }
 
 for(i=0;i<n;i++){
 	if(a[i]==INF) printf("%d -1\n",i);
 	else printf("%d %d\n",i,a[i]);
 }
 
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:2: error: 'scand' was not declared in this scope; did you mean 'scanf'?
    8 |  scand("%d",&n);
      |  ^~~~~
      |  scanf
a.cc:27:27: error: lvalue required as left operand of assignment
   27 |                 if(a[i]<m && b[i]=0){
      |                    ~~~~~~~^~~~~~~
Language: C++

#include <stdio.h>
#define INF (1<<21)

int main(void)
{
 int i,j,n,m,u,k,l,v,c,a[10000],b[10000],d[10000][10000];

 scanf("%d",&n);
 
 for(i=0;i<n;i++){
 	scanf("%d %d",&u,&k);
 	a[i]=INF;
 	b[i]=0;
 	for(j=0;j<k;j++){
 		scanf("%d %d",&v,&c);
 		d[u][v]=c;
 	}
 }
 a[0]=0;
 
 while(1){
 	
 	l=-1;
 	m=INF;
 	
 	for(i=0;i<n;i++){
 		if(a[i]<m && b[i]=0){
 			m=a[i];
 			l=i;
 		}
 	}
 	
 	if(l==-1) break;
 	
 	b[l]=1;
 	
 	for(i=0;i<n;i++){
 		if(a[i]>=d[l][i]+a[l]) a[i]=d[l][i]+a[l];
 	}
 }
 
 for(i=0;i<n;i++){
 	if(a[i]==INF) printf("%d -1\n",i);
 	else printf("%d %d\n",i,a[i]);
 }
 
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:27: error: lvalue required as left operand of assignment
   27 |                 if(a[i]<m && b[i]=0){
      |                    ~~~~~~~^~~~~~~
Language: C++

#include<iostream>
using namespace std;
static const int MAX = 100;
static const int INFTY = (1<21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BRACK = 2;

int n,M[MAX][MAX];

void dijkstra(){
  int minv;
  int d[MAX],color[MAX];

  for(int i = 0;i < n;i++){
   d[i] = INFTY;
   color[i] = WHITE;
 }
  
   d[0] = 0;
   color[0] = GRAY;
   while( 1 ){
    minv = INFTY;
    int u = -1;
    for ( int i = 0; i < n; i++){
      if(minv > d[i] && color[i] != BLACK){
       u = i;
       minv = d[i];
      }
   }
    if(u == -1) break;
    color[u] = BLACK;
    for ( int v = 0; v < n; v++){
     if(color[v] != BLACK && M[u][v] != BLACK){
     u = i;
     minv = d[i];
    }
  }
    if(u == -1) break;
    color[u] = BLACK;
   for(int v = 0; v < n; v++){
    if(minv > d[i] && color[i] != BLACK){
     u = i;
     minv = d[i];
    }
  }
  if(u == -1)break;
  color[u] = BLACK;
  for(int v = 0; v < n; v++){
    if(color[v] != BLACK && M[u][v] != INFTY){
      if(d[v] > d[u] + M[u][v]){
         d[v] = d[u] + M[u][v];
         color[v] = GRAY;
      }
     }
    }
   }
   for(int i = 0; i < n; i++){
    cout << i << " " << (d[i] == INFTY ? -1: d[i]) <<endl;
   }
  }
int main(){
  cin >> n;
  for(int i = 0;i < n; i++){
    for(int j = 0; j < n; j++){
     M[i][j] = INFTY;
     }
   }

 int k,v,c,u;
 for(int i = 0;i < n; i++){
  cin >> u >>c;
  M[u][v] = c;
  }
 }
  dijkstra();
   return 0;
}

Compiler output:
a.cc: In function 'void dijkstra()':
a.cc:26:37: error: 'BLACK' was not declared in this scope; did you mean 'BRACK'?
   26 |       if(minv > d[i] && color[i] != BLACK){
      |                                     ^~~~~
      |                                     BRACK
a.cc:32:16: error: 'BLACK' was not declared in this scope; did you mean 'BRACK'?
   32 |     color[u] = BLACK;
      |                ^~~~~
      |                BRACK
a.cc:35:10: error: 'i' was not declared in this scope
   35 |      u = i;
      |          ^
a.cc:42:17: error: 'i' was not declared in this scope
   42 |     if(minv > d[i] && color[i] != BLACK){
      |                 ^
a.cc: At global scope:
a.cc:76:13: error: expected constructor, destructor, or type conversion before ';' token
   76 |   dijkstra();
      |             ^
a.cc:77:4: error: expected unqualified-id before 'return'
   77 |    return 0;
      |    ^~~~~~
a.cc:78:1: error: expected declaration before '}' token
   78 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
static const int MAX = 100;
static const int INFTY = (1<<21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;

int n,M[MAX][MAX];

void dijkstra(){
  int minv;
  int d[MAX],color[MAX];

  for(int i = 0;i < n;i++){
   d[i] = INFTY;
   color[i] = WHITE;
 }
  
   d[0] = 0;
   color[0] = GRAY;
   while( 1 ){
    minv = INFTY;
    int u = -1;
    for ( int i = 0; i < n; i++){
      if(minv > d[i] && color[i] != BLACK){
       u = i;
       minv = d[i];
      }
   }
    if(u == -1) break;
    color[u] = BLACK;
    for ( int v = 0; v < n; v++){
     if(color[v] != BLACK && M[u][v] != INFTY){
       if(d[v] > d[u] + M[u][v]){
       d[v] = d[u] + M[u][v];
       color[v] = GRAY;
        }
       }
     }
  }
    if(u == -1) break;
    color[u] = BLACK;
   for(int v = 0; v < n; v++){
    if(minv > d[i] && color[i] != BLACK){
     u = i;
     minv = d[i];
    }
  }
  if(u == -1)break;
  color[u] = BLACK;
  for(int v = 0; v < n; v++){
    if(color[v] != BLACK && M[u][v] != INFTY){
      if(d[v] > d[u] + M[u][v]){
         d[v] = d[u] + M[u][v];
         color[v] = GRAY;
      }
     }
    }
   }
   for(int i = 0; i < n; i++){
    cout << i << " " << (d[i] == INFTY ? -1: d[i]) <<endl;
   }
  }
int main(){
  cin >> n;
  for(int i = 0;i < n; i++){
    for(int j = 0; j < n; j++){
     M[i][j] = INFTY;
     }
   }

 int k,v,c,u;
 for(int i = 0;i < n; i++){
  cin >> u >>c;
  M[u][v] = c;
  }
 }
  dijkstra();
   return 0;
}

Compiler output:
a.cc: In function 'void dijkstra()':
a.cc:42:8: error: 'u' was not declared in this scope
   42 |     if(u == -1) break;
      |        ^
a.cc:42:17: error: break statement not within loop or switch
   42 |     if(u == -1) break;
      |                 ^~~~~
a.cc:43:11: error: 'u' was not declared in this scope
   43 |     color[u] = BLACK;
      |           ^
a.cc:45:17: error: 'i' was not declared in this scope
   45 |     if(minv > d[i] && color[i] != BLACK){
      |                 ^
a.cc:50:14: error: break statement not within loop or switch
   50 |   if(u == -1)break;
      |              ^~~~~
a.cc: At global scope:
a.cc:61:4: error: expected unqualified-id before 'for'
   61 |    for(int i = 0; i < n; i++){
      |    ^~~
a.cc:61:19: error: 'i' does not name a type
   61 |    for(int i = 0; i < n; i++){
      |                   ^
a.cc:61:26: error: 'i' does not name a type
   61 |    for(int i = 0; i < n; i++){
      |                          ^
a.cc:64:3: error: expected declaration before '}' token
   64 |   }
      |   ^
a.cc:79:13: error: expected constructor, destructor, or type conversion before ';' token
   79 |   dijkstra();
      |             ^
a.cc:80:4: error: expected unqualified-id before 'return'
   80 |    return 0;
      |    ^~~~~~
a.cc:81:1: error: expected declaration before '}' token
   81 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
static const int MAX = 100;
static const int INFTY = (1<<21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;

int n,M[MAX][MAX];

void dijkstra(){
  int minv;
  int d[MAX],color[MAX];

  for(int i = 0;i < n;i++){
   d[i] = INFTY;
   color[i] = WHITE;
 }
  
   d[0] = 0;
   color[0] = GRAY;
   while( 1 ){
    minv = INFTY;
    int u = -1;
    for ( int i = 0; i < n; i++){
      if(minv > d[i] && color[i] != BLACK){
       u = i;
       minv = d[i];
      }
   }
    if(u == -1) break;
    color[u] = BLACK;
    for ( int v = 0; v < n; v++){
     if(color[v] != BLACK && M[u][v] != INFTY){
       if(d[v] > d[u] + M[u][v]){
       d[v] = d[u] + M[u][v];
       color[v] = GRAY;
        }
       }
     }
  }
       
      
   
   for(int i = 0; i < n; i++){
    cout << i << " " << (d[i] == INFTY ? -1: d[i]) <<endl;
   }
  }
int main(){
  cin >> n;
  for(int i = 0;i < n; i++){
    for(int j = 0; j < n; j++){
     M[i][j] = INFTY;
     }
   }

 int k,v,c,u;
 for(int i = 0;i < n; i++){
  cin >> u >>c;
  M[u][v] = c;
  }
 }
  dijkstra();
   return 0;
}

Compiler output:
a.cc:63:13: error: expected constructor, destructor, or type conversion before ';' token
   63 |   dijkstra();
      |             ^
a.cc:64:4: error: expected unqualified-id before 'return'
   64 |    return 0;
      |    ^~~~~~
a.cc:65:1: error: expected declaration before '}' token
   65 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
static const int MAX=100;
static const int INFTY=(1<<21);
static const int WHITE=0;
static const int GRAY=1;
static const int BLACK=2;
int n,M[MAX][MAX];
void dijkstra(){
int minv;
int d[MAX],color[MAX];
for(int i=0;i<n;i++){
d[i]=INFTY;
color[i]=WHITE;
}
d[0]=0;
color[0]=GRAY;
while(1){
minv=INFTY;
int u=-1;
for(int i=0;i<n;i++){
if(minv>d[i]&&color[i]!=BLACK){
u=i;
minv=d[i];
}
}
if(u==-1)break;
color[u]=BLACK;
for(int v=0;v<n;v++){
if(color[v]!=BLACK&&M[u][v]!=INFTY){
if(d[v]>d[u]+M[u][v]){
d[v]=d[u]+M[u][v];
color[v]=GRAY;
}
}
}
}
for(int i=0;i<n;i++){
cout<<i<<" "<<(d[i]==INFTY？-1:d[i])<<endl;
}
}
int main(){
cin>>n;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
M[i][j]=INFTY;
}
}
int k,c,u,v;
for(int i=0;i<n;i++){
cin>>u>>k;
for(int j=0;j<k;j++){
cin>>v>>c;
M[u][v]=c;
}
}
dijkstra();
return 0;
}


Compiler output:
a.cc: In function 'void dijkstra()':
a.cc:39:22: error: 'INFTY\U0000ff1f' was not declared in this scope; did you mean 'INFTY'?
   39 | cout<<i<<" "<<(d[i]==INFTY？-1:d[i])<<endl;
      |                      ^~~~~~~
      |                      INFTY
a.cc:39:31: error: expected ')' before ':' token
   39 | cout<<i<<" "<<(d[i]==INFTY？-1:d[i])<<endl;
      |               ~               ^
      |                               )
Language: C++

#include<stdio.h>
#include<stdlib.h>

#define rep( i ,end ) for( int i = 0 ; i < end ; ++i )
#define Nmax 100
#define INF ( INT_MAX / 10 )

int Node[ Nmax ][ Nmax ] ;

int min( int a ,int b )
{
	return a > b ? b : a ;
}

void Init( int ( *NODE )[ Nmax ] ,int N )
{
	rep( i ,N )
	{
		rep( j ,N )
		{
			NODE[ i ][ j ] = ( i == j ) ? 0 : INF ;
		}
	}
}



int main( void )
{
	int N ,V ,K ;
	int v ,cost ;
	scanf( "%d" ,&N ) ;

	Init( Node ,N ) ;

	rep( i ,N )
	{
		scanf( "%d %d" ,&V ,&K ) ;

		rep( j ,K )
		{
			scanf( "%d %d" ,&v ,&cost ) ;

			Node[ V ][ v ] = cost ;
		}
	}

	rep( u ,N )
	{
		rep( i ,N )
		{
			rep( j ,N )
			{
				Node[ i ][ j ] = min( Node[ i ][ j ] ,Node[ i ][ u ] + Node[ u ][ j ] ) ;
			}
		}
	}

	rep( u ,N )
	{
		printf( "%d %d\n" ,u ,Node[ 0 ][ u ] ) ;
	}

	return 0 ;
}


Compiler output:
a.cc: In function 'void Init(int (*)[100], int)':
a.cc:6:15: error: 'INT_MAX' was not declared in this scope
    6 | #define INF ( INT_MAX / 10 )
      |               ^~~~~~~
a.cc:21:59: note: in expansion of macro 'INF'
   21 |                         NODE[ i ][ j ] = ( i == j ) ? 0 : INF ;
      |                                                           ^~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include<stdlib.h>
  +++ |+#include <climits>
    3 |
Language: C++

#include<stdio.h>
#include<stdlib.h>

#define rep( i ,end ) for( int i = 0 ; i < end ; ++i )
#define Nmax 100
#define INF ( INT_MAX / 10 )

int Node[ Nmax ][ Nmax ] ;

int min( int a ,int b )
{
	return a > b ? b : a ;
}

void Init( int NODE[ Nmax ][ Nmax ] ,int N )
{
	rep( i ,N )
	{
		rep( j ,N )
		{
			NODE[ i ][ j ] = ( i == j ) ? 0 : INF ;
		}
	}
}



int main( void )
{
	int N ,V ,K ;
	int v ,cost ;
	scanf( "%d" ,&N ) ;

	Init( Node ,N ) ;

	rep( i ,N )
	{
		scanf( "%d %d" ,&V ,&K ) ;

		rep( j ,K )
		{
			scanf( "%d %d" ,&v ,&cost ) ;

			Node[ V ][ v ] = cost ;
		}
	}

	rep( u ,N )
	{
		rep( i ,N )
		{
			rep( j ,N )
			{
				Node[ i ][ j ] = min( Node[ i ][ j ] ,Node[ i ][ u ] + Node[ u ][ j ] ) ;
			}
		}
	}

	rep( u ,N )
	{
		printf( "%d %d\n" ,u ,Node[ 0 ][ u ] ) ;
	}

	return 0 ;
}


Compiler output:
a.cc: In function 'void Init(int (*)[100], int)':
a.cc:6:15: error: 'INT_MAX' was not declared in this scope
    6 | #define INF ( INT_MAX / 10 )
      |               ^~~~~~~
a.cc:21:59: note: in expansion of macro 'INF'
   21 |                         NODE[ i ][ j ] = ( i == j ) ? 0 : INF ;
      |                                                           ^~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include<stdlib.h>
  +++ |+#include <climits>
    3 |
Language: C++

#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
using namespace std;

typedef vector<int>::iterator vitr;
typedef map<int, int>::iterator mitr;

map<int, int> w[100];
int d[100];

vector<int> a;
vector<int> b;

void findPath(){
    int candiW = INT_MAX;
    vitr candiI;
    for(vitr i=a.begin();i!=a.end();i++){
        for(vitr j=b.begin();j!=b.end();j++){
            mitr k = w[*i].find(*j);
            if(k == w[*i].end())continue;
            if(k->second + d[*i] < candiW){
                candiW = k->second + d[*i];
                candiI = j;
            }
        }
    }
    a.push_back(*candiI);
    d[*candiI] = candiW;
    b.erase(candiI);
}

int main(){
    int i,j,u,k,n,v,c;

    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d %d",&u,&k);
        for(j=0;j<k;j++){
            scanf("%d %d",&v,&c);
            w[u][v] = c;
        }
    }

    d[0] = 0;
    a.push_back(0);
    for(i=1;i<n;i++)b.push_back(i);

    for(i=1;i<n;i++)findPath();

    for(i=0;i<n;i++)printf("%d %d\n",i,d[i]);

    return 0;
}



Compiler output:
a.cc: In function 'void findPath()':
a.cc:17:18: error: 'INT_MAX' was not declared in this scope
   17 |     int candiW = INT_MAX;
      |                  ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <map>
  +++ |+#include <climits>
    5 | using namespace std;
Language: C++

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#include <cmath>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rREP(i, k, n) for (int i = (int)(n)-1; i >= k; i--)

#define debug(x) cerr<<#x<<": "<<x<<'\n'

#define fi first
#define se second

#define vi vector<int>
#define pb push_back
#define mp make_pair

#define pcnt __builtin_popcount

typedef long long ll;

const int inf = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
int G[110][110] = {};
int d[110] = {};
int main(){
    int n;
    cin >> n;
    memset(G,-1,sizeof(G));
    rep(i,n){
        int t,m;
        cin >> t >> m;
        rep(j,m){
            int a,b;
            cin >> a >> b;
            G[t][a] = b;
        }
    }

    rep(i,n) d[i] = 900010000;
    d[0] = 0;
    while(true){
        bool update = false;
        rep(i,n){
            rep(j,n){
                if(i==j) continue;
                if(G[i][j] != -1 && d[i] + G[i][j] < d[j]){
                    d[j] = d[i]+G[i][j];
                    update = true;
                }
            }
        }
        if(!update) break;
    }

    rep(i,n){
        cout << i << " " << d[i] << endl;
    }

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:37:5: error: 'memset' was not declared in this scope
   37 |     memset(G,-1,sizeof(G));
      |     ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include <cmath>
  +++ |+#include <cstring>
    9 | using namespace std;
Language: C++

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#include <cmath>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rREP(i, k, n) for (int i = (int)(n)-1; i >= k; i--)

#define debug(x) cerr<<#x<<": "<<x<<'\n'

#define fi first
#define se second

#define vi vector<int>
#define pb push_back
#define mp make_pair

#define pcnt __builtin_popcount

typedef long long ll;

const int inf = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

struct Edge{
    int to;
    int cost;
}
vector<int> G[110];
int d[110] = {};
int main(){
    int n;
    cin >> n;
    rep(i,n){
        int t,m;
        cin >> t >> m;
        rep(j,m){
            int a,b;
            cin >> a >> b;
            G[t].push_back({a,b})
        }
    }

    rep(i,n) d[i] = 900010000;
    d[0] = 0;
    while(true){
        bool update = false;
        rep(i,n){
            rep(j,G[i].size()){
                if(d[i] + G[i][j].cost < d[G[i][j].to]){
                    d[G[i][j].to] = d[i]+G[i][j].cost;
                    update = true;
                }
            }
        }
        if(!update) break;
    }

    rep(i,n){
        cout << i << " " << d[i] << endl;
    }

    return 0;
}



Compiler output:
a.cc:37:13: error: invalid declarator before 'G'
   37 | vector<int> G[110];
      |             ^
a.cc: In function 'int main()':
a.cc:48:13: error: 'G' was not declared in this scope
   48 |             G[t].push_back({a,b})
      |             ^
a.cc:57:19: error: 'G' was not declared in this scope
   57 |             rep(j,G[i].size()){
      |                   ^
a.cc:11:45: note: in definition of macro 'rep'
   11 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                                             ^
Language: C++

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#include <cmath>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rREP(i, k, n) for (int i = (int)(n)-1; i >= k; i--)

#define debug(x) cerr<<#x<<": "<<x<<'\n'

#define fi first
#define se second

#define vi vector<int>
#define pb push_back
#define mp make_pair

#define pcnt __builtin_popcount

typedef long long ll;

const int inf = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

struct Edge{
    int to;
    int cost;
}
vector<int> G[110];
int d[110] = {};
int main(){
    int n;
    cin >> n;
    rep(i,n){
        int t,m;
        cin >> t >> m;
        rep(j,m){
            int a,b;
            cin >> a >> b;
            G[t].push_back({a,b})
        }
    }

    rep(i,n) d[i] = 900010000;
    d[0] = 0;
    while(true){
        bool update = false;
        rep(i,n){
            for(const auto& e: G[i]){
                if(d[i] + e.cost < d[e.to]){
                    d[e.to] = d[i]+e.cost;
                    update = true;
                }
            }
        }
        if(!update) break;
    }

    rep(i,n){
        cout << i << " " << d[i] << endl;
    }

    return 0;
}



Compiler output:
a.cc:37:13: error: invalid declarator before 'G'
   37 | vector<int> G[110];
      |             ^
a.cc: In function 'int main()':
a.cc:48:13: error: 'G' was not declared in this scope
   48 |             G[t].push_back({a,b})
      |             ^
a.cc:57:32: error: 'G' was not declared in this scope
   57 |             for(const auto& e: G[i]){
      |                                ^
Language: C++

#include<iostream>

using namespace std;

static const int MAX = 100;
static const int INFTY = (1 << 21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;


int n, M[MAX][MAX];;

void dijkstra() {
  int minv;
  int d[MAX], color [MAX];

  for (int i = 0; i < n; i++) {
    d[i] = INFTY;
    color[i] = WHITE;
  }

  d[0] = 0;
  color[0] = GRAY;

  while (1) {
    minv = INFTY;
    int u = -1;
    for (int i = 0; i < n; i++) {
      if (minv > d[i] && color[i] != BLACK) {
        u = i;
        minv = d[i];
      }
    }
    if (u == -1) {
      break;
    }
    color[u] = BLACK;
    for (int v = 0; v < n; v++) {
      if (color[v] != BLACK && M[u][v] != INFTY) {
        if (d[v] > d[u] + M[u][v]) {
          d[v] = d[u] + M[u][v];
          color[v] = GRAY;
        }
      }
    }
  }

  for (int i = 0; i < n; i++) {
    cout << i << " " << (d[i] == INFTY ? -1 : d[i]) << endl
  }
}

int main() {
  cin >> n;

  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      M[i][j] = INFTY;
    }
  }

  int k, c, u, v;
  for (int i = 0; i < n; i++) {
    cin >> u >> k;
    for (int j = 0; j < k; j++) {
      cin >> v >> c;
      M[u][v] = c;
    }
  }

  dijkstra();

  return 0;
}


Compiler output:
a.cc: In function 'void dijkstra()':
a.cc:50:60: error: expected ';' before '}' token
   50 |     cout << i << " " << (d[i] == INFTY ? -1 : d[i]) << endl
      |                                                            ^
      |                                                            ;
   51 |   }
      |   ~
Language: C++

#include <iostream>
using namespace std;
static const int MAX =100;
static const int INFTY =(1<<21);
static const int WHITE =0;
static const int GRAY =1;
static const int BLACK =2;

int n, M[MAX][MAX];

int dijkstra(){
  int minv;
  int d[MAX],color[MAX];

  for(int i=0;i<n;i++){
    d[i]=INFTY;
    color[i]=WHITE;
  }
  d[0]=0;
  color[0]=GRAY;
  while(1){
    minv=INFTY;
    u=-1;
    for(int i=0;i<n;i++){
      if(minv>d[i] && color[i] !=BLACK){
        u=i;
        minv=d[i];
      }
    }
    if(u==-1)break;
    color[u]=BLACK;
    for(int v=0;v<n;v++){
      if(color[v] != BLACK && M[u][v]!=INFTY){
        if(d[v]> d[u]+M[u][v]){
          d[v]=d[u]+M[u][v];
          color[v]=GRAY;
        }
      }
    }
  }
  for(int i=0;i<n;i++){
    cout << i << " " << (d[i]==INFTY? -1:d[i]) << endl;
  }
}

int main(){
  cin >> n;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      M[i][j]=INFTY;
    }
  }
  int k,c,u,v;
  for(int i=0;i<n;i++){
    cin >> u >> k;
    for(int j=0;j<k;j++){
      cin >> v >> c;
      M[u][v]=c;
    }
  }

  dijkstra();
  return 0;
}


Compiler output:
a.cc: In function 'int dijkstra()':
a.cc:23:5: error: 'u' was not declared in this scope
   23 |     u=-1;
      |     ^
a.cc:44:1: warning: no return statement in function returning non-void [-Wreturn-type]
   44 | }
      | ^
Language: C++

#include <stdio.h>
using namespace std;
static const int MAX = 100;
static const int INFTY = (1<<21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;

int n, M[MAX][MAX];

int dijkstra(int s) {
    int d[n], p[n];
    int color[n];
    
    for(int i=0; i<n; i++) {
        color[i] = WHITE;
        d[i] = INFTY;
        p[i] = -1;
    }
    
    d[s] = 0;
    
    while(1) {
        int u;
        int mincost = INFTY;
        for (int i=0; i<n; i++) {
            if (color[i] != BLACK && d[i] < mincost) {
                mincost = d[i];
                u = i;
            }
        }
        
        if (mincost == INFTY) break;
        
        color[u] = BLACK;
        
        for (int v=0; v<=n; v++) {
            if (color[v] != BLACK && M[u][v] != INFTY) {
                if(d[u] + M[u][v] < d[v]) {
                    d[v] = d[u] + M[u][v];
                    p[v] = u;
                    color[v] = GRAY;
                }
            }
        }
    }
    
    int sum = 0;
    for (int i=0; i<n; i++) {
        sum += d[i];
    }
    return sum;
}

int main() {
    scanf("%d", &n);
    for (int i=0; i<n; i++) {
        for (int j=0; j<n; j++) {
            int tmp;
            scanf("%d", &tmp);
            M[i][j] = (tmp == -1) ? INFTY : tmp;
        }
    }
    
    int sum = dijkstra();
    printf("%d\n", sum);
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:23: error: too few arguments to function 'int dijkstra(int)'
   65 |     int sum = dijkstra();
      |               ~~~~~~~~^~
a.cc:11:5: note: declared here
   11 | int dijkstra(int s) {
      |     ^~~~~~~~
Language: C++

#include <stdio.h>
using namespace std;
static const int MAX = 100;
static const int INFTY = (1<<21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;

int n, M[MAX][MAX];
int d[n];

void dijkstra(int s) {
    int p[n];
    int color[n];
    
    for(int i=0; i<n; i++) {
        color[i] = WHITE;
        d[i] = INFTY;
        p[i] = -1;
    }
    
    d[s] = 0;
    
    while(1) {
        int u;
        int mincost = INFTY;
        for (int i=0; i<n; i++) {
            if (color[i] != BLACK && d[i] < mincost) {
                mincost = d[i];
                u = i;
            }
        }
        
        if (mincost == INFTY) break;
        
        color[u] = BLACK;
        
        for (int v=0; v<=n; v++) {
            if (color[v] != BLACK && M[u][v] != INFTY) {
                if(d[u] + M[u][v] < d[v]) {
                    d[v] = d[u] + M[u][v];
                    p[v] = u;
                    color[v] = GRAY;
                }
            }
        }
    }
}

int main() {
    scanf("%d", &n);
    for (int i=0; i<n; i++) {
        for (int j=0; j<n; j++) {
            int tmp;
            scanf("%d", &tmp);
            M[i][j] = (tmp == -1) ? INFTY : tmp;
        }
    }
    
    dijkstra(0);
    
    for(int i=0; i<n; i++) {
        printf("%d %d\n", i, d[i]);
    }
    
    return 0;
}


Compiler output:
a.cc:10:7: error: size of array 'd' is not an integral constant-expression
   10 | int d[n];
      |       ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int n;
vector<int> g[100];
vector<int> w[100];
int d[100];
char color[100];

void dijkstra() {
    d[0] = 0;
    color[0] = 'b';

    for (int k = 1; k < n; ++k) {
        int next;
        int mine = INT_MAX;
        for (int i = 0; i < n; ++i) {
            if (color[i] == 'b') {
                for (int j = 0; j < g[i].size(); ++j) {
                    if (d[i] + w[i].at(j) <= d[g[i].at(j)] && color[g[i].at(j)] == 'w') {
                        d[g[i].at(j)] = d[i] + w[i].at(j);
                        if (d[g[i].at(j)] <= mine) {
                            next = g[i].at(j);
                            mine = d[next];
                        }
                    }
                }
            }
        }
        color[next] = 'b';
        d[next] = mine;
    }
}

int main() {
    cin >> n;
    for (int i = 0; i < n; ++i) {
        int u;
        int k;
        cin >> u >> k;
        int v, c;
        for (int j = 0; j < k; ++j) {
            cin >> v >> c;
            g[u].push_back(v);
            w[u].push_back(c);
        }
    }
    for (int m = 0; m < n; ++m) {
        color[m] = 'w';
        d[m] = INT_MAX;
    }

    dijkstra();

    for (int l = 0; l < n; ++l) {
        cout << l << " " << d[l] << endl;
    }

    return 0;
}



Compiler output:
a.cc: In function 'void dijkstra()':
a.cc:18:20: error: 'INT_MAX' was not declared in this scope
   18 |         int mine = INT_MAX;
      |                    ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <vector>
  +++ |+#include <climits>
    3 | 
a.cc: In function 'int main()':
a.cc:52:16: error: 'INT_MAX' was not declared in this scope
   52 |         d[m] = INT_MAX;
      |                ^~~~~~~
a.cc:52:16: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include<iostream>
#include<cstdio>
#include<climits>
#include<cstring>
#define INF INT_MAX
using namespace std;
typedef unsigned long long ull;

 
void Init(int f){
  for(int i=0;i<=f+50;i++){
    for(int j=0;j<=f+50;j++)D[i][j] = INF;
  }
}
 
int main(){
int n;
int A[1000][1000];
ull D[1000][1000];
  scanf("%d",&n);
  int u,k,C,V;
  Init(n);
  
  for(int i=0;i<n;i++){
    scanf("%d %d",&u,&k);    
    for(int j=0;j<k;j++){
      scanf("%d %d",&V,&C);
      D[u][V] = C;
      D[V][u] = C;
    }    
  }
  
  for(int i=0;i<n;i++)D[i][i] = 0;
  for(int k=0;k<n;k++)for(int i=0;i<n;i++)for(int j=0;j<n;j++)D[i][j] = min(D[i][j],D[i][k] + D[k][j]);
  for(int i=0;i<n;i++){
    cout << i << " " << D[0][i] << endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'void Init(int)':
a.cc:12:29: error: 'D' was not declared in this scope
   12 |     for(int j=0;j<=f+50;j++)D[i][j] = INF;
      |                             ^
Language: C++

#include<cstdio>
#include<climits>
#include<cstring>
#define INF 1<<25
using namespace std;
typedef long ull;
 
int main(){
  int n;
  int A[1000][1000];
  ull D[1000][1000];
  scanf("%d",&n);
  int u,k,C,V;
  
  for(int i=0;i<=n;i++){
    for(int j=0;j<=n;j++)D[i][j] = INF;
  }
  
  for(int i=0;i<n;i++){
    scanf("%d %d",&u,&k);    
    for(int j=0;j<k;j++){
      scanf("%d %d",&V,&C);
      D[u][V] = C;
      D[V][u] = C;
    }    
  }
  
  for(int i=0;i<n;i++)D[i][i] = 0;
  for(int k=0;k<n;k++)for(int i=0;i<n;i++)for(int j=0;j<n;j++)D[i][j] = min(D[i][j],D[i][k] + D[k][j]);
  for(int i=0;i<n;i++){
    cout << i << " " << D[0][i] << endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:73: error: 'min' was not declared in this scope; did you mean 'main'?
   29 |   for(int k=0;k<n;k++)for(int i=0;i<n;i++)for(int j=0;j<n;j++)D[i][j] = min(D[i][j],D[i][k] + D[k][j]);
      |                                                                         ^~~
      |                                                                         main
a.cc:31:5: error: 'cout' was not declared in this scope
   31 |     cout << i << " " << D[0][i] << endl;
      |     ^~~~
a.cc:4:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<cstring>
  +++ |+#include <iostream>
    4 | #define INF 1<<25
a.cc:31:36: error: 'endl' was not declared in this scope
   31 |     cout << i << " " << D[0][i] << endl;
      |                                    ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include<cstring>
  +++ |+#include <ostream>
    4 | #define INF 1<<25
Language: C++

#include<cstdio>
#define INF 200001 
 
int main(){
 int u,k,C,V,A[1000][1000],D[1000][1000],n;
  scanf("%d",&n);
   for(int i=0;i<n;i++)for(int j=0;j<n;j++)D[i][j] = INF;
  for(int i=0;i<n;i++){
      scanf("%d %d",&u,&k);    
      for(int j=0;j<k;j++){
    scanf("%d %d",&V,&C);
    D[u][V] = C;
      }    
  }
  for(int i=0;i<n;i++)D[i][i] = 0;
  for(int k=0;k<n;k++)for(int i=0;i<n;i++)for(int j=0;j<n;j++)D[i][j]= min(D[i][j],D[i][k] + D[k][j]);
  for(int i=0;i<n;i++)printf("%d %d\n",i,D[0][i]);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:72: error: 'min' was not declared in this scope; did you mean 'main'?
   16 |   for(int k=0;k<n;k++)for(int i=0;i<n;i++)for(int j=0;j<n;j++)D[i][j]= min(D[i][j],D[i][k] + D[k][j]);
      |                                                                        ^~~
      |                                                                        main
Language: C++

#include<cstdio>
#include<iostream>
#define INF 200001 
 
int main(){
 int u,k,C,V,A[1000][1000],D[1000][1000],n;
  scanf("%d",&n);
   for(int i=0;i<n;i++)for(int j=0;j<n;j++)D[i][j] = INF;
  for(int i=0;i<n;i++){
      scanf("%d %d",&u,&k);    
      for(int j=0;j<k;j++){
    scanf("%d %d",&V,&C);
    D[u][V] = C;
      }    
  }
  for(int i=0;i<n;i++)D[i][i] = 0;
  for(int k=0;k<n;k++)for(int i=0;i<n;i++)for(int j=0;j<n;j++)D[i][j]= min(D[i][j],D[i][k] + D[k][j]);
  for(int i=0;i<n;i++)printf("%d %d\n",i,D[0][i]);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:72: error: 'min' was not declared in this scope; did you mean 'std::min'?
   17 |   for(int k=0;k<n;k++)for(int i=0;i<n;i++)for(int j=0;j<n;j++)D[i][j]= min(D[i][j],D[i][k] + D[k][j]);
      |                                                                        ^~~
      |                                                                        std::min
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:2:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
Language: C++

#include<iostream>
#include<cstdio>
#include<climits>
using namespace std;
 
#define N 1000000
int n;
 
int g[N][N];
 
int weight[N];
bool us[N];
 
//prim
void prim(){
 
  int v;
  
  weight[0]=0;
   
  while(true){
    v=-1;
    
    for(int i=0;i<n;i++){
      if(us[i]!=true && (v==-1 ||weight[i]<weight[v]))v=i;
    }
 
    if(v==-1)break;
    us[v]=true;
  
 
    for(int i=0;i<n;i++){
      if(weight[i]>(g[v][i]+weight[v])){
 
        weight[i]=(g[v][i]+weight[v]);
        //      cout <<"fsafa"<<endl;
      }
    }
  }
  
}
 
 
int main(){
 
  int u,k1,c,v;
 
  for(int i=0;i<N;i++){
    for(int j=0;j<N;j++){
      g[i][j]=9953535;
    }
  }
 
  //load n
  cin >>n;
 
  //load data
  for(int i=0;i<n;i++){
    weight[i]=INT_MAX;
    us[i]=false;
    scanf("%d %d",&u,&k1);
    for(int j=0;j<k1;j++){
      scanf("%d %d",&v,&c);
      g[u][v]=c;
      //    cout <<g[i][j]<<" ";
    }
    //    cout <<endl;
  }
 
 
 
 
  //print
  prim();
 
  for(int i=0;i<n;i++){
    cout <<i<<" "<<weight[i]<<endl;
  }
  return 0;
 
}

Compiler output:
/tmp/ccOJc1VN.o: in function `prim()':
a.cc:(.text+0x6): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccOJc1VN.o
a.cc:(.text+0x26): relocation truncated to fit: R_X86_64_PC32 against symbol `us' defined in .bss section in /tmp/ccOJc1VN.o
a.cc:(.text+0x4c): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccOJc1VN.o
a.cc:(.text+0x63): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccOJc1VN.o
a.cc:(.text+0x95): relocation truncated to fit: R_X86_64_PC32 against symbol `us' defined in .bss section in /tmp/ccOJc1VN.o
a.cc:(.text+0xb9): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccOJc1VN.o
a.cc:(.text+0xf7): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccOJc1VN.o
a.cc:(.text+0x13b): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccOJc1VN.o
a.cc:(.text+0x155): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccOJc1VN.o
/tmp/ccOJc1VN.o: in function `main':
a.cc:(.text+0x20c): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccOJc1VN.o
a.cc:(.text+0x21f): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status