Submission #632103

#TimeUsernameProblemLanguageResultExecution timeMemory
632103Minindu2006Thousands Islands (IOI22_islands)C++17
Compilation error
0 ms0 KiB
#include "islands.h" #include<bits/stdc++.h> #include <variant> #include <vector> using namespace std; int n, m, can = -1; vector<int> u, v; vector<int> adj[1001]; void dfs(int node, vector<int> &ans); std::variant<bool, std::vector<int>> find_journey( int N, int M, std::vector<int> U, std::vector<int> V) { n = N, m = M; U = u, v = V; if(m <= 2) return 0; int z = 0; vector<int> cur(3); for(int i=0;i<m;i++) { if(u[i] == 0) { if(z < 2) cur[z] = i; z++; } else cur[2] = i; } if(z <= 1) return 0; for(int i=0;i<3;i++) cur.push_back(cur[i]); return cur; }

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:19:14: error: could not convert '0' from 'int' to 'std::variant<bool, std::vector<int, std::allocator<int> > >'
   19 |       return 0;
      |              ^
      |              |
      |              int
islands.cpp:34:14: error: could not convert '0' from 'int' to 'std::variant<bool, std::vector<int, std::allocator<int> > >'
   34 |       return 0;
      |              ^
      |              |
      |              int