func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long MOD = (long long)(1e9 + 7);   const int inf = (int)INFINITY;   const long long INF = (long long)INFINITY;   const int MAX = (int)(2e5 + 5);   const int maxn = 2e5 + 5;   int n, m, k, p[maxn], path[maxn];   vector<int> in[maxn], out[maxn];   int maxa, mina;   set<pair<long long, long long> > st;   void dijkstra() {     while (st.size()) {       pair<long long, long long> x = *st.begin();       st.erase(x);       int i = x.second;       for (auto A : in[i]) {         if (path[i] + 1 < path[A]) {           st.erase(pair<long long, long long>(path[A], A));           path[A] = path[i] + 1;           st.insert(pair<long long, long long>(path[A], A));         }       }     }   }   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     ;     cin >> n >> m;     for (long long i = 0; i < (m); ++i) {       int u, v;       cin >> u >> v;       out[u].push_back(v);       in[v].push_back(u);     }     cin >> k;     for (int i = 1; i <= k; ++i) cin >> p[i];     memset(path, 63, sizeof path);     path[p[k]] = 0;     st.insert(pair<long long, long long>(0, p[k]));     dijkstra();     for (int i = 2; i <= k; ++i) {       if (path[p[i]] != path[p[i - 1]] - 1) {         ++mina;         ++maxa;       } else {         int e = 0;         for (auto A : out[p[i - 1]])           if (A != p[i] && path[A] == path[p[i]]) e = 1;         maxa += e;       }     }     cout << mina <<     << maxa;     return 0;   }   