제출 #836104

#제출 시각아이디문제언어결과실행 시간메모리
836104Trumling수천개의 섬 (IOI22_islands)C++17
컴파일 에러
0 ms0 KiB
#include "islands.h" #include <variant> #include <vector> #include<bits/stdc++.h> using namespace std; #define F first #define S second #define all(x) x.begin(),x.end() typedef long long ll; #define pb push_back #define INF 9999999999999999 variant<bool, vector<int> > find_journey(int N, int M, vector<int> U, vector<int> V) { ll z=0,o=0; for(int i=0;i<M;i++) if(U[i]) o++; else z++; if(o<1 || z<2) return false; return {0,1,0,1,0,1,0}; }

컴파일 시 표준 에러 (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:26:24: error: could not convert '{0, 1, 0, 1, 0, 1, 0}' from '<brace-enclosed initializer list>' to 'std::variant<bool, std::vector<int, std::allocator<int> > >'
   26 |   return {0,1,0,1,0,1,0};
      |                        ^
      |                        |
      |                        <brace-enclosed initializer list>