제출 #1183515

#제출 시각아이디문제언어결과실행 시간메모리
1183515PagodePaiva수천개의 섬 (IOI22_islands)C++20
컴파일 에러
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; }

컴파일 시 표준 에러 (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;
      |        ^