Submission #736359

#TimeUsernameProblemLanguageResultExecution timeMemory
736359puppyThousands Islands (IOI22_islands)C++17
5 / 100
44 ms4084 KiB
#include "islands.h" #include <variant> #include <vector> using namespace std; std::variant<bool, std::vector<int>> find_journey( int N, int M, std::vector<int> U, std::vector<int> V) { int a01, a10, a02, a20; if (N == 2) return false; else { for (int i = 0; i < M; i++) { if (U[i] == 0) { if (V[i] == 1) a01 = i; else if (V[i] == 2) a02 = i; } else if (V[i] == 0 && U[i] == 1) a10 = i; else if (V[i] == 0 && U[i] == 2) a20 = i; } return vector<int>({a01, a10, a02, a20, a10, a01, a20, a02}); } }

Compilation message (stderr)

islands.cpp: In function 'std::variant<bool, std::vector<int, std::allocator<int> > > find_journey(int, int, std::vector<int>, std::vector<int>)':
islands.cpp:19:72: warning: 'a20' may be used uninitialized in this function [-Wmaybe-uninitialized]
   19 |             return vector<int>({a01, a10, a02, a20, a10, a01, a20, a02});
      |                                                                        ^
islands.cpp:19:72: warning: 'a02' may be used uninitialized in this function [-Wmaybe-uninitialized]
islands.cpp:19:72: warning: 'a10' may be used uninitialized in this function [-Wmaybe-uninitialized]
islands.cpp:19:72: warning: 'a01' may be used uninitialized in this function [-Wmaybe-uninitialized]
#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...