func_code_string: #include <bits/stdc++.h>   using namespace std;   vector<long long> x;   vector<vector<long long> > y;   vector<long long> bfs(long long k) {     vector<long long> p((long long)y.size() + 1, 0);     vector<bool> vis((long long)y.size() + 1, false);     vis[k] = true;     queue<long long> q;     q.push(k);     while (!q.empty()) {       long long k = q.front();       q.pop();       for (auto i : y[k]) {         if (!vis[i]) {           p[i] = p[k] + 1;           vis[i] = true;           q.push(i);         }       }     }     return p;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long n, m, k;     cin >> n >> m >> k;     y = vector<vector<long long> >(n + 1);     for (long long i = 0; i < k; i++) {       long long k;       cin >> k;       x.push_back(k);     };     for (long long j = 0; j < m; j++) {       long long p, q;       cin >> p >> q;       y[p].push_back(q);       y[q].push_back(p);     }     vector<long long> o = bfs(1);     vector<long long> l = bfs(n);     vector<pair<long long, long long> > z;     long long maxi = -1;     for (auto i : x) {       z.push_back({o[i] - l[i], l[i]});     }     sort(z.begin(), z.end());     vector<long long> suff(k + 1, 0);     long long ans = -1;     for (long long j = k - 1; j >= 0; j--) {       maxi = max(maxi, z[j].second);       suff[j] = maxi;     }     for (long long j = 0; j < k - 1; j++) {       ans = max(ans, suff[j + 1] + z[j].first + z[j].second + 1);     }     cout << min(ans, o[n]);     return 0;   }   