blob: cb2e76f4e6131434362f3b95ab554913f401cc9f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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);
}
|