Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool reitou[100];
int time[100][100];
int main(void) {
	for (;;) {
		int n, m, l, k, a, h;
		cin >> n >> m >> l >> k >> a >> h;
		if (!n)return 0;
		fill(&reitou[0], &reitou[99], false);
		fill(&time[0][0], &time[99][99], INT_MAX >> 1);
		reitou[a] =reitou[h] =true;
		for (int i = 0; i < l; i++) {
			int buf;
			cin >> buf;
			reitou[buf] = true;
		}
		for (int i = 0; i < k; i++) {
			int x, y, t;
			cin >> x >> y >> t;
			time[x][y] = t;
			time[y][x] = t;

		}
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				for (int k = 0; k < n; k++) {
					time[i][k] = min(time[i][k], time[i][j] + time[j][k]);
				}
			}
		}
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				if (!reitou[i])time[i][j] = INT_MAX >> 1;
				if (!reitou[j])time[i][j] = INT_MAX >> 1;
				if (time[i][j]>m)time[i][j] = INT_MAX >> 1;
			}
		}
		for (int i = 0; i < n; i++) {//??????????????±???
			for (int j = 0; j < n; j++) {
				for (int k = 0; k < n; k++) {
					time[j][k] = min(time[j][k], time[j][i] + time[i][k]);
				}
			}
		}
		if (time[a][h] == (INT_MAX >> 1)) {
			cout << "Help!" << endl;
		}
		else {
			cout << time[a][h] + max(0, time[a][h] - m) << endl;
		}
	}
}

Compiler output:
a.cc:6:18: error: 'int time [100][100]' redeclared as different kind of entity
    6 | int time[100][100];
      |                  ^
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 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/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
a.cc: In function 'int main()':
a.cc:13:29: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   13 |                 fill(&time[0][0], &time[99][99], INT_MAX >> 1);
      |                             ^
a.cc:13:32: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   13 |                 fill(&time[0][0], &time[99][99], INT_MAX >> 1);
      |                                ^
a.cc:13:43: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   13 |                 fill(&time[0][0], &time[99][99], INT_MAX >> 1);
      |                                           ^
a.cc:13:47: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   13 |                 fill(&time[0][0], &time[99][99], INT_MAX >> 1);
      |                                               ^
a.cc:13:50: error: 'INT_MAX' was not declared in this scope
   13 |                 fill(&time[0][0], &time[99][99], INT_MAX >> 1);
      |                                                  ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <algorithm>
  +++ |+#include <climits>
    4 | using namespace std;
a.cc:23:31: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   23 |                         time[x][y] = t;
      |                               ^
a.cc:23:34: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   23 |                         time[x][y] = t;
      |                                  ^
a.cc:23:36: error: assignment of read-only location '*(time + (((sizetype)x) + ((sizetype)y)))'
   23 |                         time[x][y] = t;
      |                         ~~~~~~~~~~~^~~
a.cc:24:31: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   24 |                         time[y][x] = t;
      |                               ^
a.cc:24:34: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   24 |                         time[y][x] = t;
      |                                  ^
a.cc:24:36: error: assignment of read-only location '*(time + (((sizetype)y) + ((sizetype)x)))'
   24 |                         time[y][x] = t;
      |                         ~~~~~~~~~~~^~~
a.cc:30:47: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   30 |                                         time[i][k] = min(time[i][k], time[i][j] + time[j][k]);
      |                                               ^
a.cc:30:50: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   30 |                                         time[i][k] = min(time[i][k], time[i][j] + time[j][k]);
      |                                                  ^
a.cc:30:64: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   30 |                                         time[i][k] = min(time[i][k], time[i][j] + time[j][k]);
      |                                                                ^
a.cc:30:67: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   30 |                                         time[i][k] = min(time[i][k], time[i][j] + time[j][k]);
      |                                                                   ^
a.cc:30:76: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   30 |                                         time[i][k] = min(time[i][k], time[i][j] + time[j][k]);
      |                                                                            ^
a.cc:30:79: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   30 |                                         time[i][k] = min(time[i][k], time[i][j] + time[j][k]);
      |                                                                               ^
a.cc:30:89: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   30 |                                         time[i][k] = min(time[i][k], time[i][j] + time[j][k]);
      |                                                                                         ^
a.cc:30:92: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   30 |                                         time[i][k] = min(time[i][k], time[i][j] + time[j][k]);
      |                                                                                            ^
a.cc:30:81: error: invalid operands of types 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'} and 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'} to binary 'operator+'
   30 |                                         time[i][k] = min(time[i][k], time[i][j] + time[j][k]);
      |                                                                      ~~~~~~~~~~ ^ ~~~~~~~~~~
      |                                                                               |            |
      |                                                                               |            time_t(time_t*) noexcept {aka long int(long int*) noexcept}
      |                                                                               time_t(time_t*) noexcept {aka long int(long int*) noexcept}
a.cc:36:54: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   36 |                                 if (!reitou[i])time[i][j] = INT_MAX >> 1;
      |                                                      ^
a.cc:36:57: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   36 |                                 if (!reitou[i])time[i][j] = INT_MAX >> 1;
      |                                                         ^
a.cc:37:54: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   37 |                                 if (!reitou[j])time[i][j] = INT_MAX >> 1;
      |                                                      ^
a.cc:37:57: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   37 |                                 if (!reitou[j])time[i][j] = INT_MAX >> 1;
      |                                                         ^
a.cc:38:43: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   38 |                                 if (time[i][j]>m)time[i][j] = INT_MAX >> 1;
      |                                           ^
a.cc:38:46: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   38 |                                 if (time[i][j]>m)time[i][j] = INT_MAX >> 1;
      |                                              ^
a.cc:38:47: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   38 |                                 if (time[i][j]>m)time[i][j] = INT_MAX >> 1;
      |                                     ~~~~~~~~~~^~
a.cc:38:56: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   38 |                                 if (time[i][j]>m)time[i][j] = INT_MAX >> 1;
      |                                                        ^
a.cc:38:59: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   38 |                                 if (time[i][j]>m)time[i][j] = INT_MAX >> 1;
      |                                                           ^
a.cc:44:47: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   44 |                                         time[j][k] = min(time[j][k], time[j][i] + time[i][k]);
      |                                               ^
a.cc:44:50: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   44 |                                         time[j][k] = min(time[j][k], time[j][i] + time[i][k]);
      |                                                  ^
a.cc:44:64: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   44 |                                         time[j][k] = min(time[j][k], time[j][i] + time[i][k]);
      |                                                                ^
a.cc:44:67: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   44 |                                         time[j][k] = min(time[j][k], time[j][i] + time[i][k]);
      |                                                                   ^
a.cc:44:76: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   44 |                                         time[j][k] = min(time[j][k], time[j][i] + time[i][k]);
      |                                                                            ^
a.cc:44:79: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   44 |                                         time[j][k] = min(time[j][k], time[j][i] + time[i][k]);
      |                                                                               ^
a.cc:44:89: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   44 |                                         time[j][k] = min(time[j][k], time[j][i] + time[i][k]);
      |                                                                                         ^
a.cc:44:92: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   44 |                                         time[j][k] = min(time[j][k], time[j][i] + time[i][k]);
      |                                                                                            ^
a.cc:44:81: error: invalid operands of types 'time_t(time_t*) noexcept' {aka 'long int(long int*) noex