aboutsummaryrefslogtreecommitdiff
path: root/sum_dist_tree.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sum_dist_tree.cpp')
-rw-r--r--sum_dist_tree.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/sum_dist_tree.cpp b/sum_dist_tree.cpp
index 93efec8..10fc449 100644
--- a/sum_dist_tree.cpp
+++ b/sum_dist_tree.cpp
@@ -2,7 +2,7 @@
class Solution {
public:
- vector<int> sumOfDistancesInTree(int n, vvd(int) & edges) {
+ vector<int> sumOfDistancesInTree(int n, vvd & edges) {
tree.resize(n);
ans.assign(n, 0);
count.assign(n, 1);
@@ -39,7 +39,7 @@ private:
int main() {
Solution obj;
- vvd(int) edges = {{0, 1}, {0, 2}, {2, 3}, {2, 4}, {2, 5}};
+ vvd edges = {{0, 1}, {0, 2}, {2, 3}, {2, 4}, {2, 5}};
for (auto i : obj.sumOfDistancesInTree(6, edges))
cout << i << ' '; // expect: 8 12 6 10 10 10
}