Submission #830799

#TimeUsernameProblemLanguageResultExecution timeMemory
830799tolbiThousands Islands (IOI22_islands)C++17
0 / 100
32 ms5300 KiB
#include <bits/stdc++.h> using namespace std; #define coutarr(x) for (auto &it : x) cout<<it<<" ";cout<<endl; #include "islands.h" variant<bool, vector<int>> find_journey(int N, int M, vector<int> U, vector<int> V) { vector<vector<pair<int,int>>> arr(N); for (int i = 0; i < M; ++i) { arr[U[i]].push_back({V[i],i}); } vector<int> ansarr; vector<bool> vis(N,false); auto dfs = [&](int node, auto dfs)->bool{ if (vis[node]) return true; vis[node]=true; ansarr.push_back(node); for (int i = 0; i < arr[node].size(); i++){ if (dfs(arr[node][i].first,dfs)) return true; } ansarr.pop_back(); return false; }; if (!dfs(0,dfs)) return false; return true; }

Compilation message (stderr)

islands.cpp: In instantiation of 'find_journey(int, int, std::vector<int>, std::vector<int>)::<lambda(int, auto:23)> [with auto:23 = find_journey(int, int, std::vector<int>, std::vector<int>)::<lambda(int, auto:23)>]':
islands.cpp:23:19:   required from here
islands.cpp:17:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |         for (int i = 0; i < arr[node].size(); i++){
      |                         ~~^~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...