摘要:
(中文题意)第二道线段树。同样是水题。但是一开始我把线段树区间段代表的数字简单理解成各个区间的数字的和。但是这道题让我知道这个数组记录的数字是根据需要定义的。本题区间段记录的是该区间段的最大值。#include#includeusing namespace std;int newcha,subb,m... 阅读全文
posted @ 2015-05-23 12:51 tun~ 阅读(112) 评论(0) 推荐(0)
|
|
|
|
摘要:
(中文题意)第二道线段树。同样是水题。但是一开始我把线段树区间段代表的数字简单理解成各个区间的数字的和。但是这道题让我知道这个数组记录的数字是根据需要定义的。本题区间段记录的是该区间段的最大值。#include#includeusing namespace std;int newcha,subb,m... 阅读全文
posted @ 2015-05-23 12:51 tun~ 阅读(112) 评论(0) 推荐(0)
摘要:
(中文题意)线段树水题。我写的第一个线段树。re是因为数组开小了。线段树的数组下次开3*n,而不是2*n。#include#includeusing namespace std;int n,tar,val,ans;bool ok;struct tr{ int l,r,num;};int tmp... 阅读全文
posted @ 2015-05-23 12:48 tun~ 阅读(204) 评论(0) 推荐(0) |
|