Submission #797611

#TimeUsernameProblemLanguageResultExecution timeMemory
797611elpro123Thousands Islands (IOI22_islands)C++17
Compilation error
0 ms0 KiB
#include "islands.h" #include <bits/stdc++.h> using namespace std; vector<int> find_journey(int N, int M, vector<int> U, vector<int> V){ vector<int> a, b; for (int i = 0; i < M; i++) { if (U[i] == 0) { a.push_back(i); } else { b.push_back(i); } } if (a.size() >= 2 && b.size() >= 1) { return vector{a[0], b[0], a[1], a[0], b[0], a[1]}; } else { return {}; } }

Compilation message (stderr)

islands.cpp:5:13: error: ambiguating new declaration of 'std::vector<int> find_journey(int, int, std::vector<int>, std::vector<int>)'
    5 | vector<int> find_journey(int N, int M,  vector<int> U,  vector<int> V){
      |             ^~~~~~~~~~~~
In file included from islands.cpp:1:
islands.h:4:38: note: old declaration 'std::variant<bool, std::vector<int, std::allocator<int> > > find_journey(int, int, std::vector<int>, std::vector<int>)'
    4 | std::variant<bool, std::vector<int>> find_journey(
      |                                      ^~~~~~~~~~~~