criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.io.*;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.PriorityQueue;

class Main{
    
static final PrintWriter out=new PrintWriter(System.out);
static final int INF=Integer.MAX_VALUE/2;

public static class Edge{
int to;
int cost;
public Edge(int to){
this.to=to;
}
public Edge(int to,int cost){
this.to=to; this.cost=cost;
}
}

public static class Pair{
int x;
int y;
public Pair(int x,int y){
this.x=x; this.y=y;
}
static final Comparator<Pair> DISTANCE_ORDER=new Comp();
private static class Comp implements Comparator<Pair>{
public int compare(Pair p1,Pair p2){
return (p1.x>p2.x)?1:(p1.x<p2.x)?-1:0;
}
}

class MyArrayList extends ArrayList<Edge>{}

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int n=Integer.parseInt(line.split(" ")[0]);
int k=Integer.parseInt(line.split(" ")[1]);
int[] c=new int[n];
int[] d=new int[n];
int[] dist=new int[n];
boolean[] visited=new boolean[n];
boolean[][] cg=new boolean[n][n];
MyArrayList[] array=new MyArrayList[n];
for(int i=0;i<n;i++){
line=br.readLine();
c[i]=Integer.parseInt(line.split(" ")[0]);
d[i]=Integer.parseInt(line.split(" ")[1]);
array[i]=new MyArrayList();
}
MyArrayList[] carray=array.clone();
for(int i=0;i<k;i++){
line=br.readLine();
int a=Integer.parseInt(line.split(" ")[0]);
int b=Integer.parseInt(line.split(" ")[1]);
array[a-1].add(new Edge(b-1));
array[b-1].add(new Edge(a-1));
}
for(int i=0;i<n;i++) bfs(i,d[i],visited,cg,array);
for(int i=0;i<n;i++){
for(int j=0;j<n&&j!=i;j++){
if(cg[i][j]) carray[i].add(new Edge(j,c[i]));
}
}
dijkstra(dist,carray);
out.println(dist[n-1]);
out.flush();
}
}

public static void bfs(int s,int t,boolean[] visited,boolean[][] cg,MyArrayList[] array){
Arrays.fill(visited,false);
ArrayList<Edge> list;
Deque<Pair> que=new ArrayDeque<Pair>();
que.offerLast(new Pair(s,t));
while(!que.isEmpty()){
Pair p=que.pollFirst();
int ns=p.x;
int nt=p.y;
list=array[ns];
if(nt>=0||list.size()==0) continue;
visited[ns]=true;
for(int i=0;i<list.size();i++){
Edge e=list.get(i);
if(!visited[e.to]) que.offerLast(new Pair(e.to,nt-1));
}
}
}

public static void dijkstra(int[] dist,MyArrayList[] array){
PriorityQueue<Pair> pque=new PriorityQueue<Pair>(10,Pair.DISTANCE_ORDER);
Arrays.fill(dist,INF);
dist[0]=0;
pque.offer(new Pair(0,0));
while(!pque.isEmpty()){
Pair p=pque.poll();
int v=p.y;
ArrayList<Edge> list=array[v];
if(dist[v]<p.x||list.size()==0) continue;
for(int i=0;i<list.size();i++){
Edge e=list.get(i);
if(d[e.to]>d[v]+e.cost){
d[e.to]=d[v]+e.cost;
pque.offer(new Pair(d[e.to],e.to));
}
}
}
}
}

Compiler output:
Main.java:116: error: reached end of file while parsing
}
 ^
1 error
Language: Java

import java.io.*;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.PriorityQueue;

class Main{
    
static final PrintWriter out=new PrintWriter(System.out);
static final int INF=Integer.MAX_VALUE/2;

public static class Edge{
int to;
int cost;
public Edge(int to){
this.to=to;
}
public Edge(int to,int cost){
this.to=to; this.cost=cost;
}
}

public static class Pair{
int x;
int y;
public Pair(int x,int y){
this.x=x; this.y=y;
}
static final Comparator<Pair> DISTANCE_ORDER=new Comp();
private static class Comp implements Comparator<Pair>{
public int compare(Pair p1,Pair p2){
return (p1.x>p2.x)?1:(p1.x<p2.x)?-1:0;
}
}
}

public static class MyArrayList extends ArrayList<Edge>{}

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int n=Integer.parseInt(line.split(" ")[0]);
int k=Integer.parseInt(line.split(" ")[1]);
int[] c=new int[n];
int[] d=new int[n];
int[] dist=new int[n];
boolean[][] cg=new boolean[n][n];
MyArrayList[] array=new MyArrayList[n];
for(int i=0;i<n;i++){
line=br.readLine();
c[i]=Integer.parseInt(line.split(" ")[0]);
d[i]=Integer.parseInt(line.split(" ")[1]);
array[i]=new MyArrayList();
}
MyArrayList[] carray=array.clone();
for(int i=0;i<k;i++){
line=br.readLine();
int a=Integer.parseInt(line.split(" ")[0]);
int b=Integer.parseInt(line.split(" ")[1]);
array[a-1].add(new Edge(b-1));
array[b-1].add(new Edge(a-1));
}
for(int i=0;i<n;i++) bfs(i,d[i],visited,cg,array);
for(int i=0;i<n;i++){
for(int j=0;j<n&&j!=i;j++){
if(cg[i][j]) carray[i].add(new Edge(j,c[i]));
}
}
dijkstra(dist,carray);
out.println(dist[n-1]);
out.flush();
}
}

public static void bfs(int s,int t,boolean[][] cg,MyArrayList[] array){
Arrays.fill(visited,false);
ArrayList<Edge> list;
Deque<Pair> que=new ArrayDeque<Pair>();
que.offerLast(new Pair(s,t));
while(!que.isEmpty()){
Pair p=que.pollFirst();
int ns=p.x;
int nt=p.y;
list=array[ns];
if(nt<=0||list.size()==0) continue;
cg[s][ns]=true;
for(int i=0;i<list.size();i++){
Edge e=list.get(i);
if(!cg[s][e.to]) que.offerLast(new Pair(e.to,nt-1));
}
}
}

public static void dijkstra(int[] dist,MyArrayList[] array){
PriorityQueue<Pair> pque=new PriorityQueue<Pair>(10,Pair.DISTANCE_ORDER);
Arrays.fill(dist,INF);
dist[0]=0;
pque.offer(new Pair(0,0));
while(!pque.isEmpty()){
Pair p=pque.poll();
int v=p.y;
ArrayList<Edge> list=array[v];
if(dist[v]<p.x||list.size()==0) continue;
for(int i=0;i<list.size();i++){
Edge e=list.get(i);
if(dist[e.to]>dist[v]+e.cost){
dist[e.to]=dist[v]+e.cost;
pque.offer(new Pair(dist[e.to],e.to));
}
}
}
}
}

