ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1028. Stars

My solution is O(N*logN), that it works 0.062 sec!!!
Posted by Urban Alexandr(PetrSU) 23 Mar 2005 23:27
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"
Posted by Burunduk1 10 May 2005 04:17
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"
Posted by wang yin 18 Mar 2006 19:17
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!!!
Posted by Burunduk1 18 Apr 2006 01:17
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!!!
Posted by Alias (Alexander Prudaev) 11 Dec 2007 09:13
"tree in massive", "tree in massiv"
"massiv" is russian word and it mean array.
"tree in array"