|
1 |
| -# [10034. Find Number of Coins to Place in Tree Nodes](https://leetcode.com/problems/find-number-of-coins-to-place-in-tree-nodes) |
| 1 | +# [2973. Find Number of Coins to Place in Tree Nodes](https://leetcode.com/problems/find-number-of-coins-to-place-in-tree-nodes) |
2 | 2 |
|
3 |
| -[中文文档](/solution/10000-10099/10034.Find%20Number%20of%20Coins%20to%20Place%20in%20Tree%20Nodes/README.md) |
| 3 | +[中文文档](/solution/2900-2999/2973.Find%20Number%20of%20Coins%20to%20Place%20in%20Tree%20Nodes/README.md) |
4 | 4 |
|
5 | 5 | ## Description
|
6 | 6 |
|
|
19 | 19 |
|
20 | 20 | <p> </p>
|
21 | 21 | <p><strong class="example">Example 1:</strong></p>
|
22 |
| -<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/10000-10099/10034.Find%20Number%20of%20Coins%20to%20Place%20in%20Tree%20Nodes/images/screenshot-2023-11-10-012641.png" style="width: 600px; height: 233px;" /> |
| 22 | +<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/2900-2999/2973.Find%20Number%20of%20Coins%20to%20Place%20in%20Tree%20Nodes/images/screenshot-2023-11-10-012641.png" style="width: 600px; height: 233px;" /> |
23 | 23 | <pre>
|
24 | 24 | <strong>Input:</strong> edges = [[0,1],[0,2],[0,3],[0,4],[0,5]], cost = [1,2,3,4,5,6]
|
25 | 25 | <strong>Output:</strong> [120,1,1,1,1,1]
|
26 | 26 | <strong>Explanation:</strong> For node 0 place 6 * 5 * 4 = 120 coins. All other nodes are leaves with subtree of size 1, place 1 coin on each of them.
|
27 | 27 | </pre>
|
28 | 28 |
|
29 | 29 | <p><strong class="example">Example 2:</strong></p>
|
30 |
| -<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/10000-10099/10034.Find%20Number%20of%20Coins%20to%20Place%20in%20Tree%20Nodes/images/screenshot-2023-11-10-012614.png" style="width: 800px; height: 374px;" /> |
| 30 | +<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/2900-2999/2973.Find%20Number%20of%20Coins%20to%20Place%20in%20Tree%20Nodes/images/screenshot-2023-11-10-012614.png" style="width: 800px; height: 374px;" /> |
31 | 31 | <pre>
|
32 | 32 | <strong>Input:</strong> edges = [[0,1],[0,2],[1,3],[1,4],[1,5],[2,6],[2,7],[2,8]], cost = [1,4,2,3,5,7,8,-4,2]
|
33 | 33 | <strong>Output:</strong> [280,140,32,1,1,1,1,1,1]
|
|
39 | 39 | </pre>
|
40 | 40 |
|
41 | 41 | <p><strong class="example">Example 3:</strong></p>
|
42 |
| -<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/10000-10099/10034.Find%20Number%20of%20Coins%20to%20Place%20in%20Tree%20Nodes/images/screenshot-2023-11-10-012513.png" style="width: 300px; height: 277px;" /> |
| 42 | +<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/2900-2999/2973.Find%20Number%20of%20Coins%20to%20Place%20in%20Tree%20Nodes/images/screenshot-2023-11-10-012513.png" style="width: 300px; height: 277px;" /> |
43 | 43 | <pre>
|
44 | 44 | <strong>Input:</strong> edges = [[0,1],[0,2]], cost = [1,2,-2]
|
45 | 45 | <strong>Output:</strong> [0,1,1]
|
|
0 commit comments