Problem subgraphs
User ryelin
Submission Time 2023-11-10 14:02:31
Score 0
Max Time N/A
Max Memory N/A

Compile Error

subgraphs.cpp:1:6: error: ‘vector’ in namespace ‘std’ does not name a template type
1 | std::vector<int>adjlist[N+5];
| ^~~~~~
subgraphs.cpp:1:1: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
+++ |+#include <vector>
1 | std::vector<int>adjlist[N+5];
subgraphs.cpp:2:14: error: ‘N’ was not declared in this scope
2 | bool visited[N+5];
| ^
subgraphs.cpp: In function ‘void dfs(int)’:
subgraphs.cpp:5:5: error: ‘visited’ was not declared in this scope
5 | if (visited[x]) return;
| ^~~~~~~
subgraphs.cpp:6:1: error: ‘visited’ was not declared in this scope
6 | visited[x] = true;
| ^~~~~~~
subgraphs.cpp:7:14: error: ‘adjlist’ was not declared in this scope
7 | for (auto i: adjlist[x]) {
| ^~~~~~~
subgraphs.cpp: In function ‘int main()’:
subgraphs.cpp:21:5: error: expected