Compiler output:
Main.java:66: error: cannot find symbol
for(int i=0;i<n;i++) bfs(i,d[i],visited,cg,array);
                                ^
  symbol:   variable visited
  location: class Main
Main.java:79: error: cannot find symbol
Arrays.fill(visited,false);
            ^
  symbol:   variable visited
  location: class Main
2 errors
Language: Java

import java.io.*;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
 
class Main{
     
static final PrintWriter out=new PrintWriter(System.out);
static final int INF=Integer.MAX_VALUE;
 
public static class Edge{
int to;
int cost;
public Edge(int to){
this.to=to; cost=0;
}
public Edge(int to,int cost){
this.to=to; this.cost=cost;
}
}
 
public static class Pair{
int x;
int y;
public Pair(int x,int y){
this.x=x; this.y=y;
}
public static final Comparator<Pair> DISTANCE_ORDER=new Comp();
private static class Comp implements Comparator<Pair>{
public int compare(Pair p1,Pair p2){
return (p1.x>p2.x)?1:(p1.x<p2.x)?-1:0;
}
}
}
 
public static class MyArrayList extends ArrayList<Edge>{}
 
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st;
int n=Integer.parseInt(line.split(" ")[0]);
int k=Integer.parseInt(line.split(" ")[1]);
int[] c=new int[n];
int[] r=new int[n];
int[] dist=new int[n];
boolean[][] visited=new boolean[n][n];
MyArrayList[] array=new MyArrayList[n];
for(int i=0;i<n;i++){
st=new StringTokenizer(br.readLine());
c[i]=Integer.parseInt(st.nextToken());
r[i]=Integer.parseInt(st.nextToken());
array[i]=new MyArrayList();
}
MyArrayList[] carray=array.clone();
for(int i=0;i<k;i++){
st=new StringTokenizer(br.readLine());
int a=Integer.parseInt(st.nextToken())-1;
int b=Integer.parseInt(st.nextToken())-1;
array[a].add(new Edge(b));
array[b].add(new Edge(a));
}
for(int i=0;i<n;i++){
bfs(i,r[i],visited,array);
for(int j=0;j<n&&j!=i;j++){
if(visited[i][j]) carray[i].add(new Edge(j,c[i]));
}
}
dijkstra(dist,carray);
out.println(dist[n-1]);
out.flush();
}
 
public static void bfs(int s,int t,boolean[][] visited,MyArrayList[] array){
Arrays.fill(visited[s],false);
Deque<Pair> que=new ArrayDeque<Pair>();
que.offerLast(new Pair(s,t));
while(!que.isEmpty()){
Pair p=que.pollFirst();
int ns=p.x;
if(visited[s][ns]) continue;
visited[s][ns]=true;
ArrayList<Edge> list=array[ns];
if(p.y<=0) continue;
for(int i=0;i<list.size();i++){
Edge e=list.get(i);
if(visited[s][e.to]) continue;
que.offerLast(new Pair(e.to,p.y-1));
}
}
}
 
public static void dijkstra(int[] dist,MyArrayList[] array){
PriorityQueue<Pair> pque=new PriorityQueue<Pair>(1,Pair.DISTANCE_ORDER);
Arrays.fill(dist,INF);
dist[0]=0;
pque.offer(new Pair(0,0));
while(!pque.isEmpty()){
Pair p=pque.poll();
int v=p.y;
ArrayList<Edge> list=array[v];
if(dist[v]<p.x||list.size()==0) continue;
for(int i=0;i<list.size();i++){
Edge e=list.get(i);
if(dist[e.to]>dist[v]+e.cost){
dist[e.to]=dist[v]+e.cost;
pque.offer(new Pair(dist[e.to],e.to));
}
}
}
}
}

Compiler output:
Main.java:45: error: cannot find symbol
int n=Integer.parseInt(line.split(" ")[0]);
                       ^
  symbol:   variable line
  location: class Main
Main.java:46: error: cannot find symbol
int k=Integer.parseInt(line.split(" ")[1]);
                       ^
  symbol:   variable line
  location: class Main
2 errors
Language: Java

import java.io.*;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
 
class Main{

static final int INF=Integer.MAX_VALUE;

public static class Edge{
int to;
int cost;
public Edge(int to){
this.to=to; cost=0;
}
public Edge(int to,int cost){
this.to=to; this.cost=cost;
}
}
 
public static class Pair{
int x;
int y;
public Pair(int x,int y){
this.x=x; this.y=y;
}
public static final Comparator<Pair> DISTANCE_ORDER=new Comp();
private static class Comp implements Comparator<Pair>{
public int compare(Pair p1,Pair p2){
return (p1.x>p2.x)?1:(p1.x<p2.x)?-1:0;
}
}
}
 
public static class MyArrayList extends ArrayList<Edge>{}
 
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st;
int n=Integer.parseInt(line.split(" ")[0]);
int k=Integer.parseInt(line.split(" ")[1]);
int[] c=new int[n];
int[] r=new int[n];
int[] dist=new int[n];
boolean[][] visited=new boolean[n][n];
MyArrayList[] array=new MyArrayList[n];
for(int i=0;i<n;i++){
st=new StringTokenizer(br.readLine());
c[i]=Integer.parseInt(st.nextToken());
r[i]=Integer.parseInt(st.nextToken());
array[i]=new MyArrayList();
}
MyArrayList[] carray=array.clone();
for(int i=0;i<k;i++){
st=new StringTokenizer(br.readLine());
int a=Integer.parseInt(st.nextToken())-1;
int b=Integer.parseInt(st.nextToken())-1;
array[a].add(new Edge(b));
array[b].add(new Edge(a));
}
for(int i=0;i<n;i++){
bfs(i,r[i],visited,array);
for(int j=0;j<n&&j!=i;j++){
if(visited[i][j]) carray[i].add(new Edge(j,c[i]));
}
}
dijkstra(dist,carray);
System.out.println(dist[n-1]);
}
 
public static void bfs(int s,int t,boolean[][] visited,MyArrayList[] array){
Arrays.fill(visited[s],false);
Deque<Pair> que=new ArrayDeque<Pair>();
que.offerLast(new Pair(s,t));
while(!que.isEmpty()){
Pair p=que.pollFirst();
int ns=p.x;
if(visited[s][ns]) continue;
visited[s][ns]=true;
ArrayList<Edge> list=array[ns];
if(p.y<=0) continue;
for(int i=0;i<list.size();i++){
Edge e=list.get(i);
if(visited[s][e.to]) continue;
que.offerLast(new Pair(e.to,p.y-1));
}
}
}
 
