Submission #654834

#TimeUsernameProblemLanguageResultExecution timeMemory
654834aryan12Thousands Islands (IOI22_islands)C++17
Compilation error
0 ms0 KiB
#include "islands.h" #include <bits/stdc++.h> using namespace std; variant<bool, vector<int> > find_journey(int N, int M, vect or<int> U, vector<int> V) { vector<int> c1, c2; for(int i = 0; i < M; i++) { if(U[i] == 0) { c1.push_back(i); } else { c2.push_back(i); } } if(c1.size() < 2 || c2.size() < 1) { return false; } return vector<int>({c1[0], c2[0], c1[1], c1[0], c2[0], c1[1]}); // if true return vector<int>({0, 1, 2}); // if false return false; }

Compilation message (stderr)

islands.cpp:5:56: error: 'vect' has not been declared
    5 | variant<bool, vector<int> > find_journey(int N, int M, vect or<int> U, vector<int> V)
      |                                                        ^~~~
islands.cpp:5:61: error: expected ',' or '...' before 'or' token
    5 | variant<bool, vector<int> > find_journey(int N, int M, vect or<int> U, vector<int> V)
      |                                                             ^~
islands.cpp: In function 'std::variant<bool, std::vector<int, std::allocator<int> > > find_journey(int, int, int)':
islands.cpp:10:12: error: 'U' was not declared in this scope
   10 |         if(U[i] == 0)
      |            ^