随笔分类 -  大小脑洞

hdu6058 Kanade's sum 区间第k大
摘要:/** 题目:Kanade's sum 链接:http://acm.hdu.edu.cn/showproblem.php?pid=6058 题意:给定[1,n]的排列,定义f(l,r,k)表示区间[l,r]内的第k(k =x的链表,跳k个查询左边>x的k个,右边>x的k个。计算之后,O(1)删除x。 比赛的时候,,刚好反过来了,用的是从大到小用set,二分位置,再迭代器枚举,然后超时了。 eg:... 阅读全文

posted @ 2017-08-02 08:59 hnust_accqx 阅读(158) 评论(0) 推荐(0)

UVA 679 Dropping Balls 由小见大,分析思考 二叉树放小球,开关翻转,小球最终落下叶子编号。
摘要:A number of K balls are dropped one by one from the root of a fully binary tree structure FBT. Each time the ball being dropped first visits a non-terminal node. It then keeps moving down, either fol... 阅读全文

posted @ 2017-05-17 13:01 hnust_accqx 阅读(414) 评论(0) 推荐(0)

2017-5-14 湘潭市赛 Longest Common Subsequence 想法题
摘要:Longest Common Subsequence Accepted : 7 Submit : 66 Time Limit : 3000 MS Memory Limit : 65536 KB Longest Common Subsequence Bobo has a sequence A=(a1,a2,…,an) of length n. He wo... 阅读全文

posted @ 2017-05-16 20:01 hnust_accqx 阅读(281) 评论(0) 推荐(0)

2017-5-14 湘潭市赛 Partial Sum 给n个数,每次操作选择一个L,一个R,表示区间左右端点,该操作产生的贡献为[L+1,R]的和的绝对值-C。 0<=L<R<=n; 如果选过L,R这两个位置,那么以后选择的L,R都不可以再选择这两个位置。最多操作m次,求可以获得的 最大贡献和。
摘要:Partial Sum Accepted : 30 Submit : 119 Time Limit : 3000 MS Memory Limit : 65536 KB Partial Sum Bobo has a integer sequence a1,a2,…,an of length n. Each time, he selects two end... 阅读全文

posted @ 2017-05-15 13:38 hnust_accqx 阅读(3196) 评论(0) 推荐(0)

导航