public static void dijkstra(int[] dist,MyArrayList[] array){
PriorityQueue<Pair> pque=new PriorityQueue<Pair>(1,Pair.DISTANCE_ORDER);
Arrays.fill(dist,INF);
dist[0]=0;
pque.offer(new Pair(0,0));
while(!pque.isEmpty()){
Pair p=pque.poll();
int v=p.y;
ArrayList<Edge> list=array[v];
if(dist[v]<p.x||list.size()==0) continue;
for(int i=0;i<list.size();i++){
Edge e=list.get(i);
if(dist[e.to]>dist[v]+e.cost){
dist[e.to]=dist[v]+e.cost;
pque.offer(new Pair(dist[e.to],e.to));
}
}
}
}
}

Compiler output:
Main.java:44: error: cannot find symbol
int n=Integer.parseInt(line.split(" ")[0]);
                       ^
  symbol:   variable line
  location: class Main
Main.java:45: error: cannot find symbol
int k=Integer.parseInt(line.split(" ")[1]);
                       ^
  symbol:   variable line
  location: class Main
2 errors
Language: C++

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

using namespace std;

struct T{
  int v,r;
};

struct S{
  int v,c,r;
  bool operator<(S s)const{
    return c>s.c;
  }
};

int N,K;
int C[5001],R[5001];
vector<int> G[5001];

