Submission #1070359

#TimeUsernameProblemLanguageResultExecution timeMemory
1070359UnforgettableplThousands Islands (IOI22_islands)C++17
5 / 100
38 ms3156 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; vector<vector<pair<int,int>>> adj(N); int a,aXOR,b,bXOR; for(int i=0;i<M;i++){ if(U[i]==0 and V[i]==1)a=i; else if(U[i]==1 and V[i]==0)aXOR=i; else if(U[i]==0 and V[i]==2)b=i; else if(U[i]==2 and V[i]==0)bXOR=i; } return vector({a,aXOR,b,bXOR,aXOR,a,bXOR,b}); }

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:15:48: warning: 'bXOR' may be used uninitialized in this function [-Wmaybe-uninitialized]
   15 |     return vector({a,aXOR,b,bXOR,aXOR,a,bXOR,b});
      |                                                ^
islands.cpp:15:48: warning: 'b' may be used uninitialized in this function [-Wmaybe-uninitialized]
islands.cpp:15:48: warning: 'aXOR' may be used uninitialized in this function [-Wmaybe-uninitialized]
islands.cpp:15:48: 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...