Nu aveti permisiuni pentru a descarca fisierul grader_test5.in
Diferente pentru probleme-cu-secvente intre reviziile #31 si #32
Nu exista diferente intre titluri.
Diferente intre continut:
int mid = (low + high) / 2; build_tree(2 * index, low, mid); build_tree(2 * index + 1, mid + 1, high);
aint[index].maxS = Math.max(aint[2 * index].maxS,Math.max(aint[2 * index + 1].maxS,aint[2 * index + 1].max - aint[2 * index].min));
aint[index].maxS = Math.max(aint[2 * index].maxS, Math.max(aint[2 * index + 1].maxS, aint[2 * index + 1].max - aint[2 * index].min));
aint[index].max = Math.max(aint[2 * index].max,aint[2 * index + 1].max); aint[index].min = Math.min(aint[2 * index].min,aint[2 * index + 1].min); }
long minPrefix; int x, y; public long queryTree(int index, int low, int high) {
if (x≤low && high≤y) {
if (x <= low && high <= y) {
long maxRet = aint[index].maxS; if (minPrefix != infinity) { maxRet = Math.max(maxRet, aint[index].max - minPrefix);
} else { int mid = (low + high) / 2;
if (x ≤ mid && mid < y) return Math.max(queryTree(2 * index, low, mid), queryTree(2 * index + 1, mid + 1, high)); else if (x > mid) return queryTree(2 * index + 1, mid + 1, high); else return queryTree(2 * index, low, mid);
if (x <= mid && mid < y) return Math.max(queryTree(2 * index, low, mid), queryTree(2 * index + 1, mid + 1, high)); else if (x > mid) return queryTree(2 * index + 1, mid + 1, high); else return queryTree(2 * index, low, mid);
} } ==
h2(#bibliografie). Bibliografie
1.Lica Dana, _Arbori de intervale (Segment Trees)_, GInfo 15/42.Negruşeri Cosmin, _Căutări Ortogonale, Structuri de date şi aplicaţii_, GInfo 15/53.Takaoka T., _Efficient Algorithms for the Maximum Subarray Problem by Distance Matrix Multiplication_4.Kuan Yu Chen, Kun Mao Chao, _On the Range Maximum-Sum Segment Query_5.Yaw Ling Liu, Tao Jiang, Kun Mao Chao, _Efficient Algorithms for Locating the Length-Constrained Heaviest Segments, with Applications to Biomolecolar Sequence Analysis_6.Vladu Adrian, Negruşeri Cosmin, Ginfo Noiembrie 20057.T. H. Cormen, C. E. Leiserson, R. R. Rivest - '_Introducere in Algoritmi_':http://zhuzeyuan.hp.infoseek.co.jp/ita/toc.htm
# Lica Dana, _Arbori de intervale (Segment Trees)_, GInfo 15/4 # Negruşeri Cosmin, _Căutări Ortogonale, Structuri de date şi aplicaţii_, GInfo 15/5 # Takaoka T., _Efficient Algorithms for the Maximum Subarray Problem by Distance Matrix Multiplication_ # Kuan Yu Chen, Kun Mao Chao, _On the Range Maximum-Sum Segment Query_ # Yaw Ling Liu, Tao Jiang, Kun Mao Chao, _Efficient Algorithms for Locating the Length-Constrained Heaviest Segments, with Applications to Biomolecolar Sequence Analysis_ # Vladu Adrian, Negruşeri Cosmin, Ginfo Noiembrie 2005 # T. H. Cormen, C. E. Leiserson, R. R. Rivest - '_Introducere in Algoritmi_':http://zhuzeyuan.hp.infoseek.co.jp/ita/toc.htm