func_code_string: #include <bits/stdc++.h>   using namespace std;   class myistream {     static const int maxsize = 1000007, tmpsize = 50;     char *s, *tmp;     char *cur, *upperbound;     FILE *fp;     bool last_read;     bool end_of_file;     bool to_return;     void upd() {       int num = fread(s, sizeof(char), maxsize, fp);       if (num < maxsize) last_read = true, upperbound = s + num;       if (!num) end_of_file = true;       cur = s;     }     char scan() {       if (cur >= upperbound) {         if (last_read)           end_of_file = true;         else           upd();       }       return *cur++;     }     bool isspace(char c) {       return c ==     || c ==   n  || c ==   r  || c ==   t ;     }       public:     myistream(FILE *_fp)         : last_read(false), end_of_file(false), to_return(false), fp(_fp) {       s = new char[maxsize + 2];       tmp = new char[tmpsize + 2];       upperbound = s + maxsize;       cur = s + maxsize;     }     ~myistream() {       delete[] s;       delete[] tmp;       fclose(fp);     }     operator void *() const { return to_return ? 0 : (void *)this; }     bool operator!() const { return to_return; }     myistream &operator>>(int &a) {       if (!end_of_file) {         char c = scan();         while (isspace(c) && !end_of_file) c = scan();         if (end_of_file) {           to_return = true;           return *this;         }         a = 0;         bool nega = false;         if (c ==  - ) nega = true, c = scan();         while (!isspace(c) && !end_of_file) {           a = a * 10 + (((int)c) & 15);           c = scan();         }         if (nega) a = -a;       } else         to_return = true;       return *this;     }     myistream &operator>>(long long &a) {       if (!end_of_file) {         char c = scan();         while (isspace(c) && !end_of_file) c = scan();         if (end_of_file) {           to_return = true;           return *this;         }         a = 0;         bool nega = false;         if (c ==  - ) nega = true, c = scan();         while (!isspace(c) && !end_of_file) {           a = a * 10 + (((long long)c) & 15);           c = scan();         }         if (nega) a = -a;       } else         to_return = true;       return *this;     }     myistream &operator>>(char &c) {       if (!end_of_file) {         c = scan();         while (isspace(c) && !end_of_file) c = scan();       }       if (end_of_file) to_return = true;       return *this;     }     myistream &operator>>(bool &b) {       if (!end_of_file) {         char c = scan();         while (isspace(c) && !end_of_file) c = scan();         b = (c ==  1 );       }       if (end_of_file) to_return = true;       return *this;     }     myistream &operator>>(char *s) {       if (!end_of_file) {         char c = scan();         while (isspace(c) && !end_of_file) c = scan();         if (end_of_file) {           to_return = true;           return *this;         }         while (!isspace(c) && !end_of_file) *s++ = c, c = scan();         *s =   0 ;       } else         to_return = true;       return *this;     }     myistream &operator>>(string &s) {       s.clear();       if (!end_of_file) {         char c = scan();         while (isspace(c) && !end_of_file) c = scan();         if (end_of_file) {           to_return = true;           return *this;         }         while (!isspace(c) && !end_of_file) s.push_back(c), c = scan();       } else         to_return = true;       return *this;     }     myistream &operator>>(double &d) {       if (!end_of_file) {         char *tp = tmp;         char c = scan();         while (isspace(c) && !end_of_file) c = scan();         if (end_of_file) {           to_return = true;           return *this;         }         while (!isspace(c) && !end_of_file) *tp++ = c, c = scan();         *tp =   0 ;         sscanf(tmp,  %lf , &d);       } else         to_return = true;       return *this;     }   };   class myostreamEndlType {};   class myostreamSetPrecisionType {    public:     int precision;     myostreamSetPrecisionType(int _precision) : precision(_precision) {}   };   class myostream {     static const int maxsize = 1000007, tmpsize = 50;     char *s, *upperbound, *cur, *tmp;     FILE *fp;     int numberAfterPoint;     char doubleFormat[20];     void write(char c) {       if (cur >= upperbound) {         fwrite(s, sizeof(char), maxsize, fp);         cur = s;       }       *cur++ = c;     }       public:     myostream(FILE *_fp) : fp(_fp) {       s = new char[maxsize];       tmp = new char[tmpsize + 2];       upperbound = s + maxsize;       cur = s;       precision(6);     }     ~myostream() {       fwrite(s, sizeof(char), cur - s, fp);       fclose(fp);       delete[] s;     }     void precision(int x) {       numberAfterPoint = x;       sprintf(doubleFormat,  %%.%dlf , x);     }     int precision(void) { return numberAfterPoint; }     myostream &operator<<(const myostreamSetPrecisionType &p) {       precision(p.precision);       return *this;     }     myostream &operator<<(const char &c) {       write(c);       return *this;     }     myostream &operator<<(const myostreamEndlType &e) {       write(  n );       return *this;     }     myostream &operator<<(const bool &b) {       write(b ?  1  :  0 );       return *this;     }     myostream &operator<<(const char *c) {       for (const char *p = c; *p; p++) write(*p);       return *this;     }     myostream &operator<<(const string &c) { return *this << c.c_str(); }     myostream &operator<<(const int &a) {       if (a == 0) {         write( 0 );         return *this;       }       int s = a;       if (s < 0) write( - ), s = -s;       char *tp = tmp;       while (s > 0) {         *tp++ = char((s % 10) | 48);         s /= 10;       }       for (--tp; tp >= tmp; --tp) write(*tp);       return *this;     }     myostream &operator<<(const long long &a) {       if (a == 0) {         write( 0 );         return *this;       }       long long s = a;       if (s < 0) write( - ), s = -s;       char *tp = tmp;       while (s > 0) {         *tp++ = char((s % 10) | 48);         s /= 10;       }       for (--tp; tp >= tmp; --tp) write(*tp);       return *this;     }     myostream &operator<<(const double &d) {       sprintf(tmp, doubleFormat, d);       *this << tmp;       return *this;     }   };   const int maxn = 100050, inf = 0x3fffffff;   int n, m, k;   bool hasv[maxn] = {};   int s, t;   vector<int> buf[maxn];   bool judge(int maxV) {     static bool inq[maxn];     static int dis[maxn];     memset(inq, false, sizeof inq);     fill(dis, dis + n, inf);     queue<int> q;     dis[s] = 0;     q.push(s);     inq[s] = true;     while (!q.empty()) {       int x = q.front();       q.pop();       inq[x] = false;       if (dis[x] < maxV)         for (auto it = (buf[x]).begin(); it != (buf[x]).end(); ++it) {           int tmp = dis[x] + 1;           if (hasv[*it]) tmp = 0;           if (dis[*it] > tmp) {             dis[*it] = tmp;             if (!inq[*it]) {               inq[*it] = true;               q.push(*it);             }           }         }     }     return dis[t] < inf;   }   int main(void) {     cin >> n >> m >> k;     while (k--) {       int a;       cin >> a;       --a;       hasv[a] = true;     }     while (m--) {       int a, b;       cin >> a >> b;       --a;       --b;       buf[a].push_back(b);       buf[b].push_back(a);     }     cin >> s >> t;     --s;     --t;     int left = 1, right = n + 1;     while (left < right) {       int mid = (left + right) >> 1;       if (judge(mid))         right = mid;       else         left = mid + 1;     }     if (left > n)       cout << -1 << endl;     else       cout << left << endl;   }   