제출 #1064224

#제출 시각아이디문제언어결과실행 시간메모리
1064224MarwenElarbi수천개의 섬 (IOI22_islands)C++17
컴파일 에러
0 ms0 KiB
#include "islands.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define ll long long #define fi first #define se second std::variant<bool, std::vector<int>> find_journey( int N, int M, std::vector<int> U, std::vector<int> V) { int a=0; int b=0; for (int i = 0; i < M; ++i) { (U[i]==0 ? a : b)++; } if(a.size()>=2&&b.size()>=2) return true; else return false; }

컴파일 시 표준 에러 (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:17:8: error: request for member 'size' in 'a', which is of non-class type 'int'
   17 |   if(a.size()>=2&&b.size()>=2) return true;
      |        ^~~~
islands.cpp:17:21: error: request for member 'size' in 'b', which is of non-class type 'int'
   17 |   if(a.size()>=2&&b.size()>=2) return true;
      |                     ^~~~
islands.cpp:19:1: warning: control reaches end of non-void function [-Wreturn-type]
   19 | }
      | ^