Oh, awesome! :D
On Sat, Apr 27, 2013 at 4:51 PM, Malay Keshav malay.kes...@gmail.comwrote:
They have used a binary search , since the function relating radius ,
number of circles and the amount of paint was strictly non decreasing.
On Sat, Apr 27, 2013 at 2:12 PM, Vaibhav Tulsyan
I dont understad it either.
--
You received this message because you are subscribed to the Google Groups
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to
On Saturday, April 27, 2013 7:11:19 AM UTC-3, SONI wrote:
My code for Small input was right but for large input cases,it stops
working.Coding Language is java.
Another Problem is,for first 2000 inputs of a large input file (in separate
file),it works fine but if all 6000 inputs are given in
Don't use pow. Use integers only to avoid overflows
#pow((2*r - 1), 2)
(2*r-1)*(2*r-1)
#pow(d, 0.5)
isqrt(d)
where isqrt is integer square root as described here:
http://code.activestate.com/recipes/577821-integer-square-root-function/
--
You received this message because you are subscribed
The result of that formula is very large, so there is a possibility
that it will not fit into a 64-bit integer.
The first comparison uses 'double' type to check if this number is too
large. If it is, it is certainly bigger than t. If it is not, more
precise integer computations can be used (second
Can anybody please just mention the algorithms that the top contestants
used for this Round 1A?
I'm new in this kind of Rounds so I would like to know more about those
algorithms, they seem to be interesting, but I can't recognize them easily.
--
You received this message because you are
So, this could be the same problem with sqrt() on C++?
I took the same approach, found a formula to get the answer directly for the
large input and was too stuck on omg, but my formula is right, revising it
over and over to try to see the error... took me almost the entire round :(
Em sábado,
On Sunday, 14 April 2013 05:44:15 UTC+3, sk wrote:
I do use java, and even though one can compete in codejam, do you agree that
C++ is a better languague to compete in code jam. I see the top 5 are using
C++.
The runtime of your solution should usually pale in comparison with the time it
For the first circle, you need pi*(r+1)²-pi*r², which is pi*((r+1)² - r²) cm²,
since 1 mililiter covers pi cm², you need (r+1)²-r² paint.
following this logic, for each circle you need:
1st: (r+1)² - (r-0)²
2nd: (r+3)² - (r-2)²
3rd: (r+5)² - (r-4)²
4th: (r+7)² - (r-6)²
and so on...
note the
Area of the first white circle is pi* r*r
Area of first black circle that includes first white circle is pi * (r+1) *
(r+1)
So area of first black strip is pi * (r+1) * (r+1) - pi *r *r
If you continue doing this then area of second black strip is pi * (r+3) *
(r+3) - pi * (r+2) * (r+2)
So
i tried with both long and double but no change.
On Sat, Apr 27, 2013 at 4:27 PM, champ cham3...@gmail.com wrote:
you have to choode data types which have greater range
On Sat, Apr 27, 2013 at 3:41 PM, SONI parveensoni14...@gmail.com wrote:
My code for Small input was right but for large
I was expecting a contest analysis by now but didn't see one
so I'll try this way.
Though I didn't participate in round 1A I tried to solve the Good Luck problem
but only get ~10% correct with the parameters of the second input
and wanted to share my approach and ask for comments.
First I find
Is it possible to in different timt zone
On Sat, Apr 27, 2013 at 4:52 PM, Joseph DeVincentis dev...@gmail.comwrote:
The problem with this is that pow(foo, 0.5) performs a floating point
calculation which is not accurate to the 18 significant figures required
for this result.
On Sat, Apr
Is it possible to in different time zone
On Sun, Apr 28, 2013 at 5:23 PM, Samuel Jawahar insidej...@gmail.comwrote:
Is it possible to in different timt zone
On Sat, Apr 27, 2013 at 4:52 PM, Joseph DeVincentis dev...@gmail.comwrote:
The problem with this is that pow(foo, 0.5) performs a
int a=2*r+1;
int d=4;
double d=-(2*a-d)+Math.sqrt((2*a-d)*(2*a-d)+8*d*k);
int dinominator=2*d;
int result=d/dinominator;
answer is result
On Sun, Apr 28, 2013 at 7:35 AM, bas 366a...@gmail.com wrote:
The result of that formula is very large, so there is a possibility
that it will not fit into
which is the best c++ IDE for windows? And also the link to download that IDE?
--
You received this message because you are subscribed to the Google Groups
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
I tried to compute all possible gains, summed them, found the max. Worked
too slow. Can you guys explain your methods?
--
You received this message because you are subscribed to the Google Groups
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an
It is not about the logic i following but problem occurs when i try to work
with 6000 input.
It work fine with 2000 input and even,it does not stop at 1695th input but
stops at 1695th input when run with 6000 input
On Sat, Apr 27, 2013 at 5:53 PM, Meili leandro.me...@gmail.com wrote:
On
Or is it? My C-small-2 solution has worse complexity than most others, I only
passed because of my i5 processor, using 4 threads and sticking to C++ instead
of another language. I think that if I used python, same solution with same
complexity would need more than 4 minutes even with threads.
Isn't that a case that your algorithm performs, say, k iterations where k
is the result that you are going to output? If it is, isn't that a case
that all numbers that your program outputs before it hangs are relatively
small ( 100)? My large output for this problem has about 2000 small values
in
Thank you Kannapan. I tested with 1.4 and 1.6 and both worked. 1.0 does't
work.
I also tested the code without the first condition, but it's necessary to
make it work.
On Sat, Apr 27, 2013 at 4:42 PM, Kannappan deshka...@gmail.com wrote:
the 1.5 might just be to speed up the process to get the
Thank you Bas and Samuel.
Thanks a lot Raj and Álvaro. Now I understand the formula. =)
On Sun, Apr 28, 2013 at 7:08 PM, Leandro Coutinho
lescoutinh...@gmail.comwrote:
Thank you Kannapan. I tested with 1.4 and 1.6 and both worked. 1.0 does't
work.
I also tested the code without the first
No, I don't. 2012 champion used Java. xD
--
You received this message because you are subscribed to the Google Groups
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email
to google-code+unsubscr...@googlegroups.com.
To post to this group, send
Parveen, take that specific line and place it on top of the input file
so that you get convinced :)
On Sun, Apr 28, 2013 at 1:40 PM, Andrey Ponomarev
ponomarev@gmail.com wrote:
Isn't that a case that your algorithm performs, say, k iterations where k is
the result that you are going to
I haven't had time to read the problems.
But if you go to the contest dashboard now there's probably a link called
contest analysis where all problems are explained. I'm not sure if it's
already up because I haven't checked, but I think it should be up by now or
it will be soon anyway.
Also,
A correct answer I read through was very similar and I tried rewriting it in a
way that was more intuitive to me.
I tried to build a probability of the choices by multiplying the probability of
the chance you saw k for each k and the probability it was that combination of
numbers (taking into
In the previous years, contests analyses could appear as fast as in 10
minutes after the contest, and definitely not later than 1 day in the
worst case.
This time, we had to wait 3-4 days for qualification analysis, and
Round 1A analysis is still on its way.
Why did the preparation times increase
@Praveen, does your code produce correct output if you remove the first
1694 inputs and try to run it only on the remaining?
As far as I see the only thing that would change from small input to large
in this problem is that
1) if you are using only integer arithmetic then it may produce huge
On Sunday, April 28, 2013 8:40:11 PM UTC+3, M.H. wrote:
Isn't that a case that your algorithm performs, say, k iterations where k is
the result that you are going to output? If it is, isn't that a case that all
numbers that your program outputs before it hangs are relatively small (
100)?
Em sábado, 27 de abril de 2013 21h53min06s UTC-3, alv-r- escreveu:
For the first circle, you need pi*(r+1)²-pi*r², which is pi*((r+1)² - r²)
cm², since 1 mililiter covers pi cm², you need (r+1)²-r² paint.
following this logic, for each circle you need:
1st: (r+1)² - (r-0)²
2nd:
Others have reported no analysis yet, sorry for leading you there without
checking but have been busier than usual and took a wills guess at it. The
analysis will come, check TopCoder in the meantime.
Carlos Guia
On Apr 28, 2013 9:33 PM, Carlos Guia carlos.guia.v...@gmail.com wrote:
I haven't
Summing the log of the count is equivalent to multiplying them, I was using
Long and not BigInt, It is conceivable there was a simple numeric overflow.
On Monday, April 29, 2013 4:37:09 AM UTC+3, Nate Bauernfeind wrote:
A correct answer I read through was very similar and I tried rewriting it
32 matches
Mail list logo