GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing leetcode.cn — LCP 05. 发 LeetCoin - 力扣(LeetCode) 题目描述 题目描述 题解 题解 提交记录 提交记录 困难 力扣决定给一个刷题团队发
该刷题团队的管理模式可以用一棵树表示:
力扣想进行的操作有以下三种:
输入:
输出: 返回一个数组,数组里是每次查询的返回值(发
示例 1: 输入:N = 6, leadership = [[1, 2], [1, 6], [2, 3], [2, 5], [1, 4]], operations = [[1, 1, 500], [2, 2, 50], [3, 1], [2, 6, 15], [3, 1]] 输出:[650, 665] 解释:团队的管理关系见下图。 第一次查询时,每个成员得到的LeetCoin的数量分别为(按编号顺序):500, 50, 50, 0, 50, 0; 第二次查询时,每个成员得到的LeetCoin的数量分别为(按编号顺序):500, 50, 50, 0, 50, 15.
限制:
代码 代码 测试用例 测试用例 测试结果 测试结果 |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |