摘要: 直接线性扫描就好 c++ class Solution { public: int countTriplets(vector& a){ int presum[301]; int ans=0; for(int i=0; i仔细观察,会发现要走过的点刚好是一棵树 直接一遍dfs将所有子节点有苹果的点标记 阅读全文
posted @ 2020-05-10 14:58 CrosseaLL 阅读(126) 评论(0) 推荐(0) 编辑