-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdfs.cpp
More file actions
38 lines (31 loc) · 875 Bytes
/
dfs.cpp
File metadata and controls
38 lines (31 loc) · 875 Bytes
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
27
28
29
30
31
32
33
34
35
36
37
38
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define mp make_pair
#define pi pair<int, int>
#define endl "\n"
const int inf = 1e18;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
freopen("input.txt", "r", stdin);
auto dfs = [&](auto &&self, int curr, int p) -> void {
// if(adj[curr].size()==1) {
// minVal[curr] = curr;
// }
// else {
// for(int x:adj[curr]) {
// if(x!=p) {
// self(self,x,curr);
// if(minVal[x]<minVal[curr]) {
// minVal[curr]=minVal[x];
// }
// }
// }
// }
// return minVal[curr];
};
dfs(dfs,0,0);
return 0;
}