Submission #797634

#TimeUsernameProblemLanguageResultExecution timeMemory
797634ChrisM2309Thousands Islands (IOI22_islands)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; variant<bool, vector<int>> find_journey(int N, int M, int[] U, int[] V){ if (N == 2){ int cont0 = 0, cont1 = 0; int b1 = -1, b2 = -1, b3 = -1; for (int i = 0; i < M; i++){ if(U[i] == 0){ cont0++; if(b1==-1) b1 = i; else b2 = i; } else cont1++; b3 = i; } if(cont0 > 1 and cont1 > 0){ vector<int> ans = {b1, b3, b2, b1, b3, b2}; return ans; } else return false; } return false; }

Compilation message (stderr)

islands.cpp:4:61: error: expected ',' or '...' before 'U'
    4 | variant<bool, vector<int>> find_journey(int N, int M, int[] U, int[] V){
      |                                                             ^
islands.cpp: In function 'std::variant<bool, std::vector<int, std::allocator<int> > > find_journey(int, int, int*)':
islands.cpp:9:16: error: 'U' was not declared in this scope
    9 |             if(U[i] == 0){
      |                ^