Submission #667064

#TimeUsernameProblemLanguageResultExecution timeMemory
667064StavabThousands Islands (IOI22_islands)C++17
Compilation error
0 ms0 KiB
#include "islands.h" #include <variant> #include <vector> std::variant<bool, std::vector<int>> find_journe(int N, int M, std::vector<int> U, std::vector<int> V) { if(N == 2) { int c1 = 0, c2 = 0; for(int i = 0; i < U.size(); i++) { if(U[i] == 0) c1++; else c2++; } std::vector<int> v = {0, 1, 0, 1, 0}; std::variant<bool, std::vector<int>> var; var = v; if(c1 >= 2 && c2 >= 1) return var; } return false; }

Compilation message (stderr)

islands.cpp: In function 'std::variant<bool, std::vector<int, std::allocator<int> > > find_journe(int, int, std::vector<int>, std::vector<int>)':
islands.cpp:11:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for(int i = 0; i < U.size(); i++)
      |                    ~~^~~~~~~~~~
/usr/bin/ld: /tmp/cciIVpnU.o: in function `main':
grader.cpp:(.text.startup+0x229): undefined reference to `find_journey(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status