2012年9月17日

SPOJ 1043 Can you answer these queries I(GSS1 线段树)

摘要: http://www.spoj.pl/problems/GSS1/题意:给一个序列,求区间的最大连续子序列和。思路:维护三个值区间的最大连续和,左端连续的最大和。右端连续的最大连续和。查询的时候先看左右两个区间的最大连续和,再看两区间交界处的最大连续和。(参考:http://blog.csdn.net/acm_cxlove/article/details/7982444)View Code #include<stdio.h>#include<string.h>#include<iostream>using namespace std;const int ma 阅读全文

posted @ 2012-09-17 14:04 aigoruan 阅读(160) 评论(0) 推荐(0)

uva Array Transformer

摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3154题意:给一个序列,然后是操作:L,R,V,P:求区间[L,R]中小于V的个数k,然后更新 P位置的值为k*u/(R-L+1)。输出最后的序列。思路:线段树 套 sbt.View Code #include<stdio.h>#include<string.h>#include<iostream>#include<stdlib.h> 阅读全文

posted @ 2012-09-17 13:06 aigoruan 阅读(175) 评论(0) 推荐(0)

导航