int main(){
  cin>>N>>K;
  for(int i=1;i<=N;i++){
    cin>>C[i]>>R[i];
  }
  while(K--){
    int A,B;
    cin>>A>>B;
    G[A].push_back(B);
    G[B].push_back(A);
  }
  priority_queue<S> que;
  que.push({1,0,0});
  static bool mem[5001][5001];
  for(;;){
    S cs=que.top();
    if(cs.v==N)break;
    que.pop();
    if(mem[cs.v][cs.r]++)continue;
    que.push({cs.v,cs.c+C[cs.v],R[cs.v]});
    if(cs.r){
      for(auto e:H[cs.v]){
	que.push({e,cs.c+C[cs.v],cs.r-1});
      }
    }
  }
  cout<<que.top().c<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:22: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   41 |     if(mem[cs.v][cs.r]++)continue;
      |        ~~~~~~~~~~~~~~^
a.cc:44:18: error: 'H' was not declared in this scope
   44 |       for(auto e:H[cs.v]){
      |                  ^
a.cc:45:17: error: no matching function for call to 'std::priority_queue<S>::push(<brace-enclosed initializer list>)'
   45 |         que.push({e,cs.c+C[cs.v],cs.r-1});
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_queue.h:736:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = S; _Sequence = std::vector<S, std::allocator<S> >; _Compare = std::less<S>; value_type = S]'
  736 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:736:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::priority_queue<S>::value_type&' {aka 'const S&'}
  736 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_queue.h:744:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(value_type&&) [with _Tp = S; _Sequence = std::vector<S, std::allocator<S> >; _Compare = std::less<S>; value_type = S]'
  744 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:744:25: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::priority_queue<S>::value_type&&' {aka 'S&&'}
  744 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <cstring>
#include <cmath>
#include <deque>
#include <set>
#include <climits>

#define rep_(v, f, l) for (auto v = (f); v != (l); ++v)
#define rep(v, n) rep_(v, 0, n)
#define lep(v, o) rep_(v, o.begin(), o.end())

const long long INF = LLONG_MAX;

using namespace std;

typedef long long int lint;

template<typename T> inline bool in(T& x){ return cin >> x; }
template<typename T> inline T in(){T x; cin >> x; return x; }

typedef long long int Weight;
struct Edge {
	int src, dst;
	Weight weight;
	Edge(int src, int dst, Weight weight) : src(src), dst(dst), weight(weight) {}
};
bool operator < (const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight :
		e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

void shortestPath(const Graph &g, int s, vector<Weight> &dist, vector<int> &prev){
	int n = g.size();
	dist.assign(n, INF); dist[s] = 0;
	prev.assign(n, -1);
	priority_queue<Edge> Q;
	for (Q.push(Edge(-2, s, 0)); !Q.empty();){
		Edge e = Q.top(); Q.pop();
		if (prev[e.dst] != -1) continue;
		prev[e.dst] = e.src;
		lep(f, g[e.dst]){
			if (dist[f->dst] > e.weight + f->weight){
				dist[f->dst] = e.weight + f->weight;
				Q.push(Edge(f->src, f->dst, e.weight + f->weight));
			}
		}
	}
}

struct Taxi {
	int val, len;
	Taxi(int val, int len) : val(val), len(len) {}
};

void dfs(const Graph& g, Graph& G, int s, int d, int val, int len, int *vis)
{
	if (len == -1) return;
	if (vis[d]) return;
	vis[d] = 1;
	if (s != d){
		G[s].push_back(Edge(s, d, val));
	}
	lep(e, g[d]){
		dfs(g, G, s, e->dst, val, len - 1, vis);
	}
	vis[d] = 0;
}
int main()
{
	int N, K;
	in(N), in(K);

	vector<Taxi> taxi;
	rep(i, N){
		int val, len;
		in(val), in(len);
		taxi.push_back(Taxi(val, len));
	}
	Graph g(N), G(N);
	rep(i, K){
		int from, to;
		in(from), in(to);
		from--, to--;
		g[from].push_back(Edge(from, to, 0));
		g[to].push_back(Edge(to, from, 0));
	}

	vector<Weight> w;
	vector<int> prev;

	int vis[N] = {0};
	rep(i, N){
		dfs(g, G, i, i, taxi[i].val, taxi[i].len, vis);
		memset(vis, 0, sizeof(vis));
	}

	shortestPath(G, 0, w, prev);
	printf("%lld\n", w[N - 1]); 

	return (0);
}

Compiler output:
a.cc: In instantiation of 'bool in(T&) [with T = int]':
a.cc:80:4:   required from here
   80 |         in(N), in(K);
      |         ~~^~~
a.cc:25:58: error: cannot convert 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'bool' in return
   25 | template<typename T> inline bool in(T& x){ return cin >> x; }
      |                                                          ^
In file included from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_ios.h:121:16: note: explicit conversion function was not considered
  121 |       explicit operator bool() const
      |                ^~~~~~~~
Language: C++

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define INF 999999999

vector<int> pass[6000];
int n,k;
int c[6000],r[6000];

int d[6000];
bool used[6000];

void dfs(int v,int u,int f,int end,bool visited[6000]){
    if(visited[u])return ;
    visited[u] = true;
    d[u] = min(d[u],d[v]+c[v]);
    if(f>=end)return ;
    rep(i,pass[u].size()){
        dfs(v,pass[u][i],f+1,end,visited);
    }
}

int dijk(int s,int g){
    rep(i,6000)d[i]=INF;
    rep(i,6000)used[i]=false;
    
    d[s]=0;
    while(1){
        int v=-1;
        rep(u,n){
            if(!used[u] && (v==-1||d[u]<d[v]))v=u;
        }
        if(v==-1)break;
        used[v]=true;
        rep(i,pass[v].size()){
            bool visited[6000]={};
            dfs( v,pass[v][i],1,r[v],visited );
        }
    }
    return d[g];
}


int main(){
    cin>>n>>k;
    rep(i,n) cin>>c[i]>>r[i];
    rep(i,k){
        int a,b;
        cin>>a>>b;
        a--,b--;
        pass[a].pb(b);
        pass[b].pb(a);
    }
    
    cout<<dijk(0,n-1)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:17: error: 'class std::vector<int>' has no member named 'pb'
   52 |         pass[a].pb(b);
      |                 ^~
a.cc:53:17: error: 'class std::vector<int>' has no member named 'pb'
   53 |         pass[b].pb(a);
      |                 ^~
Language: C++

#include <queue>
#include <vector>
#include <utility>
#include <iostream>

using namespace std;

#define INF   (1 << 30)
#define WHITE  0
#define GRAY   1
#define BLACK  2

int main()
{
	int N, K, A, B;

	cin >> N >> K;

	vector<int> C(N + 1);
	vector<int> R(N + 1);
	vector<int> S(N + 1);
	vector<int> D(N + 1);
	vector<int> P(N + 1);

	vector<vector<bool> > M1(N + 1, vector<bool>(N + 1, false));
	vector<vector<int> > M2(N + 1, vector<int>(N + 1, INF));

	for (int i = 1; i <= N; i++)
		cin >> C[i] >> R[i];

	for (int i = 1; i <= K; i++)
	{
		cin >> A >> B;

		M1[A][B] = true;
		M1[B][A] = true;
	}

	for (int i = 1; i <= N; i++)
	{
		if (R[i] < N - 1)
		{
			queue<pair<int, short> > que;

			pair<int, short> start;

			start.first = i;
			start.second = (short)0;

			que.push(start);

			while (!que.empty() && que.front().second < R[i])
			{
				pair<int, short> p1 = que.front(); que.pop();

				for (int j = 1; j <= N; j++)
				{
					if (M1[p1.first][j] == true && M2[i][j] == INF)
					{
						pair<int, short> p2;

						p2.first = j;
						p2.second = p1.second + (short)1;

						que.push(p2);

						M2[i][p2.first] = C[i];
					}
				}
			}
		}
		else
		{
			for (int j = 1; j <= N; j++)
			{
				if (i != j)
				{
					M2[i][j] = C[i];
				}
			}
		}
	}

	for (int i = 0; i < MAX_N; i++)
	{
		S[i] = WHITE; D[i] = INF; P[i] = INF;
	}

	D[1] = 0;
	P[1] = -1;

	while (true)
	{
		int mincost = INF;

		int u = -1;

		for (int i = 1; i <= N; i++)
		{
			if (S[i] != BLACK && D[i] < mincost)
			{
				mincost = D[i];

				u = i;
			}
		}

		if (mincost == INF) { break; }

		S[u] = BLACK;

		for (int v = 1; v <= N; v++)
		{
			if (S[v] != BLACK && M2[u][v] != INF)
			{
				if (D[u] + M2[u][v] < D[v])
				{
					D[v] = D[u] + M2[u][v];
					P[v] = u;
					S[u] = GRAY;
				}
			}
		}
	}

	cout << D[N] << endl;

	return 0;
}

// Time : O ( N ^ 2 )

Compiler output:
a.cc: In function 'int main()':
a.cc:84:29: error: 'MAX_N' was not declared in this scope
   84 |         for (int i = 0; i < MAX_N; i++)
      |                             ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <climits>
using namespace std;
 
int n,k;
vector<int> c,r,result;
vector<bool> p, notv;
priority_queue<pair<int,int>, vector<pair<int,int>>, greater<pair<int,int>>> q;

void addRoute(int now, int remain, int cost){
	notv[i] = false;
	if(remain){
		for(int i=0; i<n; i++){
			if(p[now+i*n] && notv[i]){
				if(result[i] > cost){
					q.push(make_pair(cost,i));
				}
				addRoute(i, remain-1, cost);
			}
		}
	}
}
int main(){
	cin>>n>>k;
	c.resize(n);
	r.resize(n);
	p.assign(n*n,false);
	for(int i=0; i<n; i++){
		cin>>c[i]>>r[i];
	}
	for(int i=0; i<k; i++){
		int a,b;
		cin>>a>>b;
		p[(a-1)+n*(b-1)] = p[(b-1)+n*(a-1)] = true;
	}
	result.assign(n,INT_MAX);
	q.push(make_pair(0,0));
	for(;q.size();){
		int cost = q.top().first;
		int now = q.top().second;
		q.pop();
		if(cost < result[now]){
			result[now] = cost;
			notv.assign(n,true);
			addRoute(now, r[now], c[now] + cost);
		}
	}
	cout<<result[n-1]<<endl;
}

Compiler output:
a.cc: In function 'void addRoute(int, int, int)':
a.cc:13:14: error: 'i' was not declared in this scope
   13 |         notv[i] = false;
      |              ^
Language: C++

#include <iostream>
#include <queue>
#include <vector>
#include <set>

using namespace std;

const int INF = 1000000007;

class V
{
public:
	V(){dj=INF;visited=false;}
	unordered_set<int> graph;
	unordered_set<int> graph2;
	int cost;
	int dj;
	int num;
	bool visited;
};

V v[5000];

int main()
{
	int n, k;
	cin >> n >> k;
	v[0].dj=0;
	for(int i=0;i<n;i++)
		cin >> v[i].cost >> v[i].num;
	for(int i=0;i<k;i++)
	{
		int a, b;
		cin >> a >> b;
		v[a-1].graph.insert(b-1);
		v[b-1].graph.insert(a-1);
	}
	
	for(int i=0;i<n;i++)
	{
		queue< pair<int, int> > q;
		q.push(pair<int, int>(i, v[i].num));
		while(!q.empty())
		{
			pair<int, int> p = q.front();q.pop();
			v[i].graph2.insert(p.first);
			if(p.second)
			{
				for(set<int>::iterator it=v[p.first].graph.begin();it!=v[p.first].graph.end();it++)
				{
					q.push(pair<int, int>((*it), p.second-1));
				}
			}
		}
	}
	
	int now=0;
	do
	{
		int mini = INF;
		int nextSearch = -1;
		v[now].visited=true;
		for(int i=0;i<n;i++)
		{
			if((!v[i].visited)&&(v[now].graph2.find(i)!=v[now].graph2.end())&&(v[now].dj+v[now].cost<v[i].dj))
			{
				int n=v[now].dj+v[now].cost;
				v[i].dj=n;
			}
			if((!v[i].visited)&&(v[i].dj<mini))
			{
				mini = v[i].dj;
				nextSearch=i;
			}
		}
		now = nextSearch;
	}while (now != -1);
	cout << v[n-1].dj << endl;
	return 0;
}

Compiler output:
a.cc:14:9: error: 'unordered_set' does not name a type
   14 |         unordered_set<int> graph;
      |         ^~~~~~~~~~~~~
a.cc:15:9: error: 'unordered_set' does not name a type
   15 |         unordered_set<int> graph2;
      |         ^~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:35:24: error: 'class V' has no member named 'graph'
   35 |                 v[a-1].graph.insert(b-1);
      |                        ^~~~~
a.cc:36:24: error: 'class V' has no member named 'graph'
   36 |                 v[b-1].graph.insert(a-1);
      |                        ^~~~~
a.cc:46:30: error: 'class V' has no member named 'graph2'
   46 |                         v[i].graph2.insert(p.first);
      |                              ^~~~~~
a.cc:49:70: error: 'class V' has no member named 'graph'
   49 |                                 for(set<int>::iterator it=v[p.first].graph.begin();it!=v[p.first].graph.end();it++)
      |                                                                      ^~~~~
a.cc:49:99: error: 'class V' has no member named 'graph'
   49 |                                 for(set<int>::iterator it=v[p.first].graph.begin();it!=v[p.first].graph.end();it++)
      |                                                                                                   ^~~~~
a.cc:65:53: error: 'class V' has no member named 'graph2'
   65 |                         if((!v[i].visited)&&(v[now].graph2.find(i)!=v[now].graph2.end())&&(v[now].dj+v[now].cost<v[i].dj))
      |                                                     ^~~~~~
a.cc:65:76: error: 'class V' has no member named 'graph2'
   65 |                         if((!v[i].visited)&&(v[now].graph2.find(i)!=v[now].graph2.end())&&(v[now].dj+v[now].cost<v[i].dj))
      |                                                                            ^~~~~~
Language: C++

#include <queue>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int V, E, s, t, w[5003], r[5003], d[5003]; vector<int> G[5003], H[5003];
int main() {
	scanf("%d%d", &V, &E);
	for(int i = 0; i < V; i++) scanf("%d%d", &s, &t);
	for(int i = 0; i < E; i++) {
		scanf("%d%d", &s, &t); s--, t--;
		G[s].push_back(t);
		G[t].push_back(s);
	}
	for(int i = 0; i < V; i++) {
		fill(d, d + V, -1); d[i] = 0; H[i].push_back(i);
		queue<int> que; que.push(i);
		while(!que.empty()) {
			int u = que.front(); que.pop();
			for(auto &e : G[u]) {
				if(d[e] == -1) {
					d[e] = d[u] + 1;
					H[i].push_back(e);
					if(d[e] != r[i]) que.push(e);
				}
			}
		}
	}
	fill(d, d + V, 1999999999);
	priority_queue<pair<int, int> > que2; que2.push(make_pair(0, 0));
	while(!que.empty()){
		int u = que.top().second; que.pop();
		if(u == V - 1) { printf("%d\n", d[u]); break; }
		for(auto &e : H[u]) {
			if(d[e] > d[u] + w[u]) {
				d[e] = d[u] + w[u];
				que.push(make_pair(-d[e], e));
			}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:16: error: 'que' was not declared in this scope; did you mean 'que2'?
   31 |         while(!que.empty()){
      |                ^~~
      |                que2
Language: C++


#include <stdio.h>
#include <vector>
#include <queue>
#include <functional>
#include <utility>

#define MAX_N 5000

using namespace std;

struct edge { int to, cost; };

vector<edge> graph[MAX_N];
vector<int> simpg[MAX_N];
bool bfsflag[MAX_N];
int dist[MAX_N];
int n, k;
int c[MAX_N], r[MAX_N];

using P = pair<int, int>;

void dijkstra(int start)
{
	for (int a = 0; a < n; ++a)dist[a] = INT_MAX - 100000;
	dist[start] = 0;
	priority_queue<P, vector<P>, greater<P>>que;
	que.push(P(0,start));
	while (!que.empty())
	{
		P p = que.top(); que.pop();
		if (dist[p.second] < p.first)continue;
		for (edge e : graph[p.second])
		{
			if (dist[e.to] > dist[p.second] + e.cost)
			{
				dist[e.to] = dist[p.second] + e.cost;
				que.push(P(dist[e.to],e.to));
			}
		}
	}
}


int main()
{
	scanf("%d %d", &n, &k);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d %d", &c[i], &r[i]);
	}
	for (int j = 0; j < k; ++j)
	{
		int a, b;
		scanf("%d %d", &a, &b);
		simpg[a - 1].push_back(b - 1);
		simpg[b - 1].push_back(a - 1);
	}
	for (int i = 0; i < n; ++i)
	{
		memset(bfsflag,false,sizeof(bfsflag));
		bfsflag[i] = true;
		queue<int> bfs;
		bfs.push(i);
		for (int j = 0; j < r[i]; ++j)//?
		{
			if (bfs.empty())break;
			int v = bfs.front(); bfs.pop();
			for (int cv : simpg[v])
			{
				if (!bfsflag[cv])
				{
					bfsflag[cv] = true;
					bfs.push(cv);
					graph[i].push_back({ cv, c[i]});
				}
			}
		}
	}
	dijkstra(0);
	printf("%d\n", dist[n - 1]);
}

Compiler output:
a.cc: In function 'void dijkstra(int)':
a.cc:25:46: error: 'INT_MAX' was not declared in this scope
   25 |         for (int a = 0; a < n; ++a)dist[a] = INT_MAX - 100000;
      |                                              ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <utility>
  +++ |+#include <climits>
    7 | 
a.cc: In function 'int main()':
a.cc:61:17: error: 'memset' was not declared in this scope
   61 |                 memset(bfsflag,false,sizeof(bfsflag));
      |                 ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <utility>
  +++ |+#include <cstring>
    7 |
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
const int INF = 1e9;

int n, k; //????????° ???????????¬??°
int c[5010], r[5010]; //???????????£?¶???????????????????????????¬??°
vector<int> d[5010];//???????????£??\
int G[5010][5010];//r?????¶???????????????????????????????????£??\???????????§?¨????

int dist[5010]; //0->i??????????°??????????
bool used[5010]; //?????£??????????¨????

void dijkstra(int start){
	rep(i, n) dist[i] = INF;//?????????
	dist[start] = 0;
	while(1){
		int v = -1;
		//???????????????????????????????????????????????¢???????°???????????????¢???
		for (int u = 0; u < n; ++u){
			if(!used[u] && (v == -1 || dist[u] < dist[v])) v = u;
		}
		//?????????????????¢???????°???????????????????v???
		if(v == -1) break;
		used[v] = true;//?????¨??????
		for (int u = 0; u < n; ++u){
			dist[u] = min(dist[u], dist[v] + G[v][u]);//??????????????£??\????????????G?????¨??§?????????
		}
	}
}

int main(void){
	cin >> n >> k;
	rep(i, n) cin >> c[i] >> r[i];
	rep(i, k){
		int a, b; cin >> a >> b;
		a--; b--;
		d[a].push_back(b);
		d[b].push_back(a);
	}

	rep(i, 5010)rep(j, 5010) G[i][j] = INF;
	//???????????¢?´¢?????¨?????????i???->j?????????????????¨?????§?????????????¨?????????????
	for (int i = 0; i < n; ++i){
		queue<pair<int, int> > q; q.push(make_pair(i, 0));//<???, ?????¬???>
		int cnt = 0;
		while(!q.empty()){
			auto now = q.front(); q.pop();
			if(now.second >= r[i]) continue;
			for(auto j : d[now.first]){
				q.push(make_pair(j, now.second + 1));
				G[i][j] = c[i];//??£??\??????????????£????????????????¨????
			}
		}
	}
	dijkstra(0);
	printf("%d\n", dist[n - 1]);
}

Compiler output:
a.cc: In function 'void dijkstra(int)':
a.cc:31:58: error: 'G' was not declared in this scope
   31 |                         dist[u] = min(dist[u], dist[v] + G[v][u]);//??????????????£??\????????????G?????¨??§?????????
      |                                                          ^
a.cc: In function 'int main()':
a.cc:46:34: error: 'G' was not declared in this scope
   46 |         rep(i, 5010)rep(j, 5010) G[i][j] = INF;
      |                                  ^
a.cc:56:33: error: 'G' was not declared in this scope
   56 |                                 G[i][j] = c[i];//??£??\??????????????£????????????????¨????
      |                                 ^
Language: C++

#include<iostream>
#include<queue>
#include<vector>
#include<map>
using namespace std;
bool used[5005];
int town[5005][2];//??????????????¢
vector<int> v1[5005];
vector<pair<int,int> > v2[5005];
queue<int> bfs;
priority_queue<pair<int,int>,vector<pair<int,int> >,greater<pair<int,int> > > q1;

int main(){
	int n,m;
	int i,j,k,l;
	int a,b,c;
	cin>>n>>m;
	for(i=0;i<n;i++){
		cin>>town[i][0]>>town[i][1];
	}
	for(i=0;i<m;i++){
		cin>>a>>b;
		a--,b--;
		v1[a].push_back(b);
		v1[b].push_back(a);
	}
	for(i=0;i<n;i++){
		for(j=0;j<v1[i].size();j++){
			bfs.push(v1[i][j]);
		}
		used[i]=true;
		for(j=0;j<town[i][1];j++){
			c=bfs.size();
			for(k=0;k<c;k++){//
				a=bfs.front(),bfs.pop();
				if(used[a])continue;
				used[a]=true;
				v2[i].push_back(make_pair(a,town[i][0]));
				for(l=0;l<v1[a].size();l++){
					if(used[v1[a][l]])continue;
					bfs.push(v1[a][l]);
				}
			}
		}
		memset(used,false,sizeof(used));
		while(!bfs.empty()){bfs.pop();}
	}
	q1.push(make_pair(0,0));
	while(!q1.empty()){
		a=q1.top().first,b=q1.top().second,q1.pop();
		if(b==n-1)break;
		if(used[b])continue;
		used[b]=true;
		for(i=0;i<v2[b].size();i++){
			if(used[v2[b][i].first])continue;
			q1.push(make_pair(v2[b][i].second+a,v2[b][i].first));
		}
	}
	cout<<a<<endl;
	return 0;
}

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

#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
typedef int ll;
typedef pair<ll,ll> P;
typedef double db;
const ll INF = 0xfffffff;
ll n,k;
ll c[5000],r[5000];
ll d[5000];
ll a[10000],b[10000];
ll tmax[5000];
vector<ll> G[5000];
priority_queue<P,vector<P>,greater<P> > q;queue<P> q2;
int main()
{
	scanf("%d%d",&n,&k);
	for(ll i=0;i<n;i++) scanf("%d%d",&c[i],&r[i]);
	for(ll i=0;i<k;i++){
		scanf("%d%d",&a[i],&b[i]);
		a[i]--;
		b[i]--;
		G[a[i]].push_back(b[i]);
		G[b[i]].push_back(a[i]);
	}
	fill(d,d+n,INF);
	d[0]=0;
	tmax[0]=0;
	q.push(P(d[0]+c[0],0));
	while(!q.empty()){
		P p=q.top();
		q.pop();
		if(d[p.second]+c[p.second]<p.first) continue;
		q2.push(P(p.second,r[p.second]));
		while(!q2.empty()){
			P t=q2.front();
			q2.pop();
			if(d[t.first]>p.first){
				d[t.first]=p.first;
				tmax[t.first]=t.second;
				q.push(P(d[t.first]+c[t.first],t.first));
			}
			if(t.second) for(ll i=0;i<G[x].size();++i) if(d[G[t.first][i]]>p.first||tmax[G[t.first][i]]<t.second-1) q2.push(P(G[t.first][i],t.second-1));
		}
	}
	printf("%d\n",d[n-1]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:53: error: 'x' was not declared in this scope
   51 |                         if(t.second) for(ll i=0;i<G[x].size();++i) if(d[G[t.first][i]]>p.first||tmax[G[t.first][i]]<t.second-1) q2.push(P(G[t.first][i],t.second-1));
      |                                                     ^
Language: C++

#include <cstdio>
#include <stack>
#include <map>
#include <queue>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <bitset>
#include <math.h>
#include <stdio.h>
#include <queue>
#define F first
#define S second
#define MP make_pair
#define INF 1e9
#define MOD 1000000007
using namespace std;
typedef long long LL;
typedef pair<LL, LL> P;
typedef pair<P, P> PP;

inline int in() {
	int temp = 0;
	scanf("%d", &temp);
	return temp;
}

int n = in(), k = in();
P taxi[5001];
vector<int> road[5001];
int town[5001];
priority_queue<P> pq;
bool flag[5001];
void bfs(int s, int mey)
{
	memset(flag, 0, sizeof(flag));
	queue<P> que;
	mey -= taxi[s].S;
	que.push(MP(s, 0));
	flag[s] = true;
	while (!que.empty()) {
		P p = que.front();
		que.pop();
		if (p.S == taxi[s].F)
		{
			continue;
		}
		for (int i = 0; i < road[p.F].size(); i++)
		{
			if (!flag[road[p.F][i]])
			{
				if (town[road[p.F][i]] < mey)
				{
					town[road[p.F][i]] = mey;
					pq.push(MP(mey, road[p.F][i]));
				}

				que.push(MP(road[p.F][i], p.S + 1));
				flag[road[p.F][i]] = true;
			}
		}
	}
}

void dijkstra()
{
	pq.push(MP(0, 1));
	while (!pq.empty())
	{
		P p = pq.top();
		pq.pop();
		bfs(p.S, p.F);
	}
}
int main()
{
	for (int i = 1; i <= n; i++)
	{
		taxi[i] = make_pair(in(), in());
	}
	for (int i = 0; i < k; i++)
	{
		int a = in(), b = in();
		road[a].push_back(b);
		road[b].push_back(a);
	}
	fill(town, town + 5001, -INF);
	dijkstra();
	cout << -town[n] << endl;
}

Compiler output:
a.cc: In function 'void bfs(int, int)':
a.cc:37:9: error: 'memset' was not declared in this scope
   37 |         memset(flag, 0, sizeof(flag));
      |         ^~~~~~
a.cc:11:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include <math.h>
  +++ |+#include <cstring>
   11 | #include <stdio.h>
Language: C++

#include <queue>
#include <vector>
#include <iostream>
#include <functional>
using namespace std;
struct state {
	int cost, pos, rem;
	state() : cost(0), pos(0), rem(0) {};
	state(int c, int p, int r) : cost(c), pos(p), rem(r) {};
};
bool operator<(const state& s1, const state& s2) {
	return s1.cost < s2.cost;
}
bool operator>(const state& s1, const state& s2) {
	return s1.cost > s2.cost;
}
int n, m, a, b;
int main() {
	cin >> n >> m;
	vector<int> c(n), t(n);
	vector<vector<int> > G(n);
	for (int i = 0; i < n; i++) cin >> c[i] >> t[i];
	for (int i = 0; i < m; i++) {
		cin >> a >> b; a--, b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	priority_queue<state, vector<state>, greater<state> > que; que.push(state(c[0], 0, t[0]));
	vector<vector<int> > dist(n, vector<int>(n + 1, 1999999999)); dist[0][t[0]] = c[0];
	while (!que.empty()) {
		state s = que.top(); que.pop();
		for (int i : G[s.pos]) {
			if (s.rem > 0) {
				if (dist[i][s.rem - 1] > s.cost) {
					dist[i][s.rem - 1] = s.cost;
					que.push(state(s.cost, i, s.rem - 1));
				}
			}
			if (dist[i][t[i]] > s.cost + c[i]) {
				dist[i][t[i]] = s.cost + c[i];
				que.push(state(s.cost + c[i], i, t[i]));
			}
		}
	}
	cout << *min_element(dist[n - 1].begin(), dist[n - 1].end());
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:18: error: 'min_element' was not declared in this scope
   45 |         cout << *min_element(dist[n - 1].begin(), dist[n - 1].end());
      |                  ^~~~~~~~~~~
Language: C++

#include <cstdio>
#include <vector>
#include <queue>
using namespace std;

typedef pair<int, int> P;

const int INF = 1 << 30;
int n, k;
int c[5001], r[5001], road[2], cost[5001];
vector<int> city[5001];
queue<int> que;
priority_queue<P, vector<P>, greater<P> > p_que;

void dfs(int v, int count){
	if(count == 0)
		return;
	
	for(int i = 0; i < city[v].size(); i++){
                if(flag[city[v][i]])
                        return;
		que.push(city[v][i]);
		dfs(city[v][i], count - 1);
	}
}

void dijkstra(){
	fill(cost, cost + n + 1, INF);
	cost[1] = 0;
	p_que.push(P(cost[1], 1));

	while(!p_que.empty()){
		P p = p_que.top();
		p_que.pop();
		int now = p.second;

		if(cost[now] < p.first)
			continue;

		dfs(now, r[now]);
		while(!que.empty()){
			int next = que.front();
			que.pop();
			if(cost[next] > cost[now] + c[now]){
				cost[next] = cost[now] + c[now];
				p_que.push(P(cost[next], next));
			}
		}
                flag[now] = 1;
	}
}


int main(){
	scanf("%d%d", &n, &k);
	for(int i = 1; i <= n; i++)
		scanf("%d%d", &c[i], &r[i]);
	for(int i = 1; i <= k; i++){
		scanf("%d%d", &road[0], &road[1]);
		city[road[0]].push_back(road[1]);
		city[road[1]].push_back(road[0]);
	}

	dijkstra();

	printf("%d\n", cost[n]);

	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:20:20: error: 'flag' was not declared in this scope
   20 |                 if(flag[city[v][i]])
      |                    ^~~~
a.cc: In function 'void dijkstra()':
a.cc:49:17: error: 'flag' was not declared in this scope
   49 |                 flag[now] = 1;
      |                 ^~~~
Language: C++

#include <cstdio>
#include <vector>
#include <queue>
using namespace std;

typedef pair<int, int> P;

const int INF = 1 << 30;
int n, k;
int c[5001], r[5001], road[2], cost[5001];
bool flag[5001];
vector<int> city[5001];
queue<int> que;
priority_queue<P, vector<P>, greater<P> > p_que;

void dfs(int v, int count){
	if(count == 0 || flag[v][i])
		return;
	
	for(int i = 0; i < city[v].size(); i++){
		flag[city[v][i] = 1;
                que.push(city[v][i]);
		dfs(city[v][i], count - 1);
                flag[city[v][i]] = 0;
	}
}

void dijkstra(){
	fill(cost, cost + n + 1, INF);
	cost[1] = 0;
	p_que.push(P(cost[1], 1));

	while(!p_que.empty()){
		P p = p_que.top();
		p_que.pop();
		int now = p.second;

		if(cost[now] < p.first)
			continue;

		dfs(now, r[now]);
		while(!que.empty()){
			int next = que.front();
			que.pop();
			if(cost[next] > cost[now] + c[now]){
				cost[next] = cost[now] + c[now];
				p_que.push(P(cost[next], next));
			}
		}
	}
}


int main(){
	scanf("%d%d", &n, &k);
	for(int i = 1; i <= n; i++)
		scanf("%d%d", &c[i], &r[i]);
	for(int i = 1; i <= k; i++){
		scanf("%d%d", &road[0], &road[1]);
		city[road[0]].push_back(road[1]);
		city[road[1]].push_back(road[0]);
	}

	dijkstra();

	printf("%d\n", cost[n]);

	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:17:34: error: 'i' was not declared in this scope
   17 |         if(count == 0 || flag[v][i])
      |                                  ^
a.cc:21:36: error: expected ']' before ';' token
   21 |                 flag[city[v][i] = 1;
      |                                    ^
      |                                    ]
Language: C++

#include <cstdio>
#include <vector>
#include <queue>
using namespace std;

typedef pair<int, int> P;

const int INF = 1 << 30;
int n, k;
int c[5001], r[5001], road[2], cost[5001];
bool flag[5001];
vector<int> city[5001];
queue<int> que;
priority_queue<P, vector<P>, greater<P> > p_que;

void dfs(int v, int count){ 
	if(count == 0)
		return;
        flag[city[v][i]] = 1;
	
	for(int i = 0; i < city[v].size(); i++){
		if(!flag[city[v][i]])
			que.push(city[v][i]);
		dfs(city[v][i], count - 1);
	}
}

void dijkstra(){
	fill(cost, cost + n + 1, INF);
	cost[1] = 0;
	p_que.push(P(cost[1], 1));

	while(!p_que.empty()){
		P p = p_que.top();
		p_que.pop();
		int now = p.second;

		if(cost[now] < p.first)
			continue;

		dfs(now, r[now]);
		while(!que.empty()){
			int next = que.front();
			que.pop();
			if(cost[next] > cost[now] + c[now]){
				cost[next] = cost[now] + c[now];
				p_que.push(P(cost[next], next));
			}
		}
		flag[now] = 1;
	}
}


int main(){
	scanf("%d%d", &n, &k);
	for(int i = 1; i <= n; i++)
		scanf("%d%d", &c[i], &r[i]);
	for(int i = 1; i <= k; i++){
		scanf("%d%d", &road[0], &road[1]);
		city[road[0]].push_back(road[1]);
		city[road[1]].push_back(road[0]);
	}

	dijkstra();

	printf("%d\n", cost[n]);

	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:19:22: error: 'i' was not declared in this scope
   19 |         flag[city[v][i]] = 1;
      |                      ^
Language: C++

#include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
#include<algorithm>
#define int long long
#define P pair<int,int>
using namespace std;

int cost[5000], idou[5000], mincost[5000];
vector<int>rinsetu[5000];
bool operator <(P a, P b) {
	return a.first < b.first;
}
signed main()
{
	int a, b;
	cin >> a >> b;
	fill(mincost + 1, mincost + a, LLONG_MAX / 3);
	for (int c = 0; c<a; c++) { scanf("%lld%lld", &cost[c], &idou[c]); }
	for (int d = 0; d<b; d++) {
		int e, f;
		scanf("%lld%lld", &e, &f);
		e--; f--;
		rinsetu[e].push_back(f);
		rinsetu[f].push_back(e);
	}
	priority_queue <P>Q;
	Q.push(P(0, 0));
	while (Q.size()) {
		P g = Q.top(); Q.pop();
		if (mincost[g.first]<g.second)continue;
		int h[5000];
		memset(h, -1, sizeof(h));
		h[g.first] = 0;
		queue<P>que;
		que.push(P(g.first, 0));
		while (que.size()) {
			P o = que.front(); que.pop();
			if (o.second>idou[o.first])break;
			for (int r = 0; r<rinsetu[o.first].size(); r++) {
				if (h[rinsetu[o.first][r]] == -1) { que.push(P(rinsetu[o.first][r], o.second + 1)); h[rinsetu[o.first][r]] = o.second + 1; }
			}
		}
		for (int i = 0; i<a; i++) {
			if (h[i] <= idou[g.first] && mincost[i]>g.second + cost[g.first]) { mincost[i] = g.second + cost[g.first]; Q.push(P(i, mincost[i])); }
		}
		cout << mincost[a - 1] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:40: error: 'LLONG_MAX' was not declared in this scope
   19 |         fill(mincost + 1, mincost + a, LLONG_MAX / 3);
      |                                        ^~~~~~~~~
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 | #define int long long
a.cc:34:17: error: 'memset' was not declared in this scope
   34 |                 memset(h, -1, sizeof(h));
      |                 ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include<algorithm>
  +++ |+#include <cstring>
    6 | #define int long long
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<utility>
#include<functional>
#include<queue>
using namespace std;
#define INF 1000000007
typedef pair<int, int> P;

struct edge{int to,cost;};
int d[5005];
P cst[5005];
bool used[5005];

vector<edge>graf[5005];
vector<edge>G[5005];
 
int main() {
    int n, k;
    cin >> n >> k;
    for (int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        cst[i] = P(a, b);
    }
    for (int i = 0; i < k; i++) {
        int a, b;
        cin >> a >> b;
        graf[a-1].push_back({b-1,1});
    }
 
    for (int ia = 0; ia < n; ia++) {//bfs
       queue<P>q;
       fill(d,d+n,INF);
       d[ia]=0;
       Q.push(P(0,ia));
       
       while(q.size()){
		   P p=q.front();
		   q.pop();
		   int v=p.second;
		   if(d[v]<p.first)continue;
		   for(int i=0;i<graf[v].size();i++){
			   edge e=graf[v][i];
			   if(d[e.to]>d[v]+e.cost;
			   q.push(P(d[e.to],e.to));
			   }
		   }
		for(int i=0;i<n;i++){
			if(i==ia){
				G[ia].push_back({i,0});
				continue;
				}
			if(d[i]<cst[ia].second)continue;	
			G[ia].push_back({i,cst[ia].first})
			}	
    }
    
    //dijkstra ElogV=36989
    priority_queue<P,vector<P>,greater<P> >Q;
    fill(d,d+n,INF);
    d[0]=0;
    Q.push(P(0,0));
    
    while(Q.size()){
		P p=Q.top();
		Q.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;
				Q.push(P(d[e.to],e.to));
				}
			}
		}
 
    cout << d[n - 1] << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:8: error: 'Q' was not declared in this scope
   37 |        Q.push(P(0,ia));
      |        ^
a.cc:47:51: error: expected ')' before ';' token
   47 |                            q.push(P(d[e.to],e.to));
      |                                                   ^
      |                                                   )
a.cc:46:30: note: to match this '('
   46 |                            if(d[e.to]>d[v]+e.cost;
      |                              ^
a.cc:47:34: error: could not convert 'q.std::queue<std::pair<int, int> >::push(std::pair<int, int>(d[e.edge::to], e.edge::to))' from 'void' to 'bool'
   47 |                            q.push(P(d[e.to],e.to));
      |                            ~~~~~~^~~~~~~~~~~~~~~~~
      |                                  |
      |                                  void
a.cc:56:59: error: expected ';' before '}' token
   56 |                         G[ia].push_back({i,cst[ia].first})
      |                                                           ^
      |                                                           ;
   57 |                         }
      |                         ~