제출 #1070359

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

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