A+B for Input-Output Practice (IV) Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 108338 Accepte ...
分类:
其他好文 时间:
2017-09-20 23:16:38
阅读次数:
127
这个题我在考试的时候把所有的转移都想全了就是新加一个点时有I.不作为II.自己呆着III.连一个IV.连接两个子树中的两个V连接一个子树中的两个,然而V我并不会转移........ 这个题的正解体现了一种神奇的思想,对于好合并但是不好转移的dp我们可以先打散然后合并到最后,所以我们从一开始维护f[i ...
分类:
其他好文 时间:
2017-09-15 22:37:25
阅读次数:
196
题目链接:http://acm.zzu.edu.cn:8000/problem.php?id=10508 题目大意:给定一个序列,长度为N,每次询问为一组区间[Li,Ri],输出Li到Ri中出现恰好两次的不同数的个数. N,M<=2*10^5,序列中元素<=10^9 解题思路:考虑用树状数组解决(大 ...
分类:
其他好文 时间:
2017-09-15 18:47:16
阅读次数:
192
Ikki's Story IV - Panda's Trick Time Limit: 1000MS Memory Limit: 131072K Total Submissions: 10448 Accepted: 3829 Description liympanda, one of Ikki’s ...
分类:
其他好文 时间:
2017-09-15 16:42:04
阅读次数:
228
Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target. E ...
分类:
其他好文 时间:
2017-09-12 09:51:05
阅读次数:
345
Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target. E ...
分类:
其他好文 时间:
2017-09-10 12:24:54
阅读次数:
134
Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target. E ...
分类:
其他好文 时间:
2017-09-07 10:09:22
阅读次数:
192
这道题属于容易,还是挺简单的,但是我用的方法比较复杂。 题目: 思路: 1、我的想法是把树转换成列表,然后再遍历这个列表,判断是否两个元素相加为0,这种方法时间复杂度较高 2、大神也是将树节点存在列表中,建立一个空集合set,遍历列表,如果该(k - 该节点值)在集合中则返回True,否则将该节点值 ...
分类:
其他好文 时间:
2017-09-06 13:01:43
阅读次数:
194
#1566 : 皇室成员的名字 #1566 : 皇室成员的名字 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Ho正在学习世界历史。他发现历史上很多西方国家的皇室成员的名字都是由英文名字加罗马数字组成的,例如George IV(乔治四世)、William IV(威廉 ...
分类:
其他好文 时间:
2017-09-04 22:36:53
阅读次数:
280