func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 111111;   const int INF = 0x3f3f3f3f;   int vis[maxn];   bool selected[maxn];   int n, m;   vector<int> adj[maxn];   bool test[maxn];   double elapsed() { return clock() / (double)CLOCKS_PER_SEC; }   bool dfs(int v) {     if (selected[v] == true) return false;     vis[v] = -1;     for (auto w : adj[v]) {       if (vis[w] == 0) {         if (dfs(w)) return true;       } else if (vis[w] == -1) {         for (int i = 1; i <= n; i++) {           if (vis[i] != -1) test[i] = true;         }         return true;       }     }     vis[v] = 1;     return false;   }   bool check() {     memset(vis, 0, sizeof vis);     for (int i = 1; i <= n; i++) {       if (!vis[i] && dfs(i)) return false;     }     return true;   }   int main() {     scanf( %d%d , &n, &m);     for (int i = 0; i < m; ++i) {       int u, v;       scanf( %d%d , &u, &v);       adj[u].push_back(v);     }     vector<int> emp;     for (int i = 0; i < n; ++i) emp.push_back(i + 1);     random_shuffle(emp.begin(), emp.end());     for (int i = 0; elapsed() <= 0.95 and i < emp.size(); i++) {       selected[emp[i]] = true;       if (!test[emp[i]] && check()) {         printf( %d n , emp[i]);         return 0;       }       selected[emp[i]] = false;     }     puts( -1 );   }   