Submission #1064224

#TimeUsernameProblemLanguageResultExecution timeMemory
1064224MarwenElarbiThousands Islands (IOI22_islands)C++17
Compilation error
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; }

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: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 | }
      | ^