My solution is O(N*logN), that it works 0.062 sec!!!
My solution is O(N*logN), that it works 0.062 sec!!!
But use 680 Kb.
I used data structure with the title "Tree in massive".
what is "Tree in massive"
Posted by
Dilyan 10 May 2005 02:11
My algo is also O(N*logN)0.062 but I used a structre calles
Dinamic Ordered Statistics(Index tree). can you tell me what kind of data structure is "Tree in massive" and from where I can learn more ?
Re: what is "Tree in massive"
This structure is like Index tree.
Re: what is "Tree in massive"
Posted by
BFL 22 May 2005 22:27
and what is index tree.
where can I find about it?
Re: what is "Tree in massive"
I got ac in 0.062 sec,too.
I use treap.
Re: My solution is O(N*logN), that it works 0.062 sec!!!
Posted by
SPIRiT 17 Apr 2006 16:00
Is tree in massiv the same thing as Red-Black trees?
I think it's also possible to use RB-trees, becaues it's also O(N*logN).
Re: My solution is O(N*logN), that it works 0.062 sec!!!
Tree in massiv is much easier than RB-trees.
In two words tree in massiv is following structure:
Node T contains F([a,b]) and if b-a > 0 its children
contain F([a,(a+b)/2]) first and F([(a+b)/2,b]) second
(else T is a leave).
Using this structure we can update F[x] in O(logN) and
get F[l,r] also in O(logN) where N is length of the
interval in the root.
In this problem F = number of stars on the inrterval.
Re: My solution is O(N*logN), that it works 0.062 sec!!!
Posted by
KIRILL 28 Sep 2006 18:51
My 450 byte O(N*sqrt(N)) Pascal solution
works 0.031 sec and uses 240Kb
Re: My solution is O(N*logN), that it works 0.062 sec!!!
Posted by
Yermak 27 Feb 2007 22:01
Hurrra! My solution worked 0.015 seconds!
Re: My solution is O(N*logN), that it works 0.062 sec!!!
"tree in massive", "tree in massiv"
"massiv" is russian word and it mean array.
"tree in array"