@Dumanshu: Your idea is definitely a good improvement, however the
SPOJ Runtimes are not reliable..
The code which was getting 0.00 AC with 512 KB Buffer now runs in 0.02 Seconds..
And I tried submitting the code with enhancement u suggested it runs
in 0.01 even with 8KB Buffer.
http://ideone.com/
@Rizwan:
don't u think for the counting sort part, if u use 11 int array as it
is without copying values in the main array, it would run faster? And
later on, get the sum from the two 11 int arrays like I did. Although
m using a single buffer so m getting 0.01. ->http://ideone.com/lsK8n
So, by usin
I am able to get this accepted with 0.00 Seconds http://ideone.com/Eg2wZ
But, I am using 512 KB Buffer. Not sure how I do get 0.00 with a
smaller buffer size say 8KB
On Sun, Jun 26, 2011 at 7:54 AM, Wladimir Tavares wrote:
> sometimes using global static variables may be better to use dynamic
>
You are correct, this question is by no means testing anything non trivial/hard.
It is one of the problems that the beginners in competitive programming solve.
As for the discussion regarding this problem in current thread, some
enthusiastic
guy had got this AC in 0.08 at SPOJ, and everyone was try
@Dan: see, that is not the point. We are just looking for a better
solution not just an algorithm which fetches us 0.00 time given the
SPOJ conditions. Actually we are not worried about the compiler stuff
because its all relative. Some other person on this SPOJ platform has
submitted the code which
I found the problem statement on the web page link to be a bit
"weak". Nothing in the problem statement says that you must do
anything other than read in two lines of integers and multiply them in
pairs and sum the results ( ie. Dot Product ).
People seem to think that you should sort the data
sometimes using global static variables may be better to use dynamic
variables on the stack!
Sometimes!
Wladimir Araujo Tavares
*Federal University of Ceará
*
On Sat, Jun 25, 2011 at 7:32 PM, Dumanshu wrote:
> finally got it in 0.01 sec using all the optimizations i am aware of
> including
finally got it in 0.01 sec using all the optimizations i am aware of
including what Wladimir had suggested.
Now wat to do for 0.00???
heres my code-
http://ideone.com/lsK8n
please suggest if any further optimizations possible.
On Jun 26, 2:21 am, Dumanshu wrote:
> Ok, it seems like bucket sort i
Ok, it seems like bucket sort is the best way to do it. I got 0.06
and to go further we need to use char buffer like the one Wladimir
suggested.
But still i have a doubt that would it be possible to reduce 0.06 to
0.00 using that buffer?
I don't think there can be any possible improvement in logi
see i got 0.07 sec as the time after using counting sort.. because the
hotness scale is 0-10 so i used an array of 11 ints to count the no.
of occurrences. But i m nt able to further reduce this.
ny suggestions?
theres a comment on the problem:
On an interesting side note: the maximising principle
10 matches
Mail list logo