diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-11-13 23:04:04 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-11-13 23:04:04 +0100 |
commit | ce845d792479e9c153274c2ad5a199a7f7c17a41 (patch) | |
tree | 8b4507e882ad164e7397e8ec19858b6456fa017b /03-algorithms_on_graphs/02-decomposition/01-acyclicity/acyclicity.cpp | |
parent | 8b1d89f99eacc097d354b0f5564c6654b84510e8 (diff) | |
download | coursera-ce845d792479e9c153274c2ad5a199a7f7c17a41.zip coursera-ce845d792479e9c153274c2ad5a199a7f7c17a41.tar.gz |
Algorithms : add 03-algorithms_on_graphs 02-decomposition
Diffstat (limited to '03-algorithms_on_graphs/02-decomposition/01-acyclicity/acyclicity.cpp')
-rw-r--r-- | 03-algorithms_on_graphs/02-decomposition/01-acyclicity/acyclicity.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/03-algorithms_on_graphs/02-decomposition/01-acyclicity/acyclicity.cpp b/03-algorithms_on_graphs/02-decomposition/01-acyclicity/acyclicity.cpp new file mode 100644 index 0000000..9cd27e6 --- /dev/null +++ b/03-algorithms_on_graphs/02-decomposition/01-acyclicity/acyclicity.cpp @@ -0,0 +1,22 @@ +#include <iostream> +#include <vector> + +using std::vector; +using std::pair; + +int acyclic(vector<vector<int> > &adj) { + //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); + } + std::cout << acyclic(adj); +} |