思路:本题因为是点修改,所以我们可以用线段树或者是树状数组了。线段树的基本操作我在我的代码中会具体体现,关键是要理解下面这幅图,具体的思想大家可以去看看其他的资料
线段树AC代码:
#include
#include
#include
#include
#include
using namespace std;
#define N 50005
int num[N];
struct p
{
...
分类:
其他好文 时间:
2014-08-08 12:47:16
阅读次数:
296
Atlantis
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 6899 Accepted Submission(s): 3022
Problem Description
There are sever...
分类:
其他好文 时间:
2014-08-08 12:44:06
阅读次数:
244
Buy TicketsTime Limit: 4000 MS Memory Limit: 65536 KB64-bit integer IO format: %I64d , %I64u Java class name: Main[Submit] [Status] [Discuss]Descripti...
分类:
其他好文 时间:
2014-08-08 12:13:15
阅读次数:
227
HDU 1754 I Hate It (线段树)
模板啊,还是模板,什么时候能够脱离啊,改一点就错,还是没理解。...
分类:
其他好文 时间:
2014-08-08 09:39:55
阅读次数:
290
http://acm.neu.edu.cn/hustoj/problem.php?id=1444
OJ问题论坛发帖http://t.cn/zjBp4jd FAQ http://t.cn/zjHKbmN Linux问题看http://t.cn/aWnP1n
1444: Devour Magic
时间限制: 1 Sec 内存限制: 256 MB
提交: 129...
分类:
其他好文 时间:
2014-08-08 09:39:15
阅读次数:
251
解题报告
题意:
略
思路:
单点更新,区间乘积。
#include
#include
#include
#define LL long long
using namespace std;
LL mul[501000];
void update(int root,int l,int r,int p,int v)
{
int mid=(l+r)/2;
if(l==r)...
分类:
其他好文 时间:
2014-08-08 08:29:05
阅读次数:
239
Just a HookTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 17124Accepted Submission(s): 8547Proble...
分类:
其他好文 时间:
2014-08-08 08:27:55
阅读次数:
261
Description
FJ's N (1 ≤ N ≤ 10,000) cows conveniently indexed 1..N are standing in a line. Each cow has a positive integer height (which is a bit of secret). You are told only the height H (1 ≤ H ≤...
分类:
其他好文 时间:
2014-08-07 23:19:25
阅读次数:
346
解题报告
题意:
求区间内最大值和最小值的差值。
思路:
裸线段树,我的线段树第一发。
#include
#include
#include
#define inf 99999999
#define LL long long
using namespace std;
LL minn[201000],maxx[201000];
void update(LL root,LL l,LL...
分类:
其他好文 时间:
2014-08-07 23:16:35
阅读次数:
282
~~~~
第一次遇到线段树合并的题,又被律爷教做人。TAT.
~~~~
线段树的题意都很好理解吧。。
题目链接:
http://acm.hdu.edu.cn/showproblem.php?pid=1540
http://poj.org/problem?id=2892
~~~~
我的代码:200ms
#include
#include
#include
#include
...
分类:
其他好文 时间:
2014-08-07 23:12:05
阅读次数:
356