diff options
Diffstat (limited to '03-algorithms_on_graphs/01-decomposition/01-reachability/reachability.cpp')
-rw-r--r-- | 03-algorithms_on_graphs/01-decomposition/01-reachability/reachability.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/03-algorithms_on_graphs/01-decomposition/01-reachability/reachability.cpp b/03-algorithms_on_graphs/01-decomposition/01-reachability/reachability.cpp new file mode 100644 index 0000000..cb2e76f --- /dev/null +++ b/03-algorithms_on_graphs/01-decomposition/01-reachability/reachability.cpp @@ -0,0 +1,26 @@ +#include <iostream> +#include <vector> + +using std::vector; +using std::pair; + + +int reach(vector<vector<int> > &adj, int x, int y) { + //write your code here + return 0; +} + +int main() { + size_t n, m; + std::cin >> n >> m; + vector<vector<int> > adj(n, vector<int>()); + for (size_t i = 0; i < m; i++) { + int x, y; + std::cin >> x >> y; + adj[x - 1].push_back(y - 1); + adj[y - 1].push_back(x - 1); + } + int x, y; + std::cin >> x >> y; + std::cout << reach(adj, x - 1, y - 1); +} |