제출 #638294

#제출 시각아이디문제언어결과실행 시간메모리
638294jamezzz수천개의 섬 (IOI22_islands)C++17
컴파일 에러
0 ms0 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 0; int a,b,c,d; for(int i=0;i<M;++i){ if(U[i]==0&&V[i]==1)a=i; if(U[i]==1&&V[i]==0)b=i; if(U[i]==0&&V[i]==2)c=i; if(U[i]==2&&V[i]==0)d=i; } return vector<int>{a,b,c,d,b,a,d,c}; }

컴파일 시 표준 에러 (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:6:16: error: could not convert '0' from 'int' to 'std::variant<bool, std::vector<int, std::allocator<int> > >'
    6 |  if(N<3)return 0;
      |                ^
      |                |
      |                int