Submission #638735

#TimeUsernameProblemLanguageResultExecution timeMemory
638735aris12345678Thousands Islands (IOI22_islands)C++17
5 / 100
34 ms3628 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 == 2) return false; int a, b, c, d, e, f; for(int i = 0; i < m; i++) { if(u[i] == 0 && v[i] == 1) a = i; if(u[i] == 1 && v[i] == 2) b = i; if(u[i] == 2 && v[i] == 0) c = i; if(u[i] == 1 && v[i] == 0) d = i; if(u[i] == 2 && v[i] == 1) e = i; if(u[i] == 0 && v[i] == 2) f = i; } return vector<int>({a, b, c, f, e, d, c, b, a, d, e, f}); }

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:23:60: warning: 'f' may be used uninitialized in this function [-Wmaybe-uninitialized]
   23 |     return vector<int>({a, b, c, f, e, d, c, b, a, d, e, f});
      |                                                            ^
islands.cpp:23:60: warning: 'e' may be used uninitialized in this function [-Wmaybe-uninitialized]
islands.cpp:23:60: warning: 'd' may be used uninitialized in this function [-Wmaybe-uninitialized]
islands.cpp:23:60: warning: 'c' may be used uninitialized in this function [-Wmaybe-uninitialized]
islands.cpp:23:60: warning: 'b' may be used uninitialized in this function [-Wmaybe-uninitialized]
islands.cpp:23:60: warning: 'a' 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...