Submission #1015720

#TimeUsernameProblemLanguageResultExecution timeMemory
1015720inesfiThousands Islands (IOI22_islands)C++17
0 / 100
19 ms6748 KiB
#include "islands.h" #include <bits/stdc++.h> #include <variant> using namespace std; const int MAXI = 100*1000; vector<int> noeudsAdj[MAXI]; const int PAS_VU = 0; const int EN_COURS_DE_VISITE = 1; const int DEJA_VISITE = 2; int noeudVisite[MAXI]; bool TrouveCycle(int noeud) { if (noeudVisite[noeud] == DEJA_VISITE) return false; if (noeudVisite[noeud] == EN_COURS_DE_VISITE) return true; noeudVisite[noeud] = EN_COURS_DE_VISITE; for (int arc = 0; arc < noeudsAdj[noeud].size(); arc++) if (TrouveCycle(noeudsAdj[noeud][arc])) return true; noeudVisite[noeud] = DEJA_VISITE; return false; } variant<bool, vector<int>> find_journey( int N, int M, vector<int> U, vector<int> V) { for(int n=0; n<N; n++){ noeudsAdj[U[n]].push_back(V[n]); noeudsAdj[V[n]].push_back(U[n]); } return TrouveCycle(0); }

Compilation message (stderr)

islands.cpp: In function 'bool TrouveCycle(int)':
islands.cpp:22:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |    for (int arc = 0; arc < noeudsAdj[noeud].size(); arc++)
      |                      ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#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...