HDU4893:Wow! Such Sequence!(段树lazy)】的更多相关文章

Problem Description Recently, Doge got a funny birthday present from his new friend, Protein Tiger from St. Beeze College. No, not cactuses. It's a mysterious blackbox. After some research, Doge found that the box is maintaining a sequence an of n nu…
主题链接:http://acm.hdu.edu.cn/showproblem.php? pid=4893 这个问题还真是纠结啊--好久不写线段树的题了.由于这几天学伸展树.然后认为线段树小case了.没想到栽在这题上了.尼玛-- 自己把自己给搞晕了--想复杂了.都不懂得预处理一下,唉--还得怒刷几十道啊! ! #include <iostream> #include <cstdio> #include <cstring> #include <cmath> #…
Wow! Such Sequence! Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 3808 Accepted Submission(s): 1079 Problem Description Recently, Doge got a funny birthday present from his new friend, Protein…
题目链接:hdu 4983 Wow! Such Sequence! 题目大意:就是三种操作 1 k d, 改动k的为值添加d 2 l r, 查询l到r的区间和 3 l r. 间l到r区间上的所以数变成近期的斐波那契数,相等的话取向下取. 解题思路:线段树.对于每一个节点新增一个bool表示该节点下面的位置是否都是斐波那契数. #include <cstdio> #include <cstring> #include <cstdlib> #include <algo…
线段树结点上保存一个一般的sum值,再同一时候保存一个fbsum,表示这个结点表示的一段数字若为斐波那契数时的和 当进行3操作时,仅仅用将sum = fbsum就可以 其它操作照常进行,仅仅是单点更新的时候也要先向下更新 #include <cstdio> #include <ctime> #include <cstdlib> #include <cstring> #include <queue> #include <string>…
Wow! Such Sequence! Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2234    Accepted Submission(s): 657 Problem Description Recently, Doge got a funny birthday present from his new friend, Prot…
Wow! Such Sequence! 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4893 Description Recently, Doge got a funny birthday present from his new friend, Protein Tiger from St. Beeze College. No, not cactuses. It's a mysterious blackbox. After some resea…
Minimum Inversion Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 9514    Accepted Submission(s): 5860 Problem Description The inversion number of a given number sequence a1, a2, ..., an…
意甲冠军:一个典型的段树C,Q问题,有n的数量a[i] (1~n),C, a, b,c在[a,b]加c Q a b 求[a,b]的和. #include<cstdio> #include<stdlib.h> #include<string.h> #include<string> #include<map> #include<cmath> #include<iostream> #include <queue> #…
6356.Glad You Came 题意就是给你一个随机生成函数,然后从随机函数里确定查询的左右区间以及要更新的val值.然后最后求一下异或和就可以了. 线段树,区间最大值和最小值维护一下,因为数据有点大,不剪枝就会超时.(默默吐槽,剪了枝照样超时) 因为太菜,交了24遍也是没过,TLE,WA,RE轮流来,而且感觉这题有毒,删一个没用的变量就会WA... 百度了一下题解,发现有人和我写的几乎一模一样,但是人家的就可以过,我的死也过不去. 人家的博客:HDU6356 Glad You Came(…