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

1028 Stars
Posted by ManWithoutFace (USU) 26 Mar 2001 13:45

My solution is 462 bytes long and works 0.12 sec!
Who smaller? :-)
Re: 1028 Stars
Posted by Roman V. Alekseenkov 26 Mar 2001 17:28
>
> My solution is 462 bytes long and works 0.12 sec!
> Who smaller? :-)
>
>
xe...xe... ;-)
O( N * sqrt(N) ) ? ;))
Re: 1028 Stars
Posted by Petko Minkov 26 Mar 2001 19:29
>
> My solution is 462 bytes long and works 0.12 sec!
> Who smaller? :-)
>

My smaller! My program is 197 bytes, runs in O(N*N)
time and is the obvious thing everybody writes. It can
become even smaller if i delete the spaces but that won;t
be fair :) and even now the code is quite unpretty.

BTW i think the judge here can report different execution
times for different submissions so 0.12 may become 0.10
or 0.15 if you submit it now.
Re: 1028 Stars
Posted by ManWithoutFace (USU) 27 Mar 2001 09:57
> xe...xe... ;-)
> O( N * sqrt(N) ) ? ;))

No. O(15*N)
Re: 1028 Stars
Posted by ManWithoutFace (USU) 27 Mar 2001 09:58
> My smaller! My program is 197 bytes, runs in O(N*N)
> time and is the obvious thing everybody writes. It can
> become even smaller if i delete the spaces but that won;t
> be fair :) and even now the code is quite unpretty.
>
> BTW i think the judge here can report different execution
> times for different submissions so 0.12 may become 0.10
> or 0.15 if you submit it now.

And does it pass new timelimit?
Timelimit for this problem is 1 second now.
O(15*N)==O(N), that's the basics of the mathematic analysis. did you mean O(N*lnN) ?
Posted by Ilya Semenov (NSU) 28 Mar 2001 22:26
> > xe...xe... ;-)
> > O( N * sqrt(N) ) ? ;))
>
> No. O(15*N)
>
Re: 1028 Stars
Posted by Petko Minkov 29 Mar 2001 03:09
> And does it pass new timelimit?
> Timelimit for this problem is 1 second now.

my new solution works in 0.22 and is 351 bytes.

Well its complexity is not O(NlogN) but it's obviously
fast enough
Re: O(15*N)==O(N), that's the basics of the mathematic analysis. did you mean O(N*lnN) ?
Posted by ManWithoutFace (USU) 29 Mar 2001 09:23
> O(15*N)==O(N), that's the basics of the mathematic
analysis.
> did you mean O(N*lnN) ?

I know it. But if I write O(N) nobody believe me.
And I didn't write O(N*lnN) because when N = 2, my solution
does 30 iterations.
My program is the fastest
Posted by Doctor Lamer 19 May 2001 13:14
My solution isn't very small but it's fast, written on
PASCAL (!!!), time=0.06s (see problem statistics)... Who
can write FASTER???
Re: 1028 Stars
Posted by shitty.Mishka 15 Oct 2001 18:38
My runs in 0.08 seconds (but it's 753 bytes :)
Re: O(15*N)==O(N), that's the basics of the mathematic analysis. did you mean O(N*lnN) ?
Posted by Foo Chuan Sheng 5 Dec 2001 18:43
> > O(15*N)==O(N), that's the basics of the mathematic
> analysis.
> > did you mean O(N*lnN) ?
>
> I know it. But if I write O(N) nobody believe me.
> And I didn't write O(N*lnN) because when N = 2, my
solution
> does 30 iterations.
>
>
Do you understand O notation?
It says that for large enough N, the behavior of the
function that describes the running time of your program
tends to the function given. It does not assert that the
running time of your program is always equal to a constant
value of the function given.
Re: O(15*N)==O(N), that's the basics of the mathematic analysis. did you mean O(N*lnN) ?
Posted by ManWithoutFace (USU) 10 Dec 2001 15:07
> Do you understand O notation?
> It says that for large enough N, the behavior of the
> function that describes the running time of your program
> tends to the function given. It does not assert that the
> running time of your program is always equal to a constant
> value of the function given.

Yes, yes, yes.
It's O(N). But I gave some hint, when wrote O(15*N)
Re: O(15*N)==O(N), that's the basics of the mathematic analysis. did you mean O(N*lnN) ?
Posted by Mephistos 20 Dec 2001 01:18
> > Do you understand O notation?
> > It says that for large enough N, the behavior of the
> > function that describes the running time of your program
> > tends to the function given. It does not assert that the
> > running time of your program is always equal to a constant
> > value of the function given.
>
> Yes, yes, yes.
> It's O(N). But I gave some hint, when wrote O(15*N)
>
I think you're mistaken, 'cause if you can solve the problem with the
time O(n), then you can sort arbitrary array with the same time, wich
is impossible.
Re: 1028 Stars
Posted by Algorithmus_UA(algorithmus@univ.kiev.ua) 11 Mar 2002 18:17
> My runs in 0.08 seconds (but it's 753 bytes :)
My runs 0.06 & olny 635 bytes!
Re: O(15*N)==O(N), that's the basics of the mathematic analysis. did you mean O(N*lnN) ?
Posted by Alyosha Popovich 14 May 2002 14:58
This is not an arbitrary array. The positions are integers smaller
than 32000. Sorting this kind of arrays is linear with countsort.



> > > Do you understand O notation?
> > > It says that for large enough N, the behavior of the
> > > function that describes the running time of your program
> > > tends to the function given. It does not assert that the
> > > running time of your program is always equal to a constant
> > > value of the function given.
> >
> > Yes, yes, yes.
> > It's O(N). But I gave some hint, when wrote O(15*N)
> >
> I think you're mistaken, 'cause if you can solve the problem with
the
> time O(n), then you can sort arbitrary array with the same time,
wich
> is impossible.
Re: O(15*N)==O(N), that's the basics of the mathematic analysis. did you mean O(N*lnN) ?
Posted by Aarontony 30 Sep 2004 15:04
My code works on 0.015S