Why Segment Tree here is fast?

Правка en2, от Ehsan_sShuvo, 2017-09-26 19:09:25

Here is two implementation of this problem

Using Sparse Table: Submission Using Segment Tree: Submission

Time took by Sparse Table is 0.336 s ,where Segment Tree took 0.324 s. Memory took by Sparse Table is 8732 KB ,where Segment Tree took 3640 KB.

Problem is static,thats why Sparse Table should be fast!But here i couldn't see this..Where is the problem?Could anyone please find that out ?

Thanks in advance :)

Теги sparse table, segment tree, light oj

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Ehsan_sShuvo 2017-09-26 19:09:25 8
en1 Английский Ehsan_sShuvo 2017-09-26 19:08:29 592 Initial revision (published)