Submission #1074286

#TimeUsernameProblemLanguageResultExecution timeMemory
1074286fv3Thousands Islands (IOI22_islands)C++17
5 / 100
31 ms4440 KiB
#include "islands.h" #include <bits/stdc++.h> using namespace std; variant<bool, vector<int>> find_journey(int N, int M, vector<int> U, vector<int> V) { if (N < 3) return false; int s_out, s_in; for (int i = 0; i < M; i++) { if (U[i] == 0) { s_out = i; for (int j = 0; j < M; j++) { if (U[j] != V[i] || V[j] != 0) continue; s_in = j; break; } break; } } int e_out, e_in; for (int i = s_out + 1; i < M; i++) { if (U[i] == 0) { e_out = i; for (int j = 0; j < M; j++) { if (U[j] != V[i] || V[j] != 0) continue; e_in = j; break; } break; } } return vector<int>({s_out, s_in, e_out, e_in, s_in, s_out, e_in, e_out}); }

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:28:12: warning: 's_out' may be used uninitialized in this function [-Wmaybe-uninitialized]
   28 |   for (int i = s_out + 1; i < M; i++)
      |            ^
islands.cpp:43:74: warning: 'e_in' may be used uninitialized in this function [-Wmaybe-uninitialized]
   43 |   return vector<int>({s_out, s_in, e_out, e_in, s_in, s_out, e_in, e_out});
      |                                                                          ^
islands.cpp:43:74: warning: 'e_out' may be used uninitialized in this function [-Wmaybe-uninitialized]
islands.cpp:43:74: warning: 's_in' 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...