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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,m;
ll ds[11];

int main(){
while(true){
scanf("%d%d", &n, &m);
if(n+m==0)return 0;
while(n--){
ll d;
int x;
scanf("%lld%d",&d,&x);
ds[x] += d;
}
ll ans = 0;
for(int i=10;i>=0;i--){
ll use = min(m, ds[i]);
ds[i] -= use;
m -= use;
ans += i * ds[i];
}
printf("%lld\n", ans);

}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: no matching function for call to 'min(int&, ll&)'
   19 | ll use = min(m, ds[i]);
      |          ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:19:13: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   19 | ll use = min(m, ds[i]);
      |          ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:19:13: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   19 | ll use = min(m, ds[i]);
      |          ~~~^~~~~~~~~~
Language: C++

//#define DEBUG

int N; long M;
typedef struct{
	int D,P;
}Area;
Area area[10000];
void debug(){
	int i;
	for(i = 0; i < N; i++){
		printf("D: %d; P:%d\n", area[i].D, area[i].P);
	}
}
int cmp(const int *a, const int *b){
	return *b-*a;
}
int main(){
	int i;
	long result;
	while(1){
		scanf("%d%d", &N, &M);
		if(N == 0 && M == 0)break;
		for(i = 0; i < N; i++){
			scanf("%d%d", &area[i].D, &area[i].P);
		}
		#ifdef DEBUG
		printf("before sorting\n");
		debug();
		#endif
		qsort(area, N, sizeof(Area),  (int (*)(void *, void *))cmp);
		#ifdef DEBUG
		printf("after sorting\n");
		debug();
		#endif
		i = 0;
		while(M > 0){
			if(area[i].D <= M){
				#ifdef DEBUG
				printf("area[i].D <= M\n");
				#endif
				M -= area[i].D;
				area[i].P = 0;
			}else{
				#ifdef DEBUG
				printf("area[i].D > M\n");
				#endif
				area[i].D -= M;
				M = 0;
			}
			i++;
		}
		#ifdef DEBUG
		debug();
		#endif
		result = 0;
		for(i = 0; i < N; i++){
			result += area[i].D * area[i].P;
		}
		printf("%d\n", result);
	}
	return 0;
}

Compiler output:
a.cc: In function 'void debug()':
a.cc:11:17: error: 'printf' was not declared in this scope
   11 |                 printf("D: %d; P:%d\n", area[i].D, area[i].P);
      |                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | //#define DEBUG
a.cc: In function 'int main()':
a.cc:21:17: error: 'scanf' was not declared in this scope
   21 |                 scanf("%d%d", &N, &M);
      |                 ^~~~~
a.cc:30:17: error: 'qsort' was not declared in this scope
   30 |                 qsort(area, N, sizeof(Area),  (int (*)(void *, void *))cmp);
      |                 ^~~~~
a.cc:59:17: error: 'printf' was not declared in this scope
   59 |                 printf("%d\n", result);
      |                 ^~~~~~
a.cc:59:17: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include<stdio.h>

int main(){
	int n,m,d,p,a,i;

	for( ; scanf("%d%d",&n,&m) , n|m ; printf("%d\n",a) ){
		a=0;
		int f[12]={0};
		for( i=n ; i-- ; f[p] += d )
			scanf("%d%d",&d,&p);
		for( i=10 ; i >= 0 ; a += f[i]*i , i-- )
			for( ; f[i] && m ; ){
				m--,f[i]--;
	}
}

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

#include<cstdio>
#include<algorithm>
#include<string>
#include<cstring>
#include<iostream>
#include<vector>
#include<map>
using namespace std;
typedef pair<int,int> P;
#define F first
#define S second
int N,M;
P p[10003];
int main(){
  while(1){
    scanf("%d %d",&N,&M);
    if(!N && !M) break;
    for(int i=0;i<N;i++){
      int da,pa;
      scanf("%d %d",&d,&pa);
      p[i]=P(pa,d);
    }
    sort(p,p+N);
    int res=0;
    for(int i=N-1;i>-1;i--){
      if(M==0) res+=p[i].S*p[i].F;
      else if(M>p[i].S) M-=p[i].S;
      else if(M<=p[i].S){
	p[i].S-=M;
	M=0;
	res+=p[i].S*p[i].F;
      }
    }
    printf("%d\n",res);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:22: error: 'd' was not declared in this scope; did you mean 'da'?
   20 |       scanf("%d %d",&d,&pa);
      |                      ^
      |                      da
Language: C++

#include <iostream>
#include <utility>
#include <algorithm>

int main() {
	int flag = true;
	while (flag) {
		// 入力
		int N, M;
		std::cin >> N >> M;
		int D, P;
		pair<int, int> PD[10000];
		for (int i = 0; i < N; i++) {
			std::cin >> D >> P;
			PD[i] = make_pair(P, D);
		}
		// 演算
		sort(PD, PD + N);
		int answer = 0;
		for (int i = 0; i < N; i++) {
			answer += PD[i].first * PD[i].second;
		}
		int remains = M;
		for (int i = 0; remains > 0; i++) {
			if (remains >= PD[i].second) {
				answer -= PD[i].first * PD[i].second;
			}
			else {
				answer -= PD[i].first * remains;
			}
			remains -= PD[i].second;
		}
		// 出力
		std::cout << answer << std::endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
   12 |                 pair<int, int> PD[10000];
      |                 ^~~~
      |                 std::pair
In file included from /usr/include/c++/14/string:48,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:3013:12: note: 'std::pair' declared here
 3013 |     struct pair;
      |            ^~~~
a.cc:12:22: error: expected primary-expression before 'int'
   12 |                 pair<int, int> PD[10000];
      |                      ^~~
a.cc:15:25: error: 'PD' was not declared in this scope; did you mean 'P'?
   15 |                         PD[i] = make_pair(P, D);
      |                         ^~
      |                         P
a.cc:15:33: error: 'make_pair' was not declared in this scope; did you mean 'std::make_pair'?
   15 |                         PD[i] = make_pair(P, D);
      |                                 ^~~~~~~~~
      |                                 std::make_pair
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: 'std::make_pair' declared here
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:18:22: error: 'PD' was not declared in this scope; did you mean 'P'?
   18 |                 sort(PD, PD + N);
      |                      ^~
      |                      P
a.cc:18:17: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   18 |                 sort(PD, PD + N);
      |                 ^~~~
      |                 std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:3:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C++

#include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
int n;
int m;
int D[10001];
int P[10001];
priority_queue<pii> que;
int ans;//襲われる期待値
int main(){
	while(cin>>n>>m,n||m){
		ans = 0;
		for(int i =0;i< n;i++){
			cin>>D[i];
			cin>>P[i];
			que.push(pii(P[i],D[i]));
		}
		int d;//移動距離
		int p;//期待値
		while(!que.empty()){
			d = que.top().second;
			p = que.top().first;
			que.pop();
			if(m-d>=0){
				m -=d;
				continue;
			}else if(m -d<0){
				d -=m;
				ans +=d*p;
				m = 0;g
			}
		}
		cout <<ans<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:39: error: 'g' was not declared in this scope
   64 |                                 m = 0;g
      |                                       ^
Language: C

#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)n; ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cout<<*i<<" "; cout<<endl; }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
string vowel = "aiueo";
bool isvowel(char c){
  REP(i, 5)if(c == vowel[i]) return true;
  return false;
}
bool ksthp(char c){
  return (c == 'k' || c == 's' || c == 't' || c == 'h' || c == 'p');
}
bool iu(char c){
  return (c == 'i' || c == 'u');
}
bool ao(char c){
  return (c == 'a' || c == 'o');
}

int main(){
  string s;
  while(cin>>s && s != "#"){
    vector<string> mora;
    int N = s.size();
    string tmp;
    REP(i, N){
      if(tmp == "n" && !isvowel(s[i])){
        mora.push_back("n");
        tmp = s[i];
      }else if(s[i] == '\''){
        tmp += "'";
        mora.push_back(tmp);
        tmp = "";
      }else if(isvowel(s[i])){
        tmp += s[i];
        mora.push_back(tmp);
        tmp = "";
      }else{
        tmp += s[i];
      }
    }
    if(tmp != "")mora.push_back(tmp);
    int M = mora.size();
    vector<bool> rule1(M);
    vector<bool> rule2(M);
    REP(i, M - 1){
      if(ksthp(mora[i][0]) && ksthp(mora[i+1][0])){
        if(iu(mora[i][mora[i].size()-1])) rule1[i] = true;
        if(mora[i+1][0] != mora[i+1][1] && mora[i][mora[i].size()-1] == mora[i+1][mora[i+1].size()-1] && ao(mora[i][mora[i].size()-1])) rule2[i] = true;
      }
    }
    if(ksthp(mora[M-1][0]) && iu(mora[M-1][mora[M-1].size()-1])) rule1[M-1] = true;
    bool bf = false;
    REP(i, M){
      //cout<<mora[i]<<" ";
      if((rule1[i] || rule2[i]) && !bf) {
        cout<<mora[i].substr(0, mora[i].size()-1) + "(" + mora[i][mora[i].size()-1] + ")";
        bf = true;
      }else{
        bf = false;
        cout<<mora[i];
      }
    }
    cout<<endl;
    //REP(i, M - 1)if(kathp[mora[i][0])
  }
  return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;

public class Main{
    int n,m,l,k,a,h;
    int[] x,y,t;
    int[][] time;
    int min;
    List<String> f;

    public static void main(String[] args){
	new Main2().solve();
    }

    void solve(){
	Scanner sc = new Scanner(System.in);
	n = sc.nextInt();
	while(n!=0){
	    m = sc.nextInt();
	    l = sc.nextInt();
	    k = sc.nextInt();
	    a = sc.nextInt();
	    h = sc.nextInt();
	    f = new ArrayList<String>();
	    if(l>0){
		for(int i=0; i<l; i++){
		    f.add(sc.nextInt()+"");
		}
		f.add(a+"");
		f.add(h+"");
	    }
	    x = new int[k];
	    y = new int[k];
	    t = new int[k];
	    time = new int[n][n];
	    for(int i=0; i<n; i++){Arrays.fill(time[i],-1);}
	    for(int i=0; i<k; i++){
		x[i] = sc.nextInt();
		y[i] = sc.nextInt();
		t[i] = sc.nextInt();
		if(t[i]<=m){
		    time[y[i]][x[i]] = t[i];
		    time[x[i]][y[i]] = t[i];
		}
	    }

	    min = Integer.MAX_VALUE;
	    dfs(a,m,0,0,new boolean[n][n]);

	    if(min==Integer.MAX_VALUE){
		System.out.println("Help!");
	    }else{
		System.out.println(min);
	    }

	    n = sc.nextInt();
	}
    }

    void dfs(int pos, int left, int freeze, int dist, boolean[][] used){
	//System.out.println("pos:"+pos+" left:"+left+" freeze: "+freeze+" dist:"+dist);
	if(pos==h){
	    freeze -= left;
	    min = Math.min(min,dist+freeze);
	    return;
	}

	//used[pos] = true;

	if(f.contains(pos+"")){
	    freeze += m-left;
	    left = m;
	}

	for(int i=0; i<n; i++){
	    if(i==pos)continue;
	    //System.out.println("pos:"+pos+" i:"+i+" time[i][pos]:"+time[i][pos]+" used[i]:"+used[i]+" left-time[i][pos]:"+(left-time[i][pos]));
	    if(time[i][pos]>=0 && !used[pos][i] && left-time[i][pos]>=0){
		used[pos][i] = true;
		dfs(i,left-time[i][pos],freeze,dist+time[i][pos],used);
		used[pos][i] = false;
	    }
	}

	//used[pos] = false;
    }
}

Compiler output:
Main.java:11: error: cannot find symbol
	new Main2().solve();
	    ^
  symbol:   class Main2
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main_dij{
    int N,M,L,K,A,H;
    int[] d;
    List<Edge>[] adj;
    int INF = 1000000000;
    List<String> f;

    public static void main(String[] args){
	new Main_dij().solve();
    }

    class Edge{
	int t, c;
	public Edge(int t, int c) {
	    this.t = t;
	    this.c = c;
	}
    }

    @SuppressWarnings("unchecked")
    void solve(){
	Scanner sc = new Scanner(System.in);
	N = sc.nextInt();
	while(N!=0){
	    M = sc.nextInt();
	    L = sc.nextInt();
	    K = sc.nextInt();
	    A = sc.nextInt();
	    H = sc.nextInt();
	    f = new ArrayList<String>();
	    for(int i=0; i<L; i++){
		f.add(sc.nextInt()+"");
	    }
	    f.add(A+"");
	    f.add(H+"");
	    
	    adj = new List[N];
	    for(int i=0; i<N; i++)adj[i] = new ArrayList<Edge>();
	    for(int i=0; i<K; i++){
		int x = sc.nextInt();
		int y = sc.nextInt();
		int t = sc.nextInt();
		adj[x].add(new Edge(y,t));
		adj[y].add(new Edge(x,t));
	    }

	    d = new int[N*(M+1)];

	    dijkstra(A);

	    if(d[H*(M+1)+M]==INF){
		System.out.println("Help!");
	    }else{
		System.out.println(d[H*(M+1)+M]+Math.max(0,d[H*(M+1)+M]-M));
	    }

	    N = sc.nextInt();
	}
    }
   
    void dijkstra(int s){
	Arrays.fill(d,INF);
	d[s*(M+1)+M] = 0;
	PriorityQueue<Integer> q = new PriorityQueue<Integer>(N, new Comparator<Integer>() {
		public int compare(Integer o1, Integer o2) {
		    return d[o1]-d[o2];
		}
	    });

	q.add(s*(M+1)+M);
	while(!q.isEmpty()){
	    int v = q.poll();
	    int town = v/(M+1);
	    int left = v%(M+1);
	    for(Edge e:adj[town]){
		if(left-e.c<0)continue;
		if(f.contains(e.t+"")){
		    int w = d[town*(M+1)+left]+e.c;
		    if(w<d[e.t*(M+1)+M]){
			q.remove(e.t*(M+1)+M); 
			d[e.t*(M+1)+M] = w; 
			q.add(e.t*(M+1)+M);
		    }
		}else{
		    int w = d[town*(M+1)+left]+e.c;
		    if(w<d[e.t*(M+1)+left-e.c]){
			q.remove(e.t*(M+1)+left-e.c); 
			d[e.t*(M+1)+left-e.c] = w; 
			q.add(e.t*(M+1)+left-e.c);
		    }
		}
	    }
	}
    }
}

Compiler output:
Main.java:3: error: class Main_dij is public, should be declared in a file named Main_dij.java
public class Main_dij{
       ^
1 error
Language: Java

import java.util.*;
 
public class Main{
    int N,M,L,K,A,H;
    int[] d;
    List<Edge>[] adj;
    int INF = 1000000000;
    List<String> f;
 
    public static void main(String[] args){
    new Main().solve();
    }
 
    class Edge{
    int t, c;
    public Edge(int t, int c) {
        this.t = t;
        this.c = c;
    }
    }
 
    @SuppressWarnings("unchecked")
    void solve(){
    Scanner sc = new Scanner(System.in);
    N = sc.nextInt();
    while(N!=0){
        M = sc.nextInt();
        L = sc.nextInt();
        K = sc.nextInt();
        A = sc.nextInt();
        H = sc.nextInt();
        f = new ArrayList<String>();
        for(int i=0; i<L; i++){
        f.add(sc.nextInt()+"");
        }
        f.add(A+"");
        f.add(H+"");
         
        adj = new List[N];
        for(int i=0; i<N; i++)adj[i] = new ArrayList<Edge>();
        for(int i=0; i<K; i++){
        int x = sc.nextInt();
        int y = sc.nextInt();
        int t = sc.nextInt();
        adj[x].add(new Edge(y,t));
        adj[y].add(new Edge(x,t));
        }
 
        d = new int[N*(M+1)];
 
        dijkstra(A);
 
        if(d[H*(M+1)+M]==INF){
        System.out.println("Help!");
        }else{
        System.out.println(d[H*(M+1)+M]+Math.max(0,d[H*(M+1)+M]-M));
        }
 
        N = sc.nextInt();
    }
    }
    
    void dijkstra(int s){
    Arrays.fill(d,INF);
    d[s*(M+1)+M] = 0;
    PriorityQueue<Integer> q = new PriorityQueue<Integer>(N, new Comparator<Integer>() {
        public int compare(Integer o1, Integer o2) {
            return d[o1]-d[o2];
        }
        });
 
    q.add(s*(M+1)+M);
    while(!q.isEmpty()){
        int v = q.poll();
        int town = v/(M+1);
        int left = v%(M+1);
        for(Edge e:adj[town]){
        if(left-e.c<0)continue;
        if(f.contains(e.t+"")){
            int w = d[town*(M+1)+left]+e.c;
            if(w<d[e.t*(M+1)+M]){
            q.remove(e.t*(M+1)+M); 
            d[e.t*(M+1)+M] = w; 
            q.add(e.t*(M+1)+M);
            }
        }else{
            int w = d[town*(M+1)+left]+e.c;
            if(w<d[e.t*(M+1)+left-e.c]){
            q.remove(e.t*(M+1)+left-e.c); 
            d[e.t*(M+1)+left-e.c] = w; 
            q.add(e.t*(M+1)+left-e.c);
            }
        }
        }
    }
}

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

package nofill_nosubmit;
import java.util.Arrays;
import java.util.Scanner;
public class AOJ_2021 
{
	public static void main(String[] args) 
	{
		Scanner in=new Scanner(System.in);
		int INF=1000001;
		for(;;)
		{
			int N=in.nextInt();//町の数
			int M=in.nextInt();//制限時間
			int L=in.nextInt();//冷凍施設の数
			int K=in.nextInt();//道路の数
			int A=in.nextInt();//スタート地点
			int H=in.nextInt();//ゴール^^
			if((N|M|L|K|A|H)==0)
				return;
			int war[][]=new int[N][N];
			int no[]=new int[N];
			for(int i=0;i<L;i++)
				no[in.nextInt()]=1;
			no[A]=no[H]=1;
			int ans=M;
			for(int i=0;i<N;i++)
				Arrays.fill(war[i], INF);
			for(int i=0;i<N;i++)
				war[i][i]=0;
			for(int i=0;i<K;i++)
			{
				int s=in.nextInt();
				int t=in.nextInt();
				int co=in.nextInt();
				war[s][t]=war[t][s]=co;
			}
			
			for (int i=0;i<N;i++)
				for(int j=0;j<N;j++)
					for(int k=0;k<N;k++)
					{
						//j->kへ行くのにiを経由した方が良いかどうか
						int c=war[j][i]+war[i][k];
						war[j][k]=Math.min(war[j][k],c);
					}
			for(int i=0;i<N;i++)
				for(int j=0;j<N;j++)
				{
					if(no[i]==0||no[j]==0||war[i][j]>M)
						war[i][j]=INF;
				}
			for (int i=0;i<N;i++)
				for(int j=0;j<N;j++)
					for(int k=0;k<N;k++)
					{
						//j->kへ行くのにiを経由した方が良いかどうか
						int c=war[j][i]+war[i][k];
						war[j][k]=Math.min(war[j][k],c);
					}
			if(war[A][H]==INF)
				System.out.println("Help");
			else
			  System.out.println(war[A][H]+Math.max(0,war[A][H]-M));
		}
	}
}

Compiler output:
Main.java:4: error: class AOJ_2021 is public, should be declared in a file named AOJ_2021.java
public class AOJ_2021 
       ^
1 error
Language: C++

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

using namespace std;

#define loop(i,a,b) for(int i=(a);i<int(b);i++)
#define rep(i,b) loop(i,0,b)
#define all(c) (c).begin(), (c).end()

int const inf = 1 << 29;
struct Edge {
    Edge(int dst, int weight)
        : dst(dst), weight(weight){}
    int dst, weight;
};

struct State{
    State(int dst, int weight, int rest)
        :dst(dst), weight(weight), rest(rest){}
    int dst, weight, rest;
    bool operator<(const State &s) const {
        return weight > s.weight;
    }
};

typedef vector<vector<Edge>> Graph;

// M : 制限時間
// L : 冷凍できる頂点の数
// A : 始点
// H : 終点
int V, M, L, E, A, H;
bool isL[128];
Graph g;

int dp[100][100];

int solve(){
    priority_queue<State> q;
    rep(i, V)rep(j, M + 1)dp[i][j] = inf;
    dp[A][M] = 0;
    q.emplace(A, 0, M);
    while (q.size()){
        State s = q.top(); q.pop();
        int src = s.dst, weight = s.weight, rest = s.rest;
        if (src == H) return weight;
        if (dp[src][rest] < weight) continue;
        rep(i, g[src].size()){
            int dst = g[src][i].dst;
            int weight = g[src][i].weight;
            if (rest - weight >= 0 && dp[dst][rest - weight] > dp[src][rest] + weight){
                dp[dst][rest - weight] = dp[src][rest] + weight;
                q.push(State(dst, dp[src][rest] + weight, rest - weight));
            }
            if (isL[src]){
                for (int j = 1; rest + j <= M; j++){
                    if (rest + j - weight >= 0 && dp[dst][rest + j - weight] > dp[src][rest] + weight + j){
                        dp[dst][rest + j - weight] = dp[src][rest] + weight + j;
                        q.push(State(dst, dp[src][rest] + weight + j, rest - weight + j));
                    }
                }
            }
        }
    }
    return inf;
}

int main(){
    while (cin >> V >> M >> L >> E >> A >> H && V){
        memset(isL, 0, sizeof(isL));
        g.assign(V, {});
        isL[A] = isL[H] = true;
        rep(i, L){
            int v; cin >> v;
            isL[v] = true;
        }
        rep(i, E){
            int u, v, t;
            cin >> u >> v >> t;
            g[u].push_back(Edge(v, t));
            g[v].push_back(Edge(u, t));
        }
        int ans = solve();
        if (ans >= inf) cout << "Help!";
        else cout << ans;
        cout << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:9: error: 'memset' was not declared in this scope
   72 |         memset(isL, 0, sizeof(isL));
      |         ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <queue>
  +++ |+#include <cstring>
    5 |
Language: C++

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

using namespace std;

#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) for (int i=0;i<(n);++i)

struct Edge
{
	int to;
	int cost;
};

struct Node
{
	int city_index;
	int total_cost;
	int current_life;

	bool operator >(const Node &a) const
	{
		return total_cost > a.total_cost;
	}
};

int main()
{
	int city_count, initial_life, cooler_count, road_count, start_index, goal_index;
	while (cin >> city_count >> initial_life >> cooler_count >> road_count >> start_index >> goal_index,
		city_count)
	{
		// input
		vector<int> is_cooler(city_count, false);
		REP(i, cooler_count)
		{
			int cooler_index;
			cin >> cooler_index;
			is_cooler[cooler_index] = true;
		}
		vector<vector<Edge>> roads(city_count);
		REP(i, road_count)
		{
			int from, to, cost;
			cin >> from >> to >> cost;
			roads[from].push_back({ to, cost });
			roads[to].push_back({ from, cost });
		}

		// dijkstra
		vector<vector<int>> d(city_count, vector<int>(initial_life + 1, INT_MAX)); // [city_index][current_life] => total_cost
		d[start_index][initial_life] = 0;
		priority_queue<Node, vector<Node>, greater<Node> > pq;
		pq.push({ start_index, 0, initial_life });
		while (!pq.empty())
		{
			auto current_node = pq.top(); pq.pop();
			for (auto &road : roads[current_node.city_index])
			{
				if (is_cooler[current_node.city_index])
				{
					REP(i, initial_life - current_node.current_life + 1)
					{
						int life = current_node.current_life + i - road.cost;
						if (life < 0)
						{
							continue;
						}
						int cost = current_node.total_cost + road.cost + i;
						if (cost < d[road.to][life])
						{
							d[road.to][life] = cost;
							pq.push({ road.to, cost, life });
						}
					}
				}
				else
				{
					int life = current_node.current_life - road.cost;
					if (life < 0)
					{
						continue;
					}
					int cost = current_node.total_cost + road.cost;
					if (cost < d[road.to][life])
					{
						d[road.to][life] = cost;
						pq.push({ road.to, cost, life });
					}
				}
			}
		}
		auto res = min_element(d[goal_index].begin(), d[goal_index].end());
		if (*res == INT_MAX)
		{
			cout << "Help!" << endl;
		}
		else
		{
			cout << *res << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:81: error: 'INT_MAX' was not declared in this scope
   55 |                 vector<vector<int>> d(city_count, vector<int>(initial_life + 1, INT_MAX)); // [city_index][current_life] => total_cost
      |                                                                                 ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <algorithm>
  +++ |+#include <climits>
    7 |
Language: C++

#include <iostream>
#include <algorithm>
#include <queue>
#include <map>
using namespace std;
const int INF = 1<<28;
int memo[110][110];
bool refr[110];
int G[110][110];
int n,m,l;

struct V{
  int id,fr;
  V(int id,int fr):id(id),fr(fr){}
};

bool operator < (const V& a,const V& b){
  return memo[a.id][a.fr] > memo[b.id][b.fr];
}

int dijkstra(int s,int t,int g){
  for(int i=0;i<n;++i)
    for(int j=0;j<=m;++j)
      memo[i][j] = INF;
  memo[s][t] = 0;
  priority_queue<V> Q;
  Q.push(V(s,t));
  while(Q.size()){
    V v = Q.top(); Q.pop();
    for(int i=0;i<n;++i){
      if(G[v.id][i]){
	int nxtid = i;
	int nxtfr = v.fr - G[v.id][i];
	if(nxtfr < 0) continue;
	int nxtcst = memo[v.id][v.fr]+G[v.id][i];
	if(memo[nxtid][nxtfr] <= nxtcst) continue;
	memo[nxtid][nxtfr] = nxtcst;
	Q.push(V(nxtid,nxtfr));
	if(refr[nxtid])
	  for(int j=nxtfr+1;j<=m;++j){
	    if(memo[nxtid][j]<=nxtcst+j-nxtfr) continue;
	    memo[nxtid][j] = nxtcst+j-nxtfr;
	    Q.push(V(nxtid,j));
	  }
      }
    }
  }

  int ret = INF;
  for(int i=0;i<=m;++i) ret = min(ret, memo[g][i]);
  return ret;
}

int main(){
  int k,a,h;
  while(cin>>n>>m>>l>>k>>a>>h,n||m||l||k||a||h){
    memset(refr,0,sizeof(refr));
    memset(G,0,sizeof(G));
    while(l--){
      int u;cin>>u;
      refr[u]=true;
    }
    while(k--){
      int u,v,t;
      cin >> u >> v >> t;
      G[u][v] = G[v][u] = t;
    }
    int ans = dijkstra(a,m,h);
    if(ans==INF) cout << "Help!" << endl;
    else cout << ans << endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:5: error: 'memset' was not declared in this scope
   57 |     memset(refr,0,sizeof(refr));
      |     ^~~~~~
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<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<stack>
#include<functional>
#include<list>
#include<unordered_map>
#include<map>
#define p pair<int,int>
#define P pair<int,p>
using namespace std;

bool g[100];
vector<p>rinsetu[100];
int mincost[100][101];//n????§£???????????????m?§???§??°???
signed main() {
	int a, b, c, d, e, f;
	while (cin >> a >> b >> c >> d >> e >> f, a | b | c | d | e | f) {
		memset(g, false, sizeof(g));
		for (int h = 0; h < c; h++) {
			int i; scanf("%d", &i);
			g[i] = true;
		}
		for (int h = 0; h < a; h++)rinsetu[h].clear();
		for (int h = 0; h < d; h++) {
			int i, j, k; scanf("%d%d%d", &i, &j, &k);
			if (k > b)continue;
			rinsetu[i].push_back(p(k, j));
			rinsetu[j].push_back(p(k, i));
		}
		memset(mincost, 0x3f, sizeof(mincost));
		mincost[e][0] = 0;
		priority_queue<P, vector<P>, greater<P>>Q;
		Q.push({ 0,{e,0} });
		while (Q.size()) {
			P t = Q.top(); Q.pop();
			if (mincost[t.second.first][t.second.second] < t.first)continue;
			for (p i : rinsetu[t.second.first]) {
				int k = t.second.second + i.first;
				if (k > b) {
					if (g[t.second.first]) {
						if (mincost[i.second][b] > t.first + i.first + k - b) {
							mincost[i.second][b] = t.first + i.first + k - b;
							Q.push({ mincost[i.second][k] ,{ i.second,b } });
						}
					}
				}
				else if (mincost[i.second][k] > t.first + i.first) {
					mincost[i.second][k] = t.first + i.first;
					Q.push({ mincost[i.second][k] ,{i.second,k} });
				}
			}
		}
		int MIN = 1 << 29;
		for (int i = 0; i <= b; i++) {
			MIN = min(MIN, mincost[f][i]);
		}
		if (MIN == 1 << 29)puts("Help!");
		else cout << MIN << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: 'memset' was not declared in this scope
   23 |                 memset(g, false, sizeof(g));
      |                 ^~~~~~
a.cc:13:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   12 | #include<map>
  +++ |+#include <cstring>
   13 | #define p pair<int,int>
Language: C++

int main(){
 ll ans = 0;
 while(1){
 ans++;
 }
cout << ans << endl;
//TLE
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:2: error: 'll' was not declared in this scope
    2 |  ll ans = 0;
      |  ^~
a.cc:4:2: error: 'ans' was not declared in this scope
    4 |  ans++;
      |  ^~~
a.cc:6:1: error: 'cout' was not declared in this scope
    6 | cout << ans << endl;
      | ^~~~
a.cc:6:9: error: 'ans' was not declared in this scope
    6 | cout << ans << endl;
      |         ^~~
a.cc:6:16: error: 'endl' was not declared in this scope
    6 | cout << ans << endl;
      |                ^~~~
Language: C++

#include <algorithm>
#include <iostream>

using namespace std;

int main()
{
	for( int N,M,L,K,A,H; cin>>N>>M>>L>>K>>A>>H, N|M|L|K|A|H; )
	{
		bool freez[100];
		bool visit[100][101];
		int  time[100][101];
		int  length[100][100];

		const int INF = INT_MAX / 2;

		for( int i = 0; i < N; ++i )
		{
			freez[i] = false;

			for( int j = 0; j < 101; ++j )
			{
				visit[i][j] = false;
				time[i][j]  = INF;
			}

			for( int j = 0; j < N; ++j )
				length[i][j] = INF;
		}

		for( int i = 0; i < L; ++i )
		{
			int x; cin >> x;
			freez[x] = true;
		}

		for( int i = 0; i < K; ++i )
		{
			int x, y, t; cin >> x >> y >> t;
			length[x][y] = length[y][x] = t;
		}

		time[A][M] = 0;

		int ans = INF;

		while(true)
		{
			int t   = INF;
			int m;
			int cur;

			for( int i = 0; i < N; ++i )
				for( int j = 0; j < 101; ++j )
					if( visit[i][j] == false && time[i][j] < t )
					{
						cur = i;
						t   = time[i][j];
						m   = j;
					}

			if( t == INF )
				break;

			if( cur == H )
			{
				ans = t;
				break;
			}

			visit[cur][m] = true;

			for( int i = 0; i < N; ++i )
				if( i != cur )
					for( int j = 0; j < 101; ++j )
					{
						if( length[cur][i] > m || visit[i][j] || i == j )
							continue;

						int tt = t + length[cur][i];
						int mm = m - length[cur][i];

						time[i][mm] = min( time[i][mm], tt );

						if( freez[i] )
							for( int k = 1; k <= M-mm; ++k )
								time[i][mm+k] = min( time[i][mm+k], tt+k );
					}
		}

		if( ans == INF )
				cout << "Help!" << endl;
		else	cout << ans << endl;
	}

	return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:15:33: error: 'INT_MAX' was not declared in this scope
   15 |                 const int INF = INT_MAX / 2;
      |                                 ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <iostream>
  +++ |+#include <climits>
    3 |
Language: C++

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

int N,M,L,K,A,H;
bool re[100];
int cost[100][100];

struct Node{
	int total,rem,pos,total_b;
};

bool operator < (Node a,Node b){
	return a.total>b.total;
}


void solve()
{
	memset(re,false,sizeof(re));
	memset(cost,-1,sizeof(cost));
	re[A]=re[H]=true;
	for(int i=0;i<L;i++){int t;cin>>t;re[t]=true;}

	for(int i=0;i<K;i++){
		int in,out,c;cin>>in>>out>>c;
		cost[in][out]=cost[out][in]=c;
	}

	vector<vector<Node> >V(N);
	Node first;
	first.rem=M; first.total=0; first.pos=A;first.total_b=0;
	priority_queue<Node> Q;
	Q.push(first);
//	cout<<endl<<endl;

	while(!Q.empty()){
		Node now=Q.top();
		Q.pop();
//		cout<<now.pos<<" "<<now.rem<<" "<<now.total<<endl;
		if(now.rem<0) continue;
		if(now.pos==H){cout<<now.total-min(now.total_b,now.rem)<<endl; return;}
		bool ok=true;
		for(int i=0;i<V[now.pos].size();i++){
			if(V[now.pos][i].rem>=now.rem && V[now.pos][i].total<=now.total){
				ok=false;
				break;
			}
		}
		if(!ok) continue;
		V[now.pos].push_back(now);

		for(int i=0;i<N;i++){
			if(cost[now.pos][i]==-1) continue;
			Node next;
			if(re[i]){
				if(now.rem<cost[now.pos][i]) continue;
				next.rem=M;
				next.total=now.total+cost[now.pos][i]+M-now.rem+cost[now.pos][i];
				next.pos=i;
				next.total_b=now.total_b+M-now.rem+cost[now.pos][i];
			}
			else{
				next.rem=now.rem-cost[now.pos][i];
				next.total=now.total+cost[now.pos][i];
				next.pos=i;
				next.total_b=now.total_b;
			}
			Q.push(next);
		}

	}

	cout<<"Help!"<<endl;
}



int main(){
	while(cin>>N>>M>>L>>K>>A>>H){
		if(N==0) break;
		solve();
	}
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:21:9: error: 'memset' was not declared in this scope
   21 |         memset(re,false,sizeof(re));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<queue>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++


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

#define INF (INT_MAX - 1)
#define MAX_M 100

//#define DEBUG
#ifdef DEBUG
#define //Dprintf(fmt,...) fprintf(stderr,fmt,__VA_ARGS__)
#else
#define //Dprintf(fmt,...)
#endif

int N, M, L, K, A, H;

struct qdata {
	int dist;
	int layer;
	int id;
	inline bool operator > (const qdata &q) const {
		return dist > q.dist;
	}
};

struct edge {
	int to;
	int cost;
};

struct vertex {
	vector<edge> edges;
	bool freezer;

	// for dijkstra
	bool fixed[MAX_M];
	int distance[MAX_M];

	// constructor
	vertex(bool fr = false): freezer(fr) {
		for (int i = 0; i < MAX_M; i++) {
			fixed[i] = false;
			distance[i] = INF;
		}
	}
};
vector<vertex> vertices;

void dijkstra(int start) {
	priority_queue< qdata, vector<qdata>, greater<qdata> > queue;

	vertices.at(start).distance[M] = 0;
	qdata q; q.dist = 0; q.layer = M; q.id = start;
	queue.push(q);
	while (!queue.empty()) {
		qdata top = queue.top(); queue.pop();
		vertex* v = &vertices.at(top.id);
		int l = top.layer;

		if (v->fixed[l]) continue; // already fixed
		v->distance[l] = top.dist;
		v->fixed[l] = true;
		//Dprintf("[Layer %d] Distance to Node:%d is found to be %d\n", l, top.id, v->distance[l]);
		for (int i = 0; i < v->edges.size(); i++) {
			edge e = v->edges.at(i);
			int freezingtime = (v->freezer)? M - l : 0;
			int next_layer = (v->freezer)? M - e.cost : l - e.cost;
			//Dprintf("\t(freezing:%d)--%d-->[Layer %d](%d)\n", freezingtime, e.cost, next_layer, e.to);
			if (next_layer < 0) {
				continue;
			}
			if (v->distance[l] + freezingtime + e.cost < vertices.at(e.to).distance[next_layer]) { // new shorter path found
				//Dprintf("\t\tis shorter than current %d\n", vertices.at(e.to).distance[next_layer]);
				qdata q; q.dist = v->distance[l] + freezingtime + e.cost; q.layer = next_layer; q.id = e.to;
				queue.push(q);
			}
		}
	}
}

int main(int argc, char const* argv[])
{

	while (cin >> N >> M >> L >> K >> A >> H, N || M || L || K || A || H) {
		vertices.clear();
		for (int i = 0; i < N; i++) {
			vertex v; vertices.push_back(v);
		}
		for (int i = 0; i < L; i++) {
			int l; cin >> l;
			vertices.at(l).freezer = true;
		}
		for (int i = 0; i < K; i++) {
			int X, Y, T; cin >> X >> Y >> T;
			for (int i = 0; i < 2; i++) {
				edge e;
				e.to = Y; e.cost = T;
				vertices.at(X).edges.push_back(e);
				swap(X, Y);
			}
		}
		//Dprintf("Start from %d, Goal is %d, Limit is %d\n", A, H, M);
		dijkstra(A);
		int ans = INF;
		for (int i = 0; i < M; i++) {
			if (vertices.at(H).distance[i] - i < ans) {
				ans = vertices.at(H).distance[i] - i;
			}
		}
		if (ans == INF) {
			cout << "Help!" << endl;
		} else {
			cout << ans << endl;
		}
	}
	return 0;
}

Compiler output:
a.cc:16:27: error: no macro name given in #define directive
   16 | #define //Dprintf(fmt,...)
      |                           ^
Language: C++

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

class Edge{
public:
  int to, cost;

  Edge(){}
  Edge(int to, int cost):
    to(to), cost(cost){}
};

class State{
public:
  int id, rem, cost;

  State(){}
  State(int id, int rem, int cost):
    id(id), rem(rem), cost(cost){}

  bool operator<(const State &st)const{
    return cost > st.cost;
  }
};

int n, m, l, k, a, h;
vector<Edge> t[102];
bool closed[102][102];
bool f[102];

void solve(){
  priority_queue<State> open;
  memset(closed, 0, sizeof(closed));
  open.push(State(a, m, 0));

  while(!open.empty()){
    State st = open.top();
    open.pop();

    if(closed[st.id][st.rem]) continue;
    closed[st.id][st.rem] = true;

    if(st.id == h){
      cout << st.cost << endl;
      return ;
    }

    //テ・ツ崢榲・ツセツゥ
    if(f[st.id] && st.rem + 1 <= m){
      open.push(State(st.id, st.rem + 1, st.cost + 1));
    }

    //テァツァツサテ・ツ仰?
    for(int i = 0; i < t[st.id].size(); i++){
      Edge e = t[st.id][i];
      if(st.rem - e.cost < 0) continue;
      open.push(State(e.to, st.rem - e.cost, st.cost + e.cost));
    }
  }
  cout << "Help!" << endl;
}

int main(){
  while(cin >> n >> m >> l >> k >> a >> h, n){
    memset(f, 0, sizeof(f));
    for(int i = 0; i < n; i++){
      t[i].clear();
    }

    for(int i = 0; i < l; i++){
      int id;
      cin >> id;
      f[id] = true;
    }

    for(int i = 0; i < k; i++){
      int from, to, cost;
      cin >> from >> to >> cost;
      t[from].push_back(Edge(to, cost));
      t[to].push_back(Edge(from, cost));
    }

    solve();
  }
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:35:3: error: 'memset' was not declared in this scope
   35 |   memset(closed, 0, sizeof(closed));
      |   ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <queue>
  +++ |+#include <cstring>
    3 | #include <vector>
a.cc: In function 'int main()':
a.cc:67:5: error: 'memset' was not declared in this scope
   67 |     memset(f, 0, sizeof(f));
      |     ^~~~~~
a.cc:67:5: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

2 1 0 1 0 1
0 1 2
3 1 1 2 0 1
2
0 2 1
1 2 1
3 2 1 2 0 1
2
0 2 1
1 2 1
4 4 1 4 1 3
2
0 1 2
1 2 4
0 2 1
3 0 3
5 3 2 6 0 3
1 2
2 1 2
1 0 1
3 4 1
2 4 1
4 1 2
2 0 2
5 4 2 6 0 3
1 2
4 2 4
2 1 2
4 3 1
0 1 5
1 4 2
2 0 3
0 0 0 0 0 0

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 2 1 0 1 0 1
      | ^
Language: C++

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

using namespace std;
#define INF (1 << 30)
typedef pair<int, int> P;
typedef pair<int, P> T;

vector<P> edge[105];
int n, m, l, k, a, h;
bool recover[105];
int dist[105][105];

void dijkstra(int s){
	for(int i = 0;i < 105;i++)
		for(int j = 0;j < 105;j++)
			dist[i][j] = INF;
	dist[s][m] = 0;
	priority_queue<T, vector<T>, greater<T> > pq;
	pq.push(T(0, P(s, m)));
	while(!pq.empty()){
		T tmp = pq.top();pq.pop();
		int d = tmp.first, from = tmp.second.first, blood = tmp.second.second;
		if(dist[from][blood] < d)continue;
		for(int i = 0;i < edge[from].size();i++){
			int to = edge[from][i].first, r = edge[from][i].second;
			if(r > blood)continue;
			if(dist[to][blood - r] <= d + r)conitnue;
			dist[to][blood - r] = d + r;
			pq.push(T(dist[to][blood - r], P(to, blood - r)));
		}
		if(blood < m && recover[from]){
			if(dist[from][blood + 1] <= d + 1)continue;
			dist[from][blood + 1] = d + 1;
			pq.push(T(dist[from][blood + 1], P(from, blood + 1)));
		}
	}
}

int main(){
	int t, x, y;
	while(cin >> n >> m >> l >> k >> a >> h, n){
		fill(recover, recover + 105, false);
		for(int i = 0;i < 105;i++)edge[i].clear();
		for(int i = 0;i < l;i++){
			cin >>t;
			recover[t] = true;
		}
		for(int i = 0;i < k;i++){
			cin >> x >> y >> t;
			edge[x].push_back(P(y, t));
			edge[y].push_back(P(x, t));
		}
		dijkstra(a);
		int res = INF;
		for(int i = 0;i < 105;i++){
			res = min(res, dist[h][i]);
		}
		if(res == INF)cout <<"help!" << endl;
		cout << res << endl;	
	}
	return 0;
}

Compiler output:
a.cc: In function 'void dijkstra(int)':
a.cc:31:57: error: 'conitnue' was not declared in this scope
   31 |                         if(dist[to][blood - r] <= d + r)conitnue;
      |                                                         ^~~~~~~~
Language: C++

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

using namespace std;
#define INF (1 << 30)
typedef pair<int, int> P;
typedef pair<int, P> T;

vector<P> edge[105];
int n, m, l, k, a, h;
bool recover[105];
int dist[105][105];

void dijkstra(int s){
	for(int i = 0;i < 105;i++)
		for(int j = 0;j < 105;j++)
			dist[i][j] = INF;
	dist[s][m] = 0;
	priority_queue<T, vector<T>, greater<T> > pq;
	pq.push(T(0, P(s, m)));
	while(!pq.empty()){
		T tmp = pq.top();pq.pop();
		int d = tmp.first, from = tmp.second.first, blood = tmp.second.second;
		if(dist[from][blood] < d)continue;
		for(int i = 0;i < edge[from].size();i++){
			int to = edge[from][i].first, r = edge[from][i].second;
			if(r > blood)continue;
			if(dist[to][blood - r] <= d + r)cobtinue;
			dist[to][blood - r] = d + r;
			pq.push(T(dist[to][blood - r], P(to, blood - r)));
		}
		if(blood < m && recover[from]){
			if(dist[from][blood + 1] <= d + 1)continue;
			dist[from][blood + 1] = d + 1;
			pq.push(T(dist[from][blood + 1], P(from, blood + 1)));
		}
	}
}

int main(){
	int t, x, y;
	while(cin >> n >> m >> l >> k >> a >> h, n){
		fill(recover, recover + 105, false);
		for(int i = 0;i < 105;i++)edge[i].clear();
		for(int i = 0;i < l;i++){
			cin >>t;
			recover[t] = true;
		}
		for(int i = 0;i < k;i++){
			cin >> x >> y >> t;
			edge[x].push_back(P(y, t));
			edge[y].push_back(P(x, t));
		}
		dijkstra(a);
		int res = INF;
		for(int i = 0;i < 105;i++){
			res = min(res, dist[h][i]);
		}
		if(res == INF)cout <<"help!" << endl;
		cout << res << endl;	
	}
	return 0;
}

Compiler output:
a.cc: In function 'void dijkstra(int)':
a.cc:31:57: error: 'cobtinue' was not declared in this scope
   31 |                         if(dist[to][blood - r] <= d + r)cobtinue;
      |                                                         ^~~~~~~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<utility>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;
const int INF=99999;
typedef struct p{int pos,dis;}p;
typedef struct e{int to,cost;}e;


int N,M,L,K,A,H,C[100],D[100];;


struct Order
{
	bool operator ()(p const& a, p const& b) const
	{
		return a.dis>b.dis;
	}
};

void dij(int s,vector<e>E[100])
{
	priority_queue<p,vector<p>,Order>Q;
	fill(D,D+N,INF);
	D[s]=0;
	p tmp={s,0};
	Q.push(tmp);
	for(;!Q.empty();)
	{
		tmp=Q.top();Q.pop();
		if(D[tmp.pos]<tmp.dis)continue;
		for(int i=0;i<E[tmp.pos].size();i++)
		{
			e next=E[tmp.pos][i];
			if(D[next.to]>D[tmp.pos]+next.cost)
			{
				D[next.to]=D[tmp.pos]+next.cost;
				p ins={next.to,D[tmp.pos]+next.cost};
				Q.push(ins);
			}
		}
	}
}

int main()
{
	for(;scanf("%d%d%d%d%d%d",&N,&M,&L,&K,&A,&H),N;)
	{
		vector<e> G[100],G2[100];
		memset(C,0,sizeof(C));
		C[A]=C[H]=1;
		for(int i=0;i<L;i++)
		{
			int t;
			scanf("%d",&t);
			C[t]=1;
		}
		for(int i=0;i<K;i++)
		{
			int x,y,t;
			scanf("%d%d%d",&x,&y,&t);
			e e1={x,t},e2={y,t};
			G[y].push_back(e1);
			G[x].push_back(e2);
		}
		for(int i=0;i<N;i++)
		{
			dij(i,G);
			for(int j=0;j<N;j++)
			{
				if(C[j])
				{
					if(i!=j&&D[j]<=M)
					{
						e e1={j,D[j]};
						G2[i].push_back(e1);
					}
				}
			}
		}
		dij(A,G2);
		if(D[H]==INF)
			puts("Help!");
		else
			printf("%d\n",D[H]-min(0,M-D[H]));
	}
}

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

import java.util.*;
import static java.lang.Math.*;
public class Main {
	final Scanner sc=new Scanner(System.in);
	public static void main(String[] args) {
		new Main().init();
	}
	void init(){
		final long STACK_SIZE=8*1024*1024;
		new Thread(null, new AOJ2022(), "RUN", STACK_SIZE).start();
	}
	
	class AOJ2022 implements Runnable{
		AOJ2022(){}
		@Override public void run(){
			while(sc.hasNext()){
				N=sc.nextInt();
				if(N==0)	break;
				solve();
			}
		}
		
		int N,N2;
		
		void solve(){
			String[] str=new String[N];
			for(int i=0; i<N; ++i)	str[i]=sc.next();
			
			boolean[] eq=new boolean[N];
			for(int i=0; i<N; ++i){
				if(eq[i])	continue;
				for(int j=0; j<N; ++j){
					if(i!=j && !eq[j] && str[i].matches(".*?"+str[j]+".*?"))	eq[j]=true;
				}
			}
			ArrayList<String> str2=new ArrayList<String>();
			for(int i=0; i<N; ++i)if(!eq[i])	str2.add(str[i]);
			N2=str2.size();
			
//			System.out.println(str2);
			
			int[][] len=new int[N2][N2];
			for(int i=0; i<N2; ++i){
				for(int j=0; j<N2; ++j){
					if(i==j)	continue;
					int offset=0, l=str2.get(i).length();
					for( ; offset<l; ++offset){
						if( str2.get(j).startsWith( str2.get(i).substring(offset) ) )	break;
					}
					
					len[i][j]=l-offset;
				}
			}
			
//			for(int j=0; j<N2; ++j){
//				for(int i=0; i<N2; ++i)	System.out.print(len[i][j]+" | ");
//				System.out.println();
//			}
			
			StringBuilder[][] dp=new StringBuilder[1<<N2][N2];
			for(int i=0; i<N2; ++i){
				dp[1<<i][i]=new StringBuilder(str2.get(i));
			}
			for(int i=0; i<(1<<N2); ++i){
				for(int j=0; j<N2; ++j){
					if(dp[i][j]==null)	continue;
					for(int k=0; k<N2; ++k){
						if( (i&(1<<k)) > 0 )	continue;
						StringBuilder next=new StringBuilder(dp[i][j]);
						next.append(str2.get(k).substring(len[j][k]));
						int newIdx=i|(1<<k);
						int len1=dp[newIdx][k]==null? 1<<29 : dp[newIdx][k].length(), len2=next.length();
						if(len1>len2 || ( len1==len2 && dp[newIdx][k].toString().compareTo(next.toString()) > 0 ) ){
							dp[newIdx][k]=next;
						}
					}
				}
			}
			
//			for(int j=0; j<N2; ++j){
//				for(int i=0; i<(1<<N2); ++i)	System.out.print(dp[i][j]+" | ");
//				System.out.println();
//			}
			
			String ans=null;
			int tmp=(1<<N2)-1;
			for(int i=0; i<N2; ++i){
				if(dp[tmp][i]!=null && ( ans==null || ans.length() > dp[tmp][i].length() || ( ans.length()==dp[tmp][i].length() && ans.compareTo(dp[tmp][i].toString()) > 0 ) ) ){
					ans=dp[tmp][i].toString();
				}
			}
			System.out.println(ans);
			
		}
	}

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