제출 #1015720

#제출 시각아이디문제언어결과실행 시간메모리
1015720inesfi수천개의 섬 (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); }

컴파일 시 표준 에러 (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...