解题报告题意:原本区间1到n都是1,区间成段改变成一个值,求最后区间1到n的和。思路:线段树成段更新,区间去和。#include #include #include using namespace std;int sum[500000],lz[500000];void push_up(int roo...
分类:
其他好文 时间:
2014-10-20 20:46:57
阅读次数:
217
[Description] There is a number in each stages that indicates the most stages you can leap up. Now, giving an array which represents one kind of stair...
分类:
其他好文 时间:
2014-10-20 18:47:25
阅读次数:
164
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:
其他好文 时间:
2014-10-20 14:47:59
阅读次数:
168
ctrl+/ 单行注释ctrl+shift+/ 块注释ctrl+shift+ +/- 展开/折叠ctrl+alt+L 格式化代码ctrl+shift+ up/down 上下移动句子Alt+回车 导入包,自动修正Ctrl+N 查找类Ctrl+Shift+N 查找文件Ctrl+Alt+L 格式化代码Ct...
分类:
Web程序 时间:
2014-10-20 13:18:25
阅读次数:
293
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:
其他好文 时间:
2014-10-20 11:21:40
阅读次数:
184
http://forum.codecall.net/topic/75946-autocomplete-tedit/OverviewAutocompletefeature really helpful for us speeding up our typing job.For you who is n...
分类:
其他好文 时间:
2014-10-20 00:42:44
阅读次数:
385
CF memsql Start[c]UP 2.0 AA. Golden Systemtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPiegirl...
分类:
数据库 时间:
2014-10-19 21:09:30
阅读次数:
349
这里有一个思想:我们在更新的时候不必要更新到叶子节点,只要更新到当前区间包含线段树区间即可。
设计一个标志位,更新到此。
A Simple Problem with Integers 也是一个类似的题目
设计两个函数
push_down 将结点信息传递到下层节点(inc, sub,)
push_up 将下层节点信息反馈到上层(max,min,count)
#i...
分类:
其他好文 时间:
2014-10-19 11:37:23
阅读次数:
154
# This python file uses the following encoding: utf-8# In England the currency is made up of pound, £, and pence, p, and there are eight coins in gene...
分类:
编程语言 时间:
2014-10-19 11:29:47
阅读次数:
207
A Plug for UNIX
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 13855
Accepted: 4635
Description
You are in charge of setting up the press room for the i...
分类:
其他好文 时间:
2014-10-19 10:14:49
阅读次数:
202