Submission #1183515

#TimeUsernameProblemLanguageResultExecution timeMemory
1183515PagodePaivaThousands Islands (IOI22_islands)C++20
Compilation error
0 ms0 KiB
#include "islands.h" #include<bits/stdc++.h> #include <variant> #include <vector> using namespace std; const int N = 1010 vector <int> g[N]; std::variant<bool, std::vector<int>> find_journey( int N, int M, std::vector<int> U, std::vector<int> V) { for(int i = 0;i < M;i++){ g[U[i]].push_back(V[i]); } if(g[0].size() < 2) return false; vector <int> ans = {}; return ans; }

Compilation message (stderr)

islands.cpp:9:1: error: expected ',' or ';' before 'vector'
    9 | vector <int> g[N];
      | ^~~~~~
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:14:9: error: 'g' was not declared in this scope
   14 |         g[U[i]].push_back(V[i]);
      |         ^
islands.cpp:16:8: error: 'g' was not declared in this scope
   16 |     if(g[0].size() < 2) return false;
      |        ^