Problem subgraphs
User sid
Submission Time 2026-10-26 16:05:06
Score 0
Max Time N/A
Max Memory N/A

Compile Error

subgraphs.cpp:7:5: error: expected unqualified-id before ‘if’
7 | if (visited[x]) {
| ^~
subgraphs.cpp:10:5: error: ‘visited’ does not name a type; did you mean ‘visites’?
10 | visited[x] = true;
| ^~~~~~~
| visites
subgraphs.cpp:11:5: error: expected unqualified-id before ‘for’
11 | for (int i:graph[x]) {
| ^~~
subgraphs.cpp: In function ‘int main()’:
subgraphs.cpp:24:29: error: no matching function for call to ‘std::vector<std::vector<int> >::push_back(int&)’
24 | graph[A].push_back(B);
| ^
In file included from /usr/include/c++/9/vector:67,
from /usr/include/c++/9/functional:62,
from /usr/include/c++/9/pstl/glue_algorithm_defs.h:13,
from /usr/include/c++/9/algorithm:71,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,