Re: [gcj] Re: Languages used

2010-05-09 Thread Carlos Guia
Now you are just trouble making, the rules not only use Visual Studio
express as an example of what is allowed, but they clearly say "compiler or
interpreter is freely available" it doesn't say complete set of tools or
nothing like that. Is very clear that only the compiler/interpreter has to
be freely available. If I had access to one, I would run my codes on a debug
enabled PS3 using gcc for ppc Cell-BE.


Carlos Guía


On Mon, May 10, 2010 at 1:56 AM, Pablo Ariel Heiber
wrote:

> So any compiler that runs over non-freely available operating system
> (ejem, windows) is not allowed? After all, the complete set of tools
> needed to test and run the programs is not available.
>
> On Mon, May 10, 2010 at 2:52 AM, Bartholomew Furrow 
> wrote:
> >> Then could I use MATLAB Code [Its equivalent octave is free and the code
> >> is the same]??!!
> >
> > If it works in Octave, sure! :-)   But then you're really using Octave,
> > which is what I'd recommend in the first place.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "google-codejam" group.
> > To post to this group, send email to google-c...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-code+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> > http://groups.google.com/group/google-code?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Languages used

2010-05-09 Thread Pablo Ariel Heiber
So any compiler that runs over non-freely available operating system
(ejem, windows) is not allowed? After all, the complete set of tools
needed to test and run the programs is not available.

On Mon, May 10, 2010 at 2:52 AM, Bartholomew Furrow  wrote:
>> Then could I use MATLAB Code [Its equivalent octave is free and the code
>> is the same]??!!
>
> If it works in Octave, sure! :-)   But then you're really using Octave,
> which is what I'd recommend in the first place.
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Languages used

2010-05-09 Thread Bartholomew Furrow
>
> Then could I use MATLAB Code [Its equivalent octave is free and the code is
> the same]??!!
>

If it works in Octave, sure! :-)   But then you're really using Octave,
which is what I'd recommend in the first place.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Languages used

2010-05-09 Thread Bartholomew Furrow
>
> But Already there are about Five participants submitted their solutions
> using mathmatica
>  Is it allowed only in the qualification round but not for the next rounds
> or what!?
>

It is not allowed in the qualification round.  Those users will not get
credit for their submissions.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Languages used

2010-05-09 Thread Abdelrhman Abotaleb
Then could I use MATLAB Code [Its equivalent octave is free and the code is
the same]??!!

On Mon, May 10, 2010 at 6:09 AM, Abdelrhman Abotaleb <
profvip.abota...@gmail.com> wrote:

> But Already there are about Five participants submitted their solutions
> using mathmatica
>  Is it allowed only in the qualification round but not for the next rounds
> or what!?
>
>
>
> On Mon, May 10, 2010 at 5:31 AM, Bartholomew Furrow wrote:
>
>> i have downloaded a 30-day trial version of mathematica 6.0 for gcj
>>> which is available freely over the internet. so can i use it to solve
>>> problems in gcj 2010?
>>>
>>
>> From the rules:
>>
>> Time-limited trials for compilers and interpreters are disallowed.
>>
>>
>> The reason for this is that if I've previously downloaded Mathematica's
>> trial, now I can't use it to compete or to test your programs.  It's
>> possible I could get around this somehow, but that would presumably be in
>> violation of the license agreement.
>>
>> With that said, we could consider changing the "free languages only" rule
>> for next year if lots of people wanted it changed.  I like it because it's
>> egalitarian, but it's a limitation and so not obviously the right thing to
>> do.  I'm curious as to what you fine people think.
>>
>> Cheers,
>> Bartholomew
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to google-c...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Languages used

2010-05-09 Thread Abdelrhman Abotaleb
But Already there are about Five participants submitted their solutions
using mathmatica
 Is it allowed only in the qualification round but not for the next rounds
or what!?


On Mon, May 10, 2010 at 5:31 AM, Bartholomew Furrow wrote:

> i have downloaded a 30-day trial version of mathematica 6.0 for gcj
>> which is available freely over the internet. so can i use it to solve
>> problems in gcj 2010?
>>
>
> From the rules:
>
> Time-limited trials for compilers and interpreters are disallowed.
>
>
> The reason for this is that if I've previously downloaded Mathematica's
> trial, now I can't use it to compete or to test your programs.  It's
> possible I could get around this somehow, but that would presumably be in
> violation of the license agreement.
>
> With that said, we could consider changing the "free languages only" rule
> for next year if lots of people wanted it changed.  I like it because it's
> egalitarian, but it's a limitation and so not obviously the right thing to
> do.  I'm curious as to what you fine people think.
>
> Cheers,
> Bartholomew
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Abdelrhman Abotaleb
or type cast your final result
(long)Double_Var


On Mon, May 10, 2010 at 5:33 AM, Bartholomew Furrow wrote:

> hi,
>> in C, normally we use printf("%0.0lf",n) to ignore the decimal part..
>> while printing..
>
>
> Though if you're doing a floating-point calculation for something with an
> exact integer answer, you're probably doing something wrong, and should
> consider using long long instead.
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: Theme Park - cycle position

2010-05-09 Thread Christopher Chen
The same thing happened with my program. It looks as if the official
data is only concerned with checking efficiency for large cases, not
smaller border cases.

On May 10, 8:13 am, Mikhail Dektyarev
 wrote:
> Hi.
> I think, my solution for Problem C will work not correctly, if R < (number
> of step when we enter to a cycle).
> But I couldn't find an example, when we enter to a cycle later then after
> the first running. In small and large inputs there is no such example, too.
> Can anybody find it, or it doesn't exist?
>
> --
> Best regards, Дектярев Михаил
>
> --
> You received this message because you are subscribed to the Google Groups 
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Davi Costa
printf("0.0lf",n) doesn't ignore decimal part, it rounds up to the nearest
integer value, to really discard (truncate) you should use
printf("%d",(int)n);

On Mon, May 10, 2010 at 12:33 AM, Bartholomew Furrow wrote:

> hi,
>> in C, normally we use printf("%0.0lf",n) to ignore the decimal part..
>> while printing..
>
>
> Though if you're doing a floating-point calculation for something with an
> exact integer answer, you're probably doing something wrong, and should
> consider using long long instead.
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: what kiond of computer?

2010-05-09 Thread tonka
thanks for all the advices. i really needed them, but how do i do
parallel programming? i mean how do i tell the individual processor on
what data it should work on?
> Since it is a dual core processor, you shall try managing to do some
> parallel programming, you can make it so your program runs half of the
> input in a different thread/process, this way you will make use of the
> whole CPU. But the reality is that as long as you got the correct
> solution, it should not matter that much.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: what kiond of computer?

2010-05-09 Thread Vexorian
As of 2008 I used a P4, never really had any issue related to
execution time, and managed to get in top 500...

For 2009 I got a core 2 duo. I actually find it difficult not to run a
solution in time since that purchase...

Anyway, from my perspective:
- RAM and fast HD. Not really because you'll need it (albeit not
having to worry about memory makes dp solutions much easier) but
because it will save your computer from locking terribly if you make
certain bugs that make it eat all your memory:/ ...
- If you got money and want to use it to improve your GCJ experience.
IMHO Spend in two things : ISP and a UPS unit. Your ISP should have
decent speed but most importantly should be reliable. You don't want
to lose a round because you didn't have internet access. Ditto with
the UPS. Basically, once you have a core 2 duo you should begin to
worry more about external factors and your own algorithmic skill than
your CPU.

Since it is a dual core processor, you shall try managing to do some
parallel programming, you can make it so your program runs half of the
input in a different thread/process, this way you will make use of the
whole CPU. But the reality is that as long as you got the correct
solution, it should not matter that much.

On May 9, 11:29 pm, tonka  wrote:
> hi, this is a general question to all coding fans...for running
> programs fairly fast what kind of computer should one use? what should
> be the minimum processor and memory requirement? i am currently using
> 1gb of ram but i am planning on increasing this. is this going to help
> solving problems faster esp. for the large input files or should i go
> for processor upgrade?( i am currently using core2duo)
> thanks in advance.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] what kiond of computer?

2010-05-09 Thread Carlos Guia
If you want to upgrade your computer for more reasons than the GCJ, with
your configuration I would suggest more RAM.

But for the Codejam I recommend practicing, this tutorials are a good place
to start, http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=alg_index
.

Having the correct approach will make it run on any computer, having a bit
faster computer, will usually help you very little.

Carlos Guía


On Sun, May 9, 2010 at 11:32 PM, Jason Lepack  wrote:

> I use a netbook and ideone.com
> Sent on the TELUS Mobility network with BlackBerry
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Bartholomew Furrow
>
> hi,
> in C, normally we use printf("%0.0lf",n) to ignore the decimal part..
> while printing..


Though if you're doing a floating-point calculation for something with an
exact integer answer, you're probably doing something wrong, and should
consider using long long instead.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Languages used

2010-05-09 Thread Bartholomew Furrow
>
> i have downloaded a 30-day trial version of mathematica 6.0 for gcj
> which is available freely over the internet. so can i use it to solve
> problems in gcj 2010?
>

>From the rules:

Time-limited trials for compilers and interpreters are disallowed.


The reason for this is that if I've previously downloaded Mathematica's
trial, now I can't use it to compete or to test your programs.  It's
possible I could get around this somehow, but that would presumably be in
violation of the license agreement.

With that said, we could consider changing the "free languages only" rule
for next year if lots of people wanted it changed.  I like it because it's
egalitarian, but it's a limitation and so not obviously the right thing to
do.  I'm curious as to what you fine people think.

Cheers,
Bartholomew

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] what kiond of computer?

2010-05-09 Thread Jason Lepack
I use a netbook and ideone.com
Sent on the TELUS Mobility network with BlackBerry

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] what kiond of computer?

2010-05-09 Thread tonka
hi, this is a general question to all coding fans...for running
programs fairly fast what kind of computer should one use? what should
be the minimum processor and memory requirement? i am currently using
1gb of ram but i am planning on increasing this. is this going to help
solving problems faster esp. for the large input files or should i go
for processor upgrade?( i am currently using core2duo)
thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: Languages used

2010-05-09 Thread tonka
i have downloaded a 30-day trial version of mathematica 6.0 for gcj
which is available freely over the internet. so can i use it to solve
problems in gcj 2010?

On May 10, 6:14 am, Bartholomew Furrow  wrote:
> > Doesn't this mean that Mathematica isn't allowed?
>
> Yes, it does (unless someone can find me a legal, free version of
> Mathematica that you can all use).  We're aware that there are some
> Mathematica solutions, though fortunately all from people who solved other
> problems too.  We'll contact them to let them know, subtract the points, and
> work on making this a little more clear.
>
> Cheers,
> Bartholomew
>
> --
> You received this message because you are subscribed to the Google Groups 
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: Thank you code jam authors on behalf of all participants

2010-05-09 Thread Shoubhik78
yeah, You are right, even I got a bit confused.. as my "theme park"
source code didn't work on the large input set..

 I was considering running it on another computer with a higher
config( I have Core2Duo with 1GB RAM) .

But nevertheless,.. I realised after submitting my "Snapper Chain"
output that it is ONLY the algorithm that really matters !!!

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Shoubhik78
hi,
in C, normally we use printf("%0.0lf",n) to ignore the decimal part..
while printing..

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: Discussion about Snapper Chain

2010-05-09 Thread Patt
I was thinking the same way as Jacob to treat it as a N-bit binary
number, then thing will be much easier.

So N is number of snappers and K0 is a mount of time the finger snaps
to turn on the lights

So
N:K
1:2
2:4
3:8
4:16

This way I can check if the snaps actually make the lights on or not.
I though it would work fine as a super bonehead solution at first, but
I would get stuck when the amount of snaps went beyond the amount it
takes to turn the light on start from initial condition (all 0s).



On May 9, 10:06 pm, Jacob Lyles  wrote:
> I think it is simplist to pretend the snaps are not snaps, but bits in
> an N-bit binary number. When you get to all 1s, it is on.
>
> On Sun, May 9, 2010 at 6:17 PM, Gustavo Pacianotto Gouveia
>
>
>
>  wrote:
> > Yeah... the way to conclude the solution for me was a little diferrent to,
> > but it is always the study of the cycles..
> > I deduced from the same thinking of tower of hanoi:
> > Let be F(n) the number of snaps to turn the light on:
> >  when you add a snapper, to turn the light on, we need:
> > 1:to energise this snapper --> F(n-1) snaps
> > 2:to turn this on -->1 snap
> > 3:to reenergise again --> F(n-1) snaps
> > so F(n) = 2F(n-1)+1
> >   2F(n-1) = 4F(n-2)+2
> > 
> >   2^(n-1)F(1) = 2^n*0+2^(n-1)                    // F(0) = 0
> > --
> > F(n) = 2^n-1   => so, after 2^n-1 snaps the light will be on. one more snap
> > and we have the inicial case. => we have a cycle of 2^N snaps and the ON
> > state is the 2^N-1 state of every cycle...
>
> > 2010/5/9 Dhruva Sagar 
>
> >> Ok, it seems that the logic I happened to deduce was a little (subtle)
> >> different than everyone elses.
> >> For 2 snappers this is how the state changes
> >> 0 0
> >> snap
> >> 1 0
> >> snap
> >> 0 1
> >> snap
> >> 1 1
> >> So the above shows that for 2 snappers the light turns on in 3 snaps =
> >> 2^N-1 snaps. But then when you look at the sample input output given in the
> >> problem statement I saw that there was this test case : 4 47, which implies
> >> that K can also be greater than 2^N-1. So lets see what happens of that is
> >> the case
> >> 0 0
> >> snap
> >> 1 0
> >> snap
> >> 0 1
> >> snap
> >> 1 1
> >> snap
> >> 0 0
> >> snap
> >> 1 0
> >> snap
> >> 0 1
> >> snap
> >> 1 1
> >> So now in the above pattern you will see that although the pattern
> >> repeats, this time it actually takes 4 = 2^N more snaps to bring it back to
> >> the ON state.
> >> So the first time it takes 2^N-1, and from then onwards every 2^N snaps it
> >> will turn on again.
> >> hence I deduced this simple formula, for the light to be on :
> >> k = 2^N-1 + (Some number) * 2^N
> >> From this then I simply deduced that
> >> When (k - 2^N - 1) % (2^N) == 0, the snapper is ON :). Although this is
> >> pretty much the same as others, I think this way is slightly easier to
> >> understand, at least it is for me.
> >> On Mon, May 10, 2010 at 06:14, Gustavo Pacianotto Gouveia
> >>  wrote:
>
> >>> both are exactly the same solution.. think.. how to calculate this?
> >>> "
> >>> ... The solution to the problem is then very simple. The answer is "ON"
> >>> if and only if the rightmost N bits of K are 1. ...
> >>> "
> >>> the rightmost N bits are represented as: 2^{N}-1 = 000...0...11
> >>> (N ones)
> >>> (2^N-1) & (K) == 2^N-1   <--- it doesn't matter in what cycle it is..
> >>> just the relative position into the cycle (the last one)
> >>> <=> (2^N-1)&(K+1) == 0 <=> (K+1)%(2^N) == 0
> >>> and  verifying the statement:
> >>> "
> >>> ... The formula is ( Number of clicks)+1 divided by (2^(number of
> >>> snappers) should be an integer  number.
> >>> If anyone really interested  i may include how to deduce the formula ...
> >>> "
> >>> is equal to: (K+1)%(2^{N}) == 0  <---  if it is on the right place of the
> >>> cycle (the last one), and we add 1, then, we have a integer number of
> >>> cycles
> >>> both verify if the K is in the right place on the cycle and both are
> >>> O(1) ... so, I don't think one is more elegant than the other.
>
> >>> 2010/5/9 David M. 
>
>  I used that same formula to solve the problem too (I was looking the
>  interval of clicks the lamp switched on) and it worked perfect. But 
>  reading
>  the contest analisys... i think analisys' solution is more elegant and
>  simply than mine... :)
>
>  Well, the problem was solved and that's the important :D
>
>  2010/5/9 Abdelrhman Abotaleb 
>
> > Ok I'm want really to discuss it
> > because I solve it using a very simple way.
> > only single operation!!!  :D :D
> > I deduced a formula relates the number of snappers by the number of
> > clicks
> > if it satisfy the formula so the lamp is ON ;otherwise the lamp is off
>
> > Indeed this method is sooo efficient for the large data set
> > input .
>
> > Really in the first I solve it straightforward using recursion
> > algorithms and  so on
>
> > The formula is ( N

Re: [gcj] Discussion about Snapper Chain

2010-05-09 Thread Jacob Lyles
I think it is simplist to pretend the snaps are not snaps, but bits in
an N-bit binary number. When you get to all 1s, it is on.


On Sun, May 9, 2010 at 6:17 PM, Gustavo Pacianotto Gouveia
 wrote:
> Yeah... the way to conclude the solution for me was a little diferrent to,
> but it is always the study of the cycles..
> I deduced from the same thinking of tower of hanoi:
> Let be F(n) the number of snaps to turn the light on:
>  when you add a snapper, to turn the light on, we need:
> 1:to energise this snapper --> F(n-1) snaps
> 2:to turn this on -->1 snap
> 3:to reenergise again --> F(n-1) snaps
> so F(n) = 2F(n-1)+1
>   2F(n-1) = 4F(n-2)+2
> 
>   2^(n-1)F(1) = 2^n*0+2^(n-1)                    // F(0) = 0
> --
> F(n) = 2^n-1   => so, after 2^n-1 snaps the light will be on. one more snap
> and we have the inicial case. => we have a cycle of 2^N snaps and the ON
> state is the 2^N-1 state of every cycle...
>
>
>
>
>
>
>
> 2010/5/9 Dhruva Sagar 
>>
>> Ok, it seems that the logic I happened to deduce was a little (subtle)
>> different than everyone elses.
>> For 2 snappers this is how the state changes
>> 0 0
>> snap
>> 1 0
>> snap
>> 0 1
>> snap
>> 1 1
>> So the above shows that for 2 snappers the light turns on in 3 snaps =
>> 2^N-1 snaps. But then when you look at the sample input output given in the
>> problem statement I saw that there was this test case : 4 47, which implies
>> that K can also be greater than 2^N-1. So lets see what happens of that is
>> the case
>> 0 0
>> snap
>> 1 0
>> snap
>> 0 1
>> snap
>> 1 1
>> snap
>> 0 0
>> snap
>> 1 0
>> snap
>> 0 1
>> snap
>> 1 1
>> So now in the above pattern you will see that although the pattern
>> repeats, this time it actually takes 4 = 2^N more snaps to bring it back to
>> the ON state.
>> So the first time it takes 2^N-1, and from then onwards every 2^N snaps it
>> will turn on again.
>> hence I deduced this simple formula, for the light to be on :
>> k = 2^N-1 + (Some number) * 2^N
>> From this then I simply deduced that
>> When (k - 2^N - 1) % (2^N) == 0, the snapper is ON :). Although this is
>> pretty much the same as others, I think this way is slightly easier to
>> understand, at least it is for me.
>> On Mon, May 10, 2010 at 06:14, Gustavo Pacianotto Gouveia
>>  wrote:
>>>
>>> both are exactly the same solution.. think.. how to calculate this?
>>> "
>>> ... The solution to the problem is then very simple. The answer is "ON"
>>> if and only if the rightmost N bits of K are 1. ...
>>> "
>>> the rightmost N bits are represented as: 2^{N}-1 = 000...0...11
>>> (N ones)
>>> (2^N-1) & (K) == 2^N-1   <--- it doesn't matter in what cycle it is..
>>> just the relative position into the cycle (the last one)
>>> <=> (2^N-1)&(K+1) == 0 <=> (K+1)%(2^N) == 0
>>> and  verifying the statement:
>>> "
>>> ... The formula is ( Number of clicks)+1 divided by (2^(number of
>>> snappers) should be an integer  number.
>>> If anyone really interested  i may include how to deduce the formula ...
>>> "
>>> is equal to: (K+1)%(2^{N}) == 0  <---  if it is on the right place of the
>>> cycle (the last one), and we add 1, then, we have a integer number of
>>> cycles
>>> both verify if the K is in the right place on the cycle and both are
>>> O(1) ... so, I don't think one is more elegant than the other.
>>>
>>>
>>>
>>>
>>>
>>>
>>> 2010/5/9 David M. 

 I used that same formula to solve the problem too (I was looking the
 interval of clicks the lamp switched on) and it worked perfect. But reading
 the contest analisys... i think analisys' solution is more elegant and
 simply than mine... :)

 Well, the problem was solved and that's the important :D


 2010/5/9 Abdelrhman Abotaleb 
>
> Ok I'm want really to discuss it
> because I solve it using a very simple way.
> only single operation!!!  :D :D
> I deduced a formula relates the number of snappers by the number of
> clicks
> if it satisfy the formula so the lamp is ON ;otherwise the lamp is off
>
> Indeed this method is sooo efficient for the large data set
> input .
>
> Really in the first I solve it straightforward using recursion
> algorithms and  so on
>
>
> The formula is ( Number of clicks)+1 divided by (2^(number of snappers)
> should be an integer  number.
> If anyone really interested  i may include how to deduce the formula
>
> Good Luck
>
>
> On Sun, May 9, 2010 at 9:26 AM, Varun Nischal 
> wrote:
>>
>> Hello all,
>>
>> Is anyone interested in discussing the algorithm for Snapper Chain.
>> What was the right approach to it?
>>
>> PS: I have seen some solved source code. But, would like to know about
>> the approach.
>>
>> Thanks,
>> Varun
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "google-codejam" group.
>> T

Re: [gcj] Discussion about Snapper Chain

2010-05-09 Thread Gustavo Pacianotto Gouveia
Yeah... the way to conclude the solution for me was a little diferrent to,
but it is always the study of the cycles..

I deduced from the same thinking of tower of hanoi:
Let be F(n) the number of snaps to turn the light on:
 when you add a snapper, to turn the light on, we need:
1:to energise this snapper --> F(n-1) snaps
2:to turn this on -->1 snap
3:to reenergise again --> F(n-1) snaps

so F(n) = 2F(n-1)+1
  2F(n-1) = 4F(n-2)+2

  2^(n-1)F(1) = 2^n*0+2^(n-1)// F(0) = 0
--
F(n) = 2^n-1   => so, after 2^n-1 snaps the light will be on. one more snap
and we have the inicial case. => we have a cycle of 2^N snaps and the ON
state is the 2^N-1 state of every cycle...








2010/5/9 Dhruva Sagar 

> Ok, it seems that the logic I happened to deduce was a little (subtle)
> different than everyone elses.
>
> For 2 snappers this is how the state changes
>
> 0 0
> snap
> 1 0
> snap
> 0 1
> snap
> 1 1
>
> So the above shows that for 2 snappers the light turns on in 3 snaps =
> 2^N-1 snaps. But then when you look at the sample input output given in the
> problem statement I saw that there was this test case : 4 47, which implies
> that K can also be greater than 2^N-1. So lets see what happens of that is
> the case
>
> 0 0
> snap
> 1 0
> snap
> 0 1
> snap
> 1 1
> snap
> 0 0
> snap
> 1 0
> snap
> 0 1
> snap
> 1 1
>
> So now in the above pattern you will see that although the pattern repeats,
> this time it actually takes 4 = 2^N more snaps to bring it back to the ON
> state.
>
> So the first time it takes 2^N-1, and from then onwards every 2^N snaps it
> will turn on again.
>
> hence I deduced this simple formula, for the light to be on :
>
> k = 2^N-1 + (Some number) * 2^N
>
> From this then I simply deduced that
>
> When (k - 2^N - 1) % (2^N) == 0, the snapper is ON :). Although this is
> pretty much the same as others, I think this way is slightly easier to
> understand, at least it is for me.
>
> On Mon, May 10, 2010 at 06:14, Gustavo Pacianotto Gouveia <
> gustavo.paciano...@gmail.com> wrote:
>
>> both are exactly the same solution.. think.. how to calculate this?
>> "
>> ... The solution to the problem is then very simple. The answer is "ON" if
>> and only if the rightmost *N* bits of *K* are 1. ...
>> "
>> the rightmost N bits are represented as: 2^{N}-1 = 000...0...11
>> (N ones)
>> (2^N-1) & (K) == 2^N-1   <--- it doesn't matter in what cycle it is.. just
>> the relative position into the cycle (the last one)
>>
>> <=> (2^N-1)&(K+1) == 0 <=> (K+1)%(2^N) == 0
>>
>> and  verifying the statement:
>> "
>> ... The formula is ( Number of clicks)+1 divided by (2^(number of
>> snappers) should be an integer  number.
>> If anyone really interested  i may include how to deduce the formula ...
>> "
>> is equal to: (K+1)%(2^{N}) == 0  <---  if it is on the right place of the
>> cycle (the last one), and we add 1, then, we have a integer number of
>> cycles
>>
>> both verify if the K is in the right place on the cycle and both are
>> O(1) ... so, I don't think one is more elegant than the other.
>>
>>
>>
>>
>>
>>
>>
>> 2010/5/9 David M. 
>>
>> I used that same formula to solve the problem too (I was looking the
>>> interval of clicks the lamp switched on) and it worked perfect. But reading
>>> the contest analisys... i think analisys' solution is more elegant and
>>> simply than mine... :)
>>>
>>> Well, the problem was solved and that's the important :D
>>>
>>>
>>> 2010/5/9 Abdelrhman Abotaleb 
>>>
>>> Ok I'm want really to discuss it
 because I solve it using a very simple way.
 only single operation!!!  :D :D
 I deduced a formula relates the number of snappers by the number of
 clicks
 if it satisfy the formula so the lamp is ON ;otherwise the lamp is off

 Indeed this method is sooo efficient for the large data set
 input .

 Really in the first I solve it straightforward using recursion
 algorithms and  so on


 The formula is ( Number of clicks)+1 divided by (2^(number of snappers)
 should be an integer  number.
 If anyone really interested  i may include how to deduce the formula

 Good Luck


 On Sun, May 9, 2010 at 9:26 AM, Varun Nischal 
 wrote:

> Hello all,
>
> Is anyone interested in discussing the algorithm for Snapper Chain.
> What was the right approach to it?
>
> PS: I have seen some solved source code. But, would like to know about
> the approach.
>
> Thanks,
> Varun
>
> --
> You received this message because you are subscribed to the Google
> Groups "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

  --

Re: [gcj] Languages used

2010-05-09 Thread Bartholomew Furrow
>
> Doesn't this mean that Mathematica isn't allowed?
>

Yes, it does (unless someone can find me a legal, free version of
Mathematica that you can all use).  We're aware that there are some
Mathematica solutions, though fortunately all from people who solved other
problems too.  We'll contact them to let them know, subtract the points, and
work on making this a little more clear.

Cheers,
Bartholomew

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Discussion about Snapper Chain

2010-05-09 Thread Dhruva Sagar
Ok, it seems that the logic I happened to deduce was a little (subtle)
different than everyone elses.

For 2 snappers this is how the state changes

0 0
snap
1 0
snap
0 1
snap
1 1

So the above shows that for 2 snappers the light turns on in 3 snaps = 2^N-1
snaps. But then when you look at the sample input output given in the
problem statement I saw that there was this test case : 4 47, which implies
that K can also be greater than 2^N-1. So lets see what happens of that is
the case

0 0
snap
1 0
snap
0 1
snap
1 1
snap
0 0
snap
1 0
snap
0 1
snap
1 1

So now in the above pattern you will see that although the pattern repeats,
this time it actually takes 4 = 2^N more snaps to bring it back to the ON
state.

So the first time it takes 2^N-1, and from then onwards every 2^N snaps it
will turn on again.

hence I deduced this simple formula, for the light to be on :

k = 2^N-1 + (Some number) * 2^N

>From this then I simply deduced that

When (k - 2^N - 1) % (2^N) == 0, the snapper is ON :). Although this is
pretty much the same as others, I think this way is slightly easier to
understand, at least it is for me.

On Mon, May 10, 2010 at 06:14, Gustavo Pacianotto Gouveia <
gustavo.paciano...@gmail.com> wrote:

> both are exactly the same solution.. think.. how to calculate this?
> "
> ... The solution to the problem is then very simple. The answer is "ON" if
> and only if the rightmost *N* bits of *K* are 1. ...
> "
> the rightmost N bits are represented as: 2^{N}-1 = 000...0...11
> (N ones)
> (2^N-1) & (K) == 2^N-1   <--- it doesn't matter in what cycle it is.. just
> the relative position into the cycle (the last one)
>
> <=> (2^N-1)&(K+1) == 0 <=> (K+1)%(2^N) == 0
>
> and  verifying the statement:
> "
> ... The formula is ( Number of clicks)+1 divided by (2^(number of snappers)
> should be an integer  number.
> If anyone really interested  i may include how to deduce the formula ...
> "
> is equal to: (K+1)%(2^{N}) == 0  <---  if it is on the right place of the
> cycle (the last one), and we add 1, then, we have a integer number of
> cycles
>
> both verify if the K is in the right place on the cycle and both are
> O(1) ... so, I don't think one is more elegant than the other.
>
>
>
>
>
>
>
> 2010/5/9 David M. 
>
> I used that same formula to solve the problem too (I was looking the
>> interval of clicks the lamp switched on) and it worked perfect. But reading
>> the contest analisys... i think analisys' solution is more elegant and
>> simply than mine... :)
>>
>> Well, the problem was solved and that's the important :D
>>
>>
>> 2010/5/9 Abdelrhman Abotaleb 
>>
>> Ok I'm want really to discuss it
>>> because I solve it using a very simple way.
>>> only single operation!!!  :D :D
>>> I deduced a formula relates the number of snappers by the number of
>>> clicks
>>> if it satisfy the formula so the lamp is ON ;otherwise the lamp is off
>>>
>>> Indeed this method is sooo efficient for the large data set
>>> input .
>>>
>>> Really in the first I solve it straightforward using recursion algorithms
>>> and  so on
>>>
>>>
>>> The formula is ( Number of clicks)+1 divided by (2^(number of snappers)
>>> should be an integer  number.
>>> If anyone really interested  i may include how to deduce the formula
>>>
>>> Good Luck
>>>
>>>
>>> On Sun, May 9, 2010 at 9:26 AM, Varun Nischal 
>>> wrote:
>>>
 Hello all,

 Is anyone interested in discussing the algorithm for Snapper Chain.
 What was the right approach to it?

 PS: I have seen some solved source code. But, would like to know about
 the approach.

 Thanks,
 Varun

 --
 You received this message because you are subscribed to the Google
 Groups "google-codejam" group.
 To post to this group, send email to google-c...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

>>>
>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "google-codejam" group.
>>> To post to this group, send email to google-c...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> google-code+unsubscr...@googlegroups.com
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-code?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to google-c...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>
>
>
> --
> grato,
>
> Gustavo Pacianotto Gouveia
>
> LTI - Laboratório de Técnicas Inteligentes
> Escola Politécnica da Universidade de São Paulo
>   gustavo.gouv...@poli.usp.br
>   gl_lg...@hotma

[gcj] Re: Theme Park - cycle position

2010-05-09 Thread LeppyR64
Ooops...


1
1 7 5
1 1 5 6 5

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: Theme Park - cycle position

2010-05-09 Thread LeppyR64
Do you mean like this?

1
5 7 5
1 1 5 6 5

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Discussion about Snapper Chain

2010-05-09 Thread Gustavo Pacianotto Gouveia
both are exactly the same solution.. think.. how to calculate this?
"
... The solution to the problem is then very simple. The answer is "ON" if
and only if the rightmost *N* bits of *K* are 1. ...
"
the rightmost N bits are represented as: 2^{N}-1 = 000...0...11   (N
ones)
(2^N-1) & (K) == 2^N-1   <--- it doesn't matter in what cycle it is.. just
the relative position into the cycle (the last one)

<=> (2^N-1)&(K+1) == 0 <=> (K+1)%(2^N) == 0

and  verifying the statement:
"
... The formula is ( Number of clicks)+1 divided by (2^(number of snappers)
should be an integer  number.
If anyone really interested  i may include how to deduce the formula ...
"
is equal to: (K+1)%(2^{N}) == 0  <---  if it is on the right place of the
cycle (the last one), and we add 1, then, we have a integer number of
cycles

both verify if the K is in the right place on the cycle and both are
O(1) ... so, I don't think one is more elegant than the other.







2010/5/9 David M. 

> I used that same formula to solve the problem too (I was looking the
> interval of clicks the lamp switched on) and it worked perfect. But reading
> the contest analisys... i think analisys' solution is more elegant and
> simply than mine... :)
>
> Well, the problem was solved and that's the important :D
>
>
> 2010/5/9 Abdelrhman Abotaleb 
>
> Ok I'm want really to discuss it
>> because I solve it using a very simple way.
>> only single operation!!!  :D :D
>> I deduced a formula relates the number of snappers by the number of clicks
>>
>> if it satisfy the formula so the lamp is ON ;otherwise the lamp is off
>>
>> Indeed this method is sooo efficient for the large data set
>> input .
>>
>> Really in the first I solve it straightforward using recursion algorithms
>> and  so on
>>
>>
>> The formula is ( Number of clicks)+1 divided by (2^(number of snappers)
>> should be an integer  number.
>> If anyone really interested  i may include how to deduce the formula
>>
>> Good Luck
>>
>>
>> On Sun, May 9, 2010 at 9:26 AM, Varun Nischal wrote:
>>
>>> Hello all,
>>>
>>> Is anyone interested in discussing the algorithm for Snapper Chain.
>>> What was the right approach to it?
>>>
>>> PS: I have seen some solved source code. But, would like to know about
>>> the approach.
>>>
>>> Thanks,
>>> Varun
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "google-codejam" group.
>>> To post to this group, send email to google-c...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> google-code+unsubscr...@googlegroups.com
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-code?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to google-c...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>



-- 
grato,

Gustavo Pacianotto Gouveia

LTI - Laboratório de Técnicas Inteligentes
Escola Politécnica da Universidade de São Paulo
  gustavo.gouv...@poli.usp.br
  gl_lg...@hotmail.com
  gustavo.paciano...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Thank you code jam authors on behalf of all participants

2010-05-09 Thread CoffeeWithJava
Thank you each of you guys for preparing these questions. After
reading all the group mails since the contest  it appears all these
questions have become BRAND in itself :-), so on behalf of all the
participants of the qualification round we thank you for all your
effort.

==
Problem A. Snapper Chain Written and prepared by Igor Naverniouk.

Problem B. Fair Warning Written by Bartholomew Furrow. Prepared by
Xiaomin Chen and Bartholomew Furrow.

Problem C. Theme Park Written by Bartholomew Furrow and Igor
Naverniouk. Prepared by Ante Derek and Bartholomew Furrow.

Contest analysis presented by Bartholomew Furrow, Igor Naverniouk, and
Cosmin Negruseri.

Solutions and other problem preparation provided by David Arthur, John
Dethridge, Petr Mitrichev, and Cosmin Negruseri.
==


Fellow Participants,
There were lots of discussion mails regarding large inputs or slow
computers. Well no one complains about slow algorithm :-). The right
algorithm could have solved all the question in less than a minute on
any computer with processor of level lower than Pentium 1. Please find
the contest analysis here.

http://code.google.com/codejam/contest/dashboard?c=433101#s=a



Thanks.
One of the participant

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Carlos Guia
You can't find incorrect solutions at the scoreboard, but if you go the
contest page, where the problem statements are. Below the "ask a question"
link on the left, there is a "view my submissions", there you should be able
to download the input, output and source you sent.

Carlos Guía


On Sun, May 9, 2010 at 6:09 PM, Mikhail Dektyarev <
mihail.dektya...@googlemail.com> wrote:

> Is you use double, then are you sorry that your answer is exact?
>
>
> On Mon, May 10, 2010 at 1:10 AM, Abdelrhman Abotaleb <
> profvip.abota...@gmail.com> wrote:
>
>>
>> I think it's related to the output format
>> in c++ I'm casting the double to long integer so that the answer is exact
>> without floating point or exponent
>>
>>
>>
>> On Sun, May 9, 2010 at 11:00 PM, Chethan B  wrote:
>>
>>> oops! I meant bear* with me :)
>>>
>>> On May 10, 1:57 am, Chethan B  wrote:
>>> > Thanks Benetin. Thats mighty nice of you. That piece of info is really
>>> > helpful.
>>> > Now i just have to find out why i am getting the same  "Case #32:
>>> > 1.46888007111242e+015" output when i try to run epsalon's code.
>>> > Is it related to my machine configuration or my perl version or
>>> > something? Bare with me if this is a stupid question.
>>> >
>>> > -Chethan
>>> >
>>> > On May 10, 1:47 am, benetin  wrote:
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > > Hi Chethan,
>>> >
>>> > > I replied to the other thread, but don't know why it did not get
>>> > > through:
>>> > > - About your output, it is not exactly the same as the others. Here
>>> is
>>> > > one line from your submission:
>>> > > Case #32: 1.46888007111242e+015
>>> > > This will not be accepted, since the problem is expecting the exact
>>> > > answer, as epsalon's solution does.
>>> > > - About the download Carlos mentioned: Enter the contest again with
>>> > > your login, there will be a "My submissions" tab.
>>> >
>>> > > Hope this answers the questions.
>>> >
>>> > > Ben
>>> >
>>> > > On May 9, 4:32 pm, Chethan B  wrote:
>>> >
>>> > > > @Carlos: I would really like to do that, download my own submission
>>> > > > and check if i have sent the right file... but the problem is, its
>>> not
>>> > > > available for download.. as i mentioned earlier, i had to do lots
>>> of
>>> > > > optimization for large data and hence my source code for small data
>>> is
>>> > > > different from my source code for large data. My source code for
>>> large
>>> > > > data is not available for download. It simply says 1 wrong try.
>>> > > > Is there some other way to check the file i have submitted?? Am i
>>> > > > checking at wrong place??
>>> > > > @All : I really really appreciate all your responses and i am sorry
>>> if
>>> > > > this is spamming. I am just trying out to find out where i could
>>> have
>>> > > > gone wrong or if there is any bug in validating source codes or
>>> > > > outputs for large data set.
>>> >
>>> > > > On May 10, 1:23 am, Carlos Guia  wrote:
>>> >
>>> > > > > You can download your own submissions, and check if you did send
>>> the right
>>> > > > > file.
>>> >
>>> > > > > 64 bits are indeed needed.
>>> >
>>> > > > > Carlos Guía
>>> >
>>> > > > > On Sun, May 9, 2010 at 4:17 PM, Hassan . 
>>> wrote:
>>> > > > > > *i think you had same issue as me*
>>> > > > > > *
>>> > > > > > *
>>> > > > > > *i use Int32 in C# to calculate the result *
>>> > > > > > *i wasn't enough :)*
>>> > > > > > *
>>> > > > > > *
>>> > > > > > *and as i did it, the compiler didn't warned me*
>>> > > > > > *
>>> > > > > > *
>>> > > > > > *
>>> > > > > > *
>>> > > > > > *i rechecked that with int 64 and the result was correct.*
>>> > > > > > *
>>> > > > > > *
>>> > > > > > On Sun, May 9, 2010 at 10:10 PM, Chethan B <
>>> chethu1...@gmail.com> wrote:
>>> >
>>> > > > > >> @Felipe : Thanks for the link. That's pretty much what i have
>>> done..
>>> > > > > >> My code takes couple of seconds to process large data set.
>>> >
>>> > > > > >> On May 10, 12:17 am, Felipe Sodré Silva 
>>> wrote:
>>> > > > > >> >
>>> http://code.google.com/codejam/contest/dashboard?c=433101#s=a&a=2
>>> >
>>> > > > > >> > On Sun, May 9, 2010 at 4:09 PM, Chethan B <
>>> chethu1...@gmail.com> wrote:
>>> > > > > >> > > Hi,
>>> >
>>> > > > > >> > > My source code for Problem C in qualification round GCJ
>>> 2010 is
>>> > > > > >> > > rejected for some unknown reason!
>>> > > > > >> > > At the time of submission i got "submission successful"
>>> message. Now,
>>> > > > > >> > > i see ' 1 wrong try' message.
>>> > > > > >> > > I have downloaded a correct source code written by
>>> 'epsalon' (Rank
>>> > > > > >> > > 2360) for large input data.
>>> > > > > >> > > The output of epsalon's source code and that of my source
>>> code match
>>> > > > > >> > > exactly for the large input data that i got during the
>>> competition.
>>> > > > > >> > > So i believe that my source code must also be working
>>> fine. Please
>>> > > > > >> > > help me in understanding why my code was considered to be
>>> a wrong one.
>>> >
>>> > > > > >> > > thanks,
>>> > > > > >> 

Re: [gcj] Discussion about Snapper Chain

2010-05-09 Thread David M.
I used that same formula to solve the problem too (I was looking the
interval of clicks the lamp switched on) and it worked perfect. But reading
the contest analisys... i think analisys' solution is more elegant and
simply than mine... :)

Well, the problem was solved and that's the important :D


2010/5/9 Abdelrhman Abotaleb 

> Ok I'm want really to discuss it
> because I solve it using a very simple way.
> only single operation!!!  :D :D
> I deduced a formula relates the number of snappers by the number of clicks
> if it satisfy the formula so the lamp is ON ;otherwise the lamp is off
>
> Indeed this method is sooo efficient for the large data set
> input .
>
> Really in the first I solve it straightforward using recursion algorithms
> and  so on
>
>
> The formula is ( Number of clicks)+1 divided by (2^(number of snappers)
> should be an integer  number.
> If anyone really interested  i may include how to deduce the formula
>
> Good Luck
>
>
> On Sun, May 9, 2010 at 9:26 AM, Varun Nischal wrote:
>
>> Hello all,
>>
>> Is anyone interested in discussing the algorithm for Snapper Chain.
>> What was the right approach to it?
>>
>> PS: I have seen some solved source code. But, would like to know about the
>> approach.
>>
>> Thanks,
>> Varun
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to google-c...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Theme Park - cycle position

2010-05-09 Thread Mikhail Dektyarev
Hi.
I think, my solution for Problem C will work not correctly, if R < (number
of step when we enter to a cycle).
But I couldn't find an example, when we enter to a cycle later then after
the first running. In small and large inputs there is no such example, too.
Can anybody find it, or it doesn't exist?

-- 
Best regards, Дектярев Михаил

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Mikhail Dektyarev
Is you use double, then are you sorry that your answer is exact?

On Mon, May 10, 2010 at 1:10 AM, Abdelrhman Abotaleb <
profvip.abota...@gmail.com> wrote:

>
> I think it's related to the output format
> in c++ I'm casting the double to long integer so that the answer is exact
> without floating point or exponent
>
>
>
> On Sun, May 9, 2010 at 11:00 PM, Chethan B  wrote:
>
>> oops! I meant bear* with me :)
>>
>> On May 10, 1:57 am, Chethan B  wrote:
>> > Thanks Benetin. Thats mighty nice of you. That piece of info is really
>> > helpful.
>> > Now i just have to find out why i am getting the same  "Case #32:
>> > 1.46888007111242e+015" output when i try to run epsalon's code.
>> > Is it related to my machine configuration or my perl version or
>> > something? Bare with me if this is a stupid question.
>> >
>> > -Chethan
>> >
>> > On May 10, 1:47 am, benetin  wrote:
>> >
>> >
>> >
>> >
>> >
>> > > Hi Chethan,
>> >
>> > > I replied to the other thread, but don't know why it did not get
>> > > through:
>> > > - About your output, it is not exactly the same as the others. Here is
>> > > one line from your submission:
>> > > Case #32: 1.46888007111242e+015
>> > > This will not be accepted, since the problem is expecting the exact
>> > > answer, as epsalon's solution does.
>> > > - About the download Carlos mentioned: Enter the contest again with
>> > > your login, there will be a "My submissions" tab.
>> >
>> > > Hope this answers the questions.
>> >
>> > > Ben
>> >
>> > > On May 9, 4:32 pm, Chethan B  wrote:
>> >
>> > > > @Carlos: I would really like to do that, download my own submission
>> > > > and check if i have sent the right file... but the problem is, its
>> not
>> > > > available for download.. as i mentioned earlier, i had to do lots of
>> > > > optimization for large data and hence my source code for small data
>> is
>> > > > different from my source code for large data. My source code for
>> large
>> > > > data is not available for download. It simply says 1 wrong try.
>> > > > Is there some other way to check the file i have submitted?? Am i
>> > > > checking at wrong place??
>> > > > @All : I really really appreciate all your responses and i am sorry
>> if
>> > > > this is spamming. I am just trying out to find out where i could
>> have
>> > > > gone wrong or if there is any bug in validating source codes or
>> > > > outputs for large data set.
>> >
>> > > > On May 10, 1:23 am, Carlos Guia  wrote:
>> >
>> > > > > You can download your own submissions, and check if you did send
>> the right
>> > > > > file.
>> >
>> > > > > 64 bits are indeed needed.
>> >
>> > > > > Carlos Guía
>> >
>> > > > > On Sun, May 9, 2010 at 4:17 PM, Hassan . 
>> wrote:
>> > > > > > *i think you had same issue as me*
>> > > > > > *
>> > > > > > *
>> > > > > > *i use Int32 in C# to calculate the result *
>> > > > > > *i wasn't enough :)*
>> > > > > > *
>> > > > > > *
>> > > > > > *and as i did it, the compiler didn't warned me*
>> > > > > > *
>> > > > > > *
>> > > > > > *
>> > > > > > *
>> > > > > > *i rechecked that with int 64 and the result was correct.*
>> > > > > > *
>> > > > > > *
>> > > > > > On Sun, May 9, 2010 at 10:10 PM, Chethan B <
>> chethu1...@gmail.com> wrote:
>> >
>> > > > > >> @Felipe : Thanks for the link. That's pretty much what i have
>> done..
>> > > > > >> My code takes couple of seconds to process large data set.
>> >
>> > > > > >> On May 10, 12:17 am, Felipe Sodré Silva 
>> wrote:
>> > > > > >> >
>> http://code.google.com/codejam/contest/dashboard?c=433101#s=a&a=2
>> >
>> > > > > >> > On Sun, May 9, 2010 at 4:09 PM, Chethan B <
>> chethu1...@gmail.com> wrote:
>> > > > > >> > > Hi,
>> >
>> > > > > >> > > My source code for Problem C in qualification round GCJ
>> 2010 is
>> > > > > >> > > rejected for some unknown reason!
>> > > > > >> > > At the time of submission i got "submission successful"
>> message. Now,
>> > > > > >> > > i see ' 1 wrong try' message.
>> > > > > >> > > I have downloaded a correct source code written by
>> 'epsalon' (Rank
>> > > > > >> > > 2360) for large input data.
>> > > > > >> > > The output of epsalon's source code and that of my source
>> code match
>> > > > > >> > > exactly for the large input data that i got during the
>> competition.
>> > > > > >> > > So i believe that my source code must also be working fine.
>> Please
>> > > > > >> > > help me in understanding why my code was considered to be a
>> wrong one.
>> >
>> > > > > >> > > thanks,
>> > > > > >> > > Chethan B
>> >
>> > > > > >> > > --
>> > > > > >> > > You received this message because you are subscribed to the
>> Google
>> > > > > >> Groups
>> > > > > >> > > "google-codejam" group.
>> > > > > >> > > To post to this group, send email to
>> google-c...@googlegroups.com.
>> > > > > >> > > To unsubscribe from this group, send email to
>> > > > > >> > > google-code+unsubscr...@googlegroups.com
>> 
>> > > > > >> 
>> > > > > >> > > .
>> > > > > >> > > For more options, visit this group at
>> > > > > >> > >http://groups

Re: [gcj] Re: Weird experience with "Theme Park"

2010-05-09 Thread Mikhail Dektyarev
You forgot 2 solutions.
X. O(N^2) - calculate next[i] and value[i] for O(N^2), then find a cycle for
O(N) and what happens before it for O(N).
Y. O(NlogN) - as previous, but calculate next and value for O(NlogN)

On Sun, May 9, 2010 at 10:47 AM, guest  wrote:

> Well, I've thought of some solutions and I think maybe solution 4
> would be the best :)
>
> 1. O(RN)naive search
> naive.
> 2. O(RlgN)  binary search
> well, quite easy to think of. but according to the size of the test
> data, it is quite risky.
> 3. O(R+N)   queue
> just computing the next[N] and value[N] array. Risky either.
> 4. O(NlgR)  queue+doubling
> doubling next[lgnR][N] and value[lgnR][N] array.  Can be improved by
> rolling the arrays.
> 5. O(N) queue+graph+math
> construting the next[N] array (edges) into a graph, and by computing
> cycles, we can do an effecient linear programming.
>
> Well, solution 5 may be the best in Time and Memory,
>
> solution 4 should be best for programmers 'cause it has the greatest
> balance in either Time, Memory and Code Length.
>
> * next[i] means the first group of the next rollercoasting round.
>  value[i] means the earning of the round started by group i.
>
> :)
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>
>


-- 
Best regards, Дектярев Михаил

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: problem C optimizations

2010-05-09 Thread Mikhail Dektyarev
I think, this is an elegant solution. But it is not O(N*logR), it is
O(N*logR+N^2) - function gerParms take approximately N^2 time.
Solution in O(N) is not the most trivial. I think, the most trivial is
O(N^2) (with trivial:) optimization to O(NlogN))

On Sun, May 9, 2010 at 11:23 PM, hamzawy  wrote:

> Why not to solve it in O(N) (such that N is the number of the group)??
>
> On May 9, 5:42 pm, Dario  wrote:
> > I just made the large input case for problem C by storing 'next
> > position' and 'cash' arrays, then just iterating over them R times.
> > This seems to be O(N+R). But I've been wondering about possible
> > optimizations to this. I can think of an O(NlogR) solution in which I
> > nest the 'next position' and 'cash' arrays, only adding up cash/
> > changing position when the correct bit of R is on (binary). I've
> > pasted my code below (the algorithm described here is really just the
> > solve() function and the rest is wrapping). I'd be interested in a
> > comparison of different optimizations/algorithms over the problem
> > space?
> >
> > def doProb(fname, ofname):
> > #do problem 3 given a file name
> > f = open(fname, 'r');
> > T = int(f.readline());
> > output = ['Case #' + str(i) + ': '+ \
> > str(solve([int(j) for j in f.readline().split()],
> > [int(j) for j in f.readline().split()])) + \
> > '\n' for i in range(1,T+1)];
> > f.close();
> > of = open(ofname, 'w');
> > of.writelines(output);
> > of.close();
> >
> > def solve(x,g):
> > (R,k,N) = x; #unpack the input
> > (np, cash) = getParms(k,g);
> > cur = 0;
> > tot = 0;
> >
> > while(R>0):
> > incl = R%2;
> > R = R//2;
> > if(incl==1):
> > tot += cash[cur];
> > cur = np[cur];
> > (np, cash) = nest(np, cash);
> > return tot;
> >
> > def nest(np, cash):
> > #thinking of np as a permutation, get np^2 and total cash list
> > np2 = [0]*len(np);
> > c2  = [0]*len(np);
> > for i in range(len(np)):
> > np2[i] = np[np[i]];
> > c2[i] = cash[i]+cash[np[i]];
> > return (np2, c2);
> >
> > def getParms(k,g):
> > N= len(g);
> >
> > #special case, all passengers fit in the roller coaster:
> > if(sum(g) <= k):
> > np = [i for i in range(N)];
> > cash = [sum(g)]*N;
> > return (np, cash);
> >
> > #other cases
> > np = [];
> > cash = [];
> > for i in range(N):
> > tot = g[i];
> > j = i;
> > while(tot <= k):
> > j = (j+1)%N;
> > tot += g[j];
> > tot -= g[j];
> > np.append(j);
> > cash.append(tot);
> >
> > return (np, cash);
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> > To post to this group, send email to google-c...@googlegroups.com.
> > To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> > For more options, visit this group athttp://
> groups.google.com/group/google-code?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>
>


-- 
Best regards, Дектярев Михаил

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: C/C++ Theme Park - Best Solution for large output

2010-05-09 Thread hamzawy
take a look here
http://en.wikipedia.org/wiki/Pigeonhole_principle

what you have to do is to get a cycle on the groups and the cycle will
always be found in O(N)(this is proofed by the Pigeonhole Principle).

then the answer will be something like that = before cycle+(cost of
cycle*number of cycles)+ after cycle.

you can make it by O(N) if you use variable length window to move on
the array and preprocess the array which tells you the length of that
group.

On May 9, 10:56 pm, Felipe Sodré Silva  wrote:
> http://code.google.com/codejam/contest/dashboard?c=433101#s=a&a=2
>
>
>
>
>
> On Sun, May 9, 2010 at 12:33 PM, Pakku  wrote:
> > Guys,
>
> > I am wondering what all optimization we can really do.
> > Though, in the qualification, for the theme park problem, i could not
> > solve the large input problem in the given time frame, i optimized it
> > latter in the practice mode.
>
> > These are the optimization that I did.
>
> > for each test case,
>
> > 1. if capacity of roller coaster >= total strength [ sum of all groups
> > ] then simply total earnings = total strength * number of rides.
> > 2. detect if can get a rep if yes, then
> > TotalEarnings =  ( EarningsForRep * (RidesPerDay / TripsNeededToGetARep )
> > );
> > and then TotalEarnings += earnings for the TripsStillLeftInADay ;
>
> > Apart from these 2 optimization is there any other place we can
> > optimize. what is the best possible optimized solution.
> > anyone willing to share the best solution.
>
> > -Prakash
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "google-codejam" group.
> > To post to this group, send email to google-c...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-code+unsubscr...@googlegroups.com > oups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-code?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Abdelrhman Abotaleb
I think it's related to the output format
in c++ I'm casting the double to long integer so that the answer is exact
without floating point or exponent


On Sun, May 9, 2010 at 11:00 PM, Chethan B  wrote:

> oops! I meant bear* with me :)
>
> On May 10, 1:57 am, Chethan B  wrote:
> > Thanks Benetin. Thats mighty nice of you. That piece of info is really
> > helpful.
> > Now i just have to find out why i am getting the same  "Case #32:
> > 1.46888007111242e+015" output when i try to run epsalon's code.
> > Is it related to my machine configuration or my perl version or
> > something? Bare with me if this is a stupid question.
> >
> > -Chethan
> >
> > On May 10, 1:47 am, benetin  wrote:
> >
> >
> >
> >
> >
> > > Hi Chethan,
> >
> > > I replied to the other thread, but don't know why it did not get
> > > through:
> > > - About your output, it is not exactly the same as the others. Here is
> > > one line from your submission:
> > > Case #32: 1.46888007111242e+015
> > > This will not be accepted, since the problem is expecting the exact
> > > answer, as epsalon's solution does.
> > > - About the download Carlos mentioned: Enter the contest again with
> > > your login, there will be a "My submissions" tab.
> >
> > > Hope this answers the questions.
> >
> > > Ben
> >
> > > On May 9, 4:32 pm, Chethan B  wrote:
> >
> > > > @Carlos: I would really like to do that, download my own submission
> > > > and check if i have sent the right file... but the problem is, its
> not
> > > > available for download.. as i mentioned earlier, i had to do lots of
> > > > optimization for large data and hence my source code for small data
> is
> > > > different from my source code for large data. My source code for
> large
> > > > data is not available for download. It simply says 1 wrong try.
> > > > Is there some other way to check the file i have submitted?? Am i
> > > > checking at wrong place??
> > > > @All : I really really appreciate all your responses and i am sorry
> if
> > > > this is spamming. I am just trying out to find out where i could have
> > > > gone wrong or if there is any bug in validating source codes or
> > > > outputs for large data set.
> >
> > > > On May 10, 1:23 am, Carlos Guia  wrote:
> >
> > > > > You can download your own submissions, and check if you did send
> the right
> > > > > file.
> >
> > > > > 64 bits are indeed needed.
> >
> > > > > Carlos Guía
> >
> > > > > On Sun, May 9, 2010 at 4:17 PM, Hassan . 
> wrote:
> > > > > > *i think you had same issue as me*
> > > > > > *
> > > > > > *
> > > > > > *i use Int32 in C# to calculate the result *
> > > > > > *i wasn't enough :)*
> > > > > > *
> > > > > > *
> > > > > > *and as i did it, the compiler didn't warned me*
> > > > > > *
> > > > > > *
> > > > > > *
> > > > > > *
> > > > > > *i rechecked that with int 64 and the result was correct.*
> > > > > > *
> > > > > > *
> > > > > > On Sun, May 9, 2010 at 10:10 PM, Chethan B 
> wrote:
> >
> > > > > >> @Felipe : Thanks for the link. That's pretty much what i have
> done..
> > > > > >> My code takes couple of seconds to process large data set.
> >
> > > > > >> On May 10, 12:17 am, Felipe Sodré Silva 
> wrote:
> > > > > >> >
> http://code.google.com/codejam/contest/dashboard?c=433101#s=a&a=2
> >
> > > > > >> > On Sun, May 9, 2010 at 4:09 PM, Chethan B <
> chethu1...@gmail.com> wrote:
> > > > > >> > > Hi,
> >
> > > > > >> > > My source code for Problem C in qualification round GCJ 2010
> is
> > > > > >> > > rejected for some unknown reason!
> > > > > >> > > At the time of submission i got "submission successful"
> message. Now,
> > > > > >> > > i see ' 1 wrong try' message.
> > > > > >> > > I have downloaded a correct source code written by 'epsalon'
> (Rank
> > > > > >> > > 2360) for large input data.
> > > > > >> > > The output of epsalon's source code and that of my source
> code match
> > > > > >> > > exactly for the large input data that i got during the
> competition.
> > > > > >> > > So i believe that my source code must also be working fine.
> Please
> > > > > >> > > help me in understanding why my code was considered to be a
> wrong one.
> >
> > > > > >> > > thanks,
> > > > > >> > > Chethan B
> >
> > > > > >> > > --
> > > > > >> > > You received this message because you are subscribed to the
> Google
> > > > > >> Groups
> > > > > >> > > "google-codejam" group.
> > > > > >> > > To post to this group, send email to
> google-c...@googlegroups.com.
> > > > > >> > > To unsubscribe from this group, send email to
> > > > > >> > > google-code+unsubscr...@googlegroups.com
> 
> > > > > >> 
> > > > > >> > > .
> > > > > >> > > For more options, visit this group at
> > > > > >> > >http://groups.google.com/group/google-code?hl=en.
> >
> > > > > >> > --
> > > > > >> > You received this message because you are subscribed to the
> Google
> > > > > >> Groups "google-codejam" group.
> > > > > >> > To post to this group, send email to
> google-c...@googlegroups.com.
> > > > > >> > To unsubscribe from this group, send email 

[gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread benetin
Hi Chethan,

I replied to the other thread, but don't know why it did not get
through:
- About your output, it is not exactly the same as the others. Here is
one line from your submission:
Case #32: 1.46888007111242e+015
This will not be accepted, since the problem is expecting the exact
answer, as epsalon's solution does.
- About the download Carlos mentioned: Enter the contest again with
your login, there will be a "My submissions" tab.

Hope this answers the questions.

Ben


On May 9, 4:32 pm, Chethan B  wrote:
> @Carlos: I would really like to do that, download my own submission
> and check if i have sent the right file... but the problem is, its not
> available for download.. as i mentioned earlier, i had to do lots of
> optimization for large data and hence my source code for small data is
> different from my source code for large data. My source code for large
> data is not available for download. It simply says 1 wrong try.
> Is there some other way to check the file i have submitted?? Am i
> checking at wrong place??
> @All : I really really appreciate all your responses and i am sorry if
> this is spamming. I am just trying out to find out where i could have
> gone wrong or if there is any bug in validating source codes or
> outputs for large data set.
>
> On May 10, 1:23 am, Carlos Guia  wrote:
>
>
>
>
>
> > You can download your own submissions, and check if you did send the right
> > file.
>
> > 64 bits are indeed needed.
>
> > Carlos Guía
>
> > On Sun, May 9, 2010 at 4:17 PM, Hassan .  wrote:
> > > *i think you had same issue as me*
> > > *
> > > *
> > > *i use Int32 in C# to calculate the result *
> > > *i wasn't enough :)*
> > > *
> > > *
> > > *and as i did it, the compiler didn't warned me*
> > > *
> > > *
> > > *
> > > *
> > > *i rechecked that with int 64 and the result was correct.*
> > > *
> > > *
> > > On Sun, May 9, 2010 at 10:10 PM, Chethan B  wrote:
>
> > >> @Felipe : Thanks for the link. That's pretty much what i have done..
> > >> My code takes couple of seconds to process large data set.
>
> > >> On May 10, 12:17 am, Felipe Sodré Silva  wrote:
> > >> >http://code.google.com/codejam/contest/dashboard?c=433101#s=a&a=2
>
> > >> > On Sun, May 9, 2010 at 4:09 PM, Chethan B  wrote:
> > >> > > Hi,
>
> > >> > > My source code for Problem C in qualification round GCJ 2010 is
> > >> > > rejected for some unknown reason!
> > >> > > At the time of submission i got "submission successful" message. Now,
> > >> > > i see ' 1 wrong try' message.
> > >> > > I have downloaded a correct source code written by 'epsalon' (Rank
> > >> > > 2360) for large input data.
> > >> > > The output of epsalon's source code and that of my source code match
> > >> > > exactly for the large input data that i got during the competition.
> > >> > > So i believe that my source code must also be working fine. Please
> > >> > > help me in understanding why my code was considered to be a wrong 
> > >> > > one.
>
> > >> > > thanks,
> > >> > > Chethan B
>
> > >> > > --
> > >> > > You received this message because you are subscribed to the Google
> > >> Groups
> > >> > > "google-codejam" group.
> > >> > > To post to this group, send email to google-c...@googlegroups.com.
> > >> > > To unsubscribe from this group, send email to
> > >> > > google-code+unsubscr...@googlegroups.com > >> > >  oups.com>
> > >> 
> > >> > > .
> > >> > > For more options, visit this group at
> > >> > >http://groups.google.com/group/google-code?hl=en.
>
> > >> > --
> > >> > You received this message because you are subscribed to the Google
> > >> Groups "google-codejam" group.
> > >> > To post to this group, send email to google-c...@googlegroups.com.
> > >> > To unsubscribe from this group, send email to
> > >> google-code+unsubscr...@googlegroups.com > >>  oups.com>
> > >> .
> > >> > For more options, visit this group athttp://
> > >> groups.google.com/group/google-code?hl=en.
>
> > >> --
> > >> You received this message because you are subscribed to the Google Groups
> > >> "google-codejam" group.
> > >> To post to this group, send email to google-c...@googlegroups.com.
> > >> To unsubscribe from this group, send email to
> > >> google-code+unsubscr...@googlegroups.com > >>  oups.com>
> > >> .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/google-code?hl=en.
>
> > >  --
> > > You received this message because you are subscribed to the Google Groups
> > > "google-codejam" group.
> > > To post to this group, send email to google-c...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > google-code+unsubscr...@googlegroups.com > >  oups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-code?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "google-codejam" group.
> > To post to this group, send email to google-c...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > google

[gcj] Languages used

2010-05-09 Thread Pedro Osório
"As long as the compiler or interpreter you used for that language is
freely available and easy to download and use, you are free to use any
language you want." - from the FAQ

Doesn't this mean that Mathematica isn't allowed?

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: Solutions for practice inputs

2010-05-09 Thread benetin
Chethan,

You need to use diff to see if the output is exactly the same, except
for some trailing spaces.
Here is the one of the output line I found from yours:
Case #32: 1.46888007111242e+015
This will not be accepted, since the problem is expecting the exact
answer, as epsalon's solution does.

Ben


On May 9, 2:50 pm, Chethan B  wrote:
> hey all..
> my first time in GCJ.. it was really nice experience.. but i had
> terrible luck :(
> In problem C i first used brute force method n solved for small
> input.. it worked.. but then realized that it wont be able to process
> the large input data set..
> So changed the whole code n tested it a lot.. it was working fine.. so
> took large data and submitted the code... now it says 1 wrong try..
> but guess what?!
> I just downloaded randomly a perl source code written by 'epsalon'
> which is supposedly 'correct'... generated the output for my large
> input data set... the output matches exactly with the output i got
> from my program!!! why was my code rejected?? :( is there anybody with
> whom i can check?? is the code also checked for readability or
> something by judges before accepting it to be correct??
>
> -Cheb
>
> PS: No offense to organizers.. all in all, the competition was
> conducted well..
>
> On May 9, 1:11 pm, Luciano Morozowski Junior 
> wrote:
>
>
>
>
>
> > Or you can quickly find solutions to each problem in a specific programming
> > language here:
>
> >http://www.go-hero.net/jam/10/solutions
>
> > On Sun, May 9, 2010 at 01:47, Carlos Guia  wrote:
> > > On the scoreboard, you can select the "Download solutions" check, then you
> > > can download anyone's correct solution and generate the output you need.
>
> > > Carlos Guía
>
> > > On Sat, May 8, 2010 at 10:25 PM, Prateek Tambi 
> > > wrote:
>
> > >> You can send me the answers for Large input for problem C.
> > >> Thanks.
>
> > >> On Sun, May 9, 2010 at 7:54 AM, Prateek Tambi 
> > >> wrote:
>
> > >>> Hi
> > >>> In the qualification round yesterday I got my answer for large input set
> > >>> wrong, now I am trying with the practice set, still it is coming out to 
> > >>> be
> > >>> wrong. So to debug the problem I want to a correct output. Can any one 
> > >>> tell
> > >>> me where I can find the correct output for the practice set, or if its 
> > >>> not
> > >>> there in code jam site then can someone generate  and send me the 
> > >>> answer for
> > >>> output data set?
>
> > >>> Thanks
> > >>> Prateek Tambi
>
> > >>  --
> > >> You received this message because you are subscribed to the Google Groups
> > >> "google-codejam" group.
> > >> To post to this group, send email to google-c...@googlegroups.com.
> > >> To unsubscribe from this group, send email to
> > >> google-code+unsubscr...@googlegroups.com > >>  oups.com>
> > >> .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/google-code?hl=en.
>
> > >  --
> > > You received this message because you are subscribed to the Google Groups
> > > "google-codejam" group.
> > > To post to this group, send email to google-c...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > google-code+unsubscr...@googlegroups.com > >  oups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-code?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "google-codejam" group.
> > To post to this group, send email to google-c...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > google-code+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/google-code?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Discussion about Snapper Chain

2010-05-09 Thread Abdelrhman Abotaleb
Ok I'm want really to discuss it
because I solve it using a very simple way.
only single operation!!!  :D :D
I deduced a formula relates the number of snappers by the number of clicks
if it satisfy the formula so the lamp is ON ;otherwise the lamp is off

Indeed this method is sooo efficient for the large data set
input .

Really in the first I solve it straightforward using recursion algorithms
and  so on


The formula is ( Number of clicks)+1 divided by (2^(number of snappers)
should be an integer  number.
If anyone really interested  i may include how to deduce the formula

Good Luck


On Sun, May 9, 2010 at 9:26 AM, Varun Nischal wrote:

> Hello all,
>
> Is anyone interested in discussing the algorithm for Snapper Chain.
> What was the right approach to it?
>
> PS: I have seen some solved source code. But, would like to know about the
> approach.
>
> Thanks,
> Varun
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: problem C optimizations

2010-05-09 Thread hamzawy
Why not to solve it in O(N) (such that N is the number of the group)??

On May 9, 5:42 pm, Dario  wrote:
> I just made the large input case for problem C by storing 'next
> position' and 'cash' arrays, then just iterating over them R times.
> This seems to be O(N+R). But I've been wondering about possible
> optimizations to this. I can think of an O(NlogR) solution in which I
> nest the 'next position' and 'cash' arrays, only adding up cash/
> changing position when the correct bit of R is on (binary). I've
> pasted my code below (the algorithm described here is really just the
> solve() function and the rest is wrapping). I'd be interested in a
> comparison of different optimizations/algorithms over the problem
> space?
>
> def doProb(fname, ofname):
>     #do problem 3 given a file name
>     f = open(fname, 'r');
>     T = int(f.readline());
>     output = ['Case #' + str(i) + ': '+ \
>                 str(solve([int(j) for j in f.readline().split()],
> [int(j) for j in f.readline().split()])) + \
>                 '\n' for i in range(1,T+1)];
>     f.close();
>     of = open(ofname, 'w');
>     of.writelines(output);
>     of.close();
>
> def solve(x,g):
>     (R,k,N) = x; #unpack the input
>     (np, cash) = getParms(k,g);
>     cur = 0;
>     tot = 0;
>
>     while(R>0):
>         incl = R%2;
>         R = R//2;
>         if(incl==1):
>             tot += cash[cur];
>             cur = np[cur];
>         (np, cash) = nest(np, cash);
>     return tot;
>
> def nest(np, cash):
>     #thinking of np as a permutation, get np^2 and total cash list
>     np2 = [0]*len(np);
>     c2  = [0]*len(np);
>     for i in range(len(np)):
>         np2[i] = np[np[i]];
>         c2[i] = cash[i]+cash[np[i]];
>     return (np2, c2);
>
> def getParms(k,g):
>     N= len(g);
>
>     #special case, all passengers fit in the roller coaster:
>     if(sum(g) <= k):
>         np = [i for i in range(N)];
>         cash = [sum(g)]*N;
>         return (np, cash);
>
>     #other cases
>     np = [];
>     cash = [];
>     for i in range(N):
>         tot = g[i];
>         j = i;
>         while(tot <= k):
>             j = (j+1)%N;
>             tot += g[j];
>         tot -= g[j];
>         np.append(j);
>         cash.append(tot);
>
>     return (np, cash);
>
> --
> You received this message because you are subscribed to the Google Groups 
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread benetin
It seems to be the difference in configuration. I don't know Perl.
Maybe some Perl experts can help. Or Google about Perl 64 bit
integers.

On May 9, 5:00 pm, Chethan B  wrote:
> oops! I meant bear* with me :)
>
> On May 10, 1:57 am, Chethan B  wrote:
>
>
>
>
>
> > Thanks Benetin. Thats mighty nice of you. That piece of info is really
> > helpful.
> > Now i just have to find out why i am getting the same  "Case #32:
> > 1.46888007111242e+015" output when i try to run epsalon's code.
> > Is it related to my machine configuration or my perl version or
> > something? Bare with me if this is a stupid question.
>
> > -Chethan
>
> > On May 10, 1:47 am, benetin  wrote:
>
> > > Hi Chethan,
>
> > > I replied to the other thread, but don't know why it did not get
> > > through:
> > > - About your output, it is not exactly the same as the others. Here is
> > > one line from your submission:
> > > Case #32: 1.46888007111242e+015
> > > This will not be accepted, since the problem is expecting the exact
> > > answer, as epsalon's solution does.
> > > - About the download Carlos mentioned: Enter the contest again with
> > > your login, there will be a "My submissions" tab.
>
> > > Hope this answers the questions.
>
> > > Ben
>
> > > On May 9, 4:32 pm, Chethan B  wrote:
>
> > > > @Carlos: I would really like to do that, download my own submission
> > > > and check if i have sent the right file... but the problem is, its not
> > > > available for download.. as i mentioned earlier, i had to do lots of
> > > > optimization for large data and hence my source code for small data is
> > > > different from my source code for large data. My source code for large
> > > > data is not available for download. It simply says 1 wrong try.
> > > > Is there some other way to check the file i have submitted?? Am i
> > > > checking at wrong place??
> > > > @All : I really really appreciate all your responses and i am sorry if
> > > > this is spamming. I am just trying out to find out where i could have
> > > > gone wrong or if there is any bug in validating source codes or
> > > > outputs for large data set.
>
> > > > On May 10, 1:23 am, Carlos Guia  wrote:
>
> > > > > You can download your own submissions, and check if you did send the 
> > > > > right
> > > > > file.
>
> > > > > 64 bits are indeed needed.
>
> > > > > Carlos Guía
>
> > > > > On Sun, May 9, 2010 at 4:17 PM, Hassan .  wrote:
> > > > > > *i think you had same issue as me*
> > > > > > *
> > > > > > *
> > > > > > *i use Int32 in C# to calculate the result *
> > > > > > *i wasn't enough :)*
> > > > > > *
> > > > > > *
> > > > > > *and as i did it, the compiler didn't warned me*
> > > > > > *
> > > > > > *
> > > > > > *
> > > > > > *
> > > > > > *i rechecked that with int 64 and the result was correct.*
> > > > > > *
> > > > > > *
> > > > > > On Sun, May 9, 2010 at 10:10 PM, Chethan B  
> > > > > > wrote:
>
> > > > > >> @Felipe : Thanks for the link. That's pretty much what i have 
> > > > > >> done..
> > > > > >> My code takes couple of seconds to process large data set.
>
> > > > > >> On May 10, 12:17 am, Felipe Sodré Silva  wrote:
> > > > > >> >http://code.google.com/codejam/contest/dashboard?c=433101#s=a&a=2
>
> > > > > >> > On Sun, May 9, 2010 at 4:09 PM, Chethan B  
> > > > > >> > wrote:
> > > > > >> > > Hi,
>
> > > > > >> > > My source code for Problem C in qualification round GCJ 2010 is
> > > > > >> > > rejected for some unknown reason!
> > > > > >> > > At the time of submission i got "submission successful" 
> > > > > >> > > message. Now,
> > > > > >> > > i see ' 1 wrong try' message.
> > > > > >> > > I have downloaded a correct source code written by 'epsalon' 
> > > > > >> > > (Rank
> > > > > >> > > 2360) for large input data.
> > > > > >> > > The output of epsalon's source code and that of my source code 
> > > > > >> > > match
> > > > > >> > > exactly for the large input data that i got during the 
> > > > > >> > > competition.
> > > > > >> > > So i believe that my source code must also be working fine. 
> > > > > >> > > Please
> > > > > >> > > help me in understanding why my code was considered to be a 
> > > > > >> > > wrong one.
>
> > > > > >> > > thanks,
> > > > > >> > > Chethan B
>
> > > > > >> > > --
> > > > > >> > > You received this message because you are subscribed to the 
> > > > > >> > > Google
> > > > > >> Groups
> > > > > >> > > "google-codejam" group.
> > > > > >> > > To post to this group, send email to 
> > > > > >> > > google-c...@googlegroups.com.
> > > > > >> > > To unsubscribe from this group, send email to
> > > > > >> > > google-code+unsubscr...@googlegroups.com > > > > >> > >  oups.com>
> > > > > >> 
> > > > > >> > > .
> > > > > >> > > For more options, visit this group at
> > > > > >> > >http://groups.google.com/group/google-code?hl=en.
>
> > > > > >> > --
> > > > > >> > You received this message because you are subscribed to the 
> > > > > >> > Google
> > > > > >> Groups "google-codejam" group.
> > > > > >> > To post to this group, send em

[gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Chethan B
oops! I meant bear* with me :)

On May 10, 1:57 am, Chethan B  wrote:
> Thanks Benetin. Thats mighty nice of you. That piece of info is really
> helpful.
> Now i just have to find out why i am getting the same  "Case #32:
> 1.46888007111242e+015" output when i try to run epsalon's code.
> Is it related to my machine configuration or my perl version or
> something? Bare with me if this is a stupid question.
>
> -Chethan
>
> On May 10, 1:47 am, benetin  wrote:
>
>
>
>
>
> > Hi Chethan,
>
> > I replied to the other thread, but don't know why it did not get
> > through:
> > - About your output, it is not exactly the same as the others. Here is
> > one line from your submission:
> > Case #32: 1.46888007111242e+015
> > This will not be accepted, since the problem is expecting the exact
> > answer, as epsalon's solution does.
> > - About the download Carlos mentioned: Enter the contest again with
> > your login, there will be a "My submissions" tab.
>
> > Hope this answers the questions.
>
> > Ben
>
> > On May 9, 4:32 pm, Chethan B  wrote:
>
> > > @Carlos: I would really like to do that, download my own submission
> > > and check if i have sent the right file... but the problem is, its not
> > > available for download.. as i mentioned earlier, i had to do lots of
> > > optimization for large data and hence my source code for small data is
> > > different from my source code for large data. My source code for large
> > > data is not available for download. It simply says 1 wrong try.
> > > Is there some other way to check the file i have submitted?? Am i
> > > checking at wrong place??
> > > @All : I really really appreciate all your responses and i am sorry if
> > > this is spamming. I am just trying out to find out where i could have
> > > gone wrong or if there is any bug in validating source codes or
> > > outputs for large data set.
>
> > > On May 10, 1:23 am, Carlos Guia  wrote:
>
> > > > You can download your own submissions, and check if you did send the 
> > > > right
> > > > file.
>
> > > > 64 bits are indeed needed.
>
> > > > Carlos Guía
>
> > > > On Sun, May 9, 2010 at 4:17 PM, Hassan .  wrote:
> > > > > *i think you had same issue as me*
> > > > > *
> > > > > *
> > > > > *i use Int32 in C# to calculate the result *
> > > > > *i wasn't enough :)*
> > > > > *
> > > > > *
> > > > > *and as i did it, the compiler didn't warned me*
> > > > > *
> > > > > *
> > > > > *
> > > > > *
> > > > > *i rechecked that with int 64 and the result was correct.*
> > > > > *
> > > > > *
> > > > > On Sun, May 9, 2010 at 10:10 PM, Chethan B  
> > > > > wrote:
>
> > > > >> @Felipe : Thanks for the link. That's pretty much what i have done..
> > > > >> My code takes couple of seconds to process large data set.
>
> > > > >> On May 10, 12:17 am, Felipe Sodré Silva  wrote:
> > > > >> >http://code.google.com/codejam/contest/dashboard?c=433101#s=a&a=2
>
> > > > >> > On Sun, May 9, 2010 at 4:09 PM, Chethan B  
> > > > >> > wrote:
> > > > >> > > Hi,
>
> > > > >> > > My source code for Problem C in qualification round GCJ 2010 is
> > > > >> > > rejected for some unknown reason!
> > > > >> > > At the time of submission i got "submission successful" message. 
> > > > >> > > Now,
> > > > >> > > i see ' 1 wrong try' message.
> > > > >> > > I have downloaded a correct source code written by 'epsalon' 
> > > > >> > > (Rank
> > > > >> > > 2360) for large input data.
> > > > >> > > The output of epsalon's source code and that of my source code 
> > > > >> > > match
> > > > >> > > exactly for the large input data that i got during the 
> > > > >> > > competition.
> > > > >> > > So i believe that my source code must also be working fine. 
> > > > >> > > Please
> > > > >> > > help me in understanding why my code was considered to be a 
> > > > >> > > wrong one.
>
> > > > >> > > thanks,
> > > > >> > > Chethan B
>
> > > > >> > > --
> > > > >> > > You received this message because you are subscribed to the 
> > > > >> > > Google
> > > > >> Groups
> > > > >> > > "google-codejam" group.
> > > > >> > > To post to this group, send email to 
> > > > >> > > google-c...@googlegroups.com.
> > > > >> > > To unsubscribe from this group, send email to
> > > > >> > > google-code+unsubscr...@googlegroups.com > > > >> > >  oups.com>
> > > > >> 
> > > > >> > > .
> > > > >> > > For more options, visit this group at
> > > > >> > >http://groups.google.com/group/google-code?hl=en.
>
> > > > >> > --
> > > > >> > You received this message because you are subscribed to the Google
> > > > >> Groups "google-codejam" group.
> > > > >> > To post to this group, send email to google-c...@googlegroups.com.
> > > > >> > To unsubscribe from this group, send email to
> > > > >> google-code+unsubscr...@googlegroups.com > > > >>  oups.com>
> > > > >> .
> > > > >> > For more options, visit this group athttp://
> > > > >> groups.google.com/group/google-code?hl=en.
>
> > > > >> --
> > > > >> You received this message because you are subscribed to the Google 
> > > > >> Groups
> > > > 

[gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Chethan B
Thanks Benetin. Thats mighty nice of you. That piece of info is really
helpful.
Now i just have to find out why i am getting the same  "Case #32:
1.46888007111242e+015" output when i try to run epsalon's code.
Is it related to my machine configuration or my perl version or
something? Bare with me if this is a stupid question.

-Chethan

On May 10, 1:47 am, benetin  wrote:
> Hi Chethan,
>
> I replied to the other thread, but don't know why it did not get
> through:
> - About your output, it is not exactly the same as the others. Here is
> one line from your submission:
> Case #32: 1.46888007111242e+015
> This will not be accepted, since the problem is expecting the exact
> answer, as epsalon's solution does.
> - About the download Carlos mentioned: Enter the contest again with
> your login, there will be a "My submissions" tab.
>
> Hope this answers the questions.
>
> Ben
>
> On May 9, 4:32 pm, Chethan B  wrote:
>
>
>
>
>
> > @Carlos: I would really like to do that, download my own submission
> > and check if i have sent the right file... but the problem is, its not
> > available for download.. as i mentioned earlier, i had to do lots of
> > optimization for large data and hence my source code for small data is
> > different from my source code for large data. My source code for large
> > data is not available for download. It simply says 1 wrong try.
> > Is there some other way to check the file i have submitted?? Am i
> > checking at wrong place??
> > @All : I really really appreciate all your responses and i am sorry if
> > this is spamming. I am just trying out to find out where i could have
> > gone wrong or if there is any bug in validating source codes or
> > outputs for large data set.
>
> > On May 10, 1:23 am, Carlos Guia  wrote:
>
> > > You can download your own submissions, and check if you did send the right
> > > file.
>
> > > 64 bits are indeed needed.
>
> > > Carlos Guía
>
> > > On Sun, May 9, 2010 at 4:17 PM, Hassan .  wrote:
> > > > *i think you had same issue as me*
> > > > *
> > > > *
> > > > *i use Int32 in C# to calculate the result *
> > > > *i wasn't enough :)*
> > > > *
> > > > *
> > > > *and as i did it, the compiler didn't warned me*
> > > > *
> > > > *
> > > > *
> > > > *
> > > > *i rechecked that with int 64 and the result was correct.*
> > > > *
> > > > *
> > > > On Sun, May 9, 2010 at 10:10 PM, Chethan B  wrote:
>
> > > >> @Felipe : Thanks for the link. That's pretty much what i have done..
> > > >> My code takes couple of seconds to process large data set.
>
> > > >> On May 10, 12:17 am, Felipe Sodré Silva  wrote:
> > > >> >http://code.google.com/codejam/contest/dashboard?c=433101#s=a&a=2
>
> > > >> > On Sun, May 9, 2010 at 4:09 PM, Chethan B  
> > > >> > wrote:
> > > >> > > Hi,
>
> > > >> > > My source code for Problem C in qualification round GCJ 2010 is
> > > >> > > rejected for some unknown reason!
> > > >> > > At the time of submission i got "submission successful" message. 
> > > >> > > Now,
> > > >> > > i see ' 1 wrong try' message.
> > > >> > > I have downloaded a correct source code written by 'epsalon' (Rank
> > > >> > > 2360) for large input data.
> > > >> > > The output of epsalon's source code and that of my source code 
> > > >> > > match
> > > >> > > exactly for the large input data that i got during the competition.
> > > >> > > So i believe that my source code must also be working fine. Please
> > > >> > > help me in understanding why my code was considered to be a wrong 
> > > >> > > one.
>
> > > >> > > thanks,
> > > >> > > Chethan B
>
> > > >> > > --
> > > >> > > You received this message because you are subscribed to the Google
> > > >> Groups
> > > >> > > "google-codejam" group.
> > > >> > > To post to this group, send email to google-c...@googlegroups.com.
> > > >> > > To unsubscribe from this group, send email to
> > > >> > > google-code+unsubscr...@googlegroups.com > > >> > >  oups.com>
> > > >> 
> > > >> > > .
> > > >> > > For more options, visit this group at
> > > >> > >http://groups.google.com/group/google-code?hl=en.
>
> > > >> > --
> > > >> > You received this message because you are subscribed to the Google
> > > >> Groups "google-codejam" group.
> > > >> > To post to this group, send email to google-c...@googlegroups.com.
> > > >> > To unsubscribe from this group, send email to
> > > >> google-code+unsubscr...@googlegroups.com > > >>  oups.com>
> > > >> .
> > > >> > For more options, visit this group athttp://
> > > >> groups.google.com/group/google-code?hl=en.
>
> > > >> --
> > > >> You received this message because you are subscribed to the Google 
> > > >> Groups
> > > >> "google-codejam" group.
> > > >> To post to this group, send email to google-c...@googlegroups.com.
> > > >> To unsubscribe from this group, send email to
> > > >> google-code+unsubscr...@googlegroups.com > > >>  oups.com>
> > > >> .
> > > >> For more options, visit this group at
> > > >>http://groups.google.com/group/google-code?hl=en.
>
> > > >  --
> > > > You received thi

[gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Chethan B
Thanks very much Hassan. I am also trying at that same link. The
source code for Problem C, large data is not available in my case. It
simply says, "1 wrong try".



On May 10, 1:39 am, "Hassan ."  wrote:
> *check this link*
> *http://code.google.com/codejam/contest/scoreboard?c=433101#st=nbr&vf=1
> *
> *you will find their there
> *
>
>
>
>
>
> On Sun, May 9, 2010 at 10:32 PM, Chethan B  wrote:
> > @Carlos: I would really like to do that, download my own submission
> > and check if i have sent the right file... but the problem is, its not
> > available for download.. as i mentioned earlier, i had to do lots of
> > optimization for large data and hence my source code for small data is
> > different from my source code for large data. My source code for large
> > data is not available for download. It simply says 1 wrong try.
> > Is there some other way to check the file i have submitted?? Am i
> > checking at wrong place??
> > @All : I really really appreciate all your responses and i am sorry if
> > this is spamming. I am just trying out to find out where i could have
> > gone wrong or if there is any bug in validating source codes or
> > outputs for large data set.
>
> > On May 10, 1:23 am, Carlos Guia  wrote:
> > > You can download your own submissions, and check if you did send the
> > right
> > > file.
>
> > > 64 bits are indeed needed.
>
> > > Carlos Guía
>
> > > On Sun, May 9, 2010 at 4:17 PM, Hassan .  wrote:
> > > > *i think you had same issue as me*
> > > > *
> > > > *
> > > > *i use Int32 in C# to calculate the result *
> > > > *i wasn't enough :)*
> > > > *
> > > > *
> > > > *and as i did it, the compiler didn't warned me*
> > > > *
> > > > *
> > > > *
> > > > *
> > > > *i rechecked that with int 64 and the result was correct.*
> > > > *
> > > > *
> > > > On Sun, May 9, 2010 at 10:10 PM, Chethan B 
> > wrote:
>
> > > >> @Felipe : Thanks for the link. That's pretty much what i have done..
> > > >> My code takes couple of seconds to process large data set.
>
> > > >> On May 10, 12:17 am, Felipe Sodré Silva  wrote:
> > > >> >http://code.google.com/codejam/contest/dashboard?c=433101#s=a&a=2
>
> > > >> > On Sun, May 9, 2010 at 4:09 PM, Chethan B 
> > wrote:
> > > >> > > Hi,
>
> > > >> > > My source code for Problem C in qualification round GCJ 2010 is
> > > >> > > rejected for some unknown reason!
> > > >> > > At the time of submission i got "submission successful" message.
> > Now,
> > > >> > > i see ' 1 wrong try' message.
> > > >> > > I have downloaded a correct source code written by 'epsalon' (Rank
> > > >> > > 2360) for large input data.
> > > >> > > The output of epsalon's source code and that of my source code
> > match
> > > >> > > exactly for the large input data that i got during the
> > competition.
> > > >> > > So i believe that my source code must also be working fine. Please
> > > >> > > help me in understanding why my code was considered to be a wrong
> > one.
>
> > > >> > > thanks,
> > > >> > > Chethan B
>
> > > >> > > --
> > > >> > > You received this message because you are subscribed to the Google
> > > >> Groups
> > > >> > > "google-codejam" group.
> > > >> > > To post to this group, send email to google-code@googlegroups.com
> > .
> > > >> > > To unsubscribe from this group, send email to
> > > >> > > google-code+unsubscr...@googlegroups.com > > >> > >  oups.com>
> > 
> > > >> 
> > > >> > > .
> > > >> > > For more options, visit this group at
> > > >> > >http://groups.google.com/group/google-code?hl=en.
>
> > > >> > --
> > > >> > You received this message because you are subscribed to the Google
> > > >> Groups "google-codejam" group.
> > > >> > To post to this group, send email to google-c...@googlegroups.com.
> > > >> > To unsubscribe from this group, send email to
> > > >> google-code+unsubscr...@googlegroups.com > > >>  oups.com>
> > 
> > > >> .
> > > >> > For more options, visit this group athttp://
> > > >> groups.google.com/group/google-code?hl=en.
>
> > > >> --
> > > >> You received this message because you are subscribed to the Google
> > Groups
> > > >> "google-codejam" group.
> > > >> To post to this group, send email to google-c...@googlegroups.com.
> > > >> To unsubscribe from this group, send email to
> > > >> google-code+unsubscr...@googlegroups.com > > >>  oups.com>
> > 
> > > >> .
> > > >> For more options, visit this group at
> > > >>http://groups.google.com/group/google-code?hl=en.
>
> > > >  --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "google-codejam" group.
> > > > To post to this group, send email to google-c...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > google-code+unsubscr...@googlegroups.com > > >  oups.com>
> > 
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/google-code?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > "google-codejam" group.
> > > To post to this gr

[gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread benetin
Hi Chethan,

I replied to the other thread, but don't know why it did not get
through:
- About your output, it is not exactly the same as the others. Here is
one line from your submission:
Case #32: 1.46888007111242e+015
This will not be accepted, since the problem is expecting the exact
answer, as epsalon's solution does.
- About the download Carlos mentioned: Enter the contest again with
your login, there will be a "My submissions" tab.

Hope this answers the questions.

Ben

On May 9, 4:32 pm, Chethan B  wrote:
> @Carlos: I would really like to do that, download my own submission
> and check if i have sent the right file... but the problem is, its not
> available for download.. as i mentioned earlier, i had to do lots of
> optimization for large data and hence my source code for small data is
> different from my source code for large data. My source code for large
> data is not available for download. It simply says 1 wrong try.
> Is there some other way to check the file i have submitted?? Am i
> checking at wrong place??
> @All : I really really appreciate all your responses and i am sorry if
> this is spamming. I am just trying out to find out where i could have
> gone wrong or if there is any bug in validating source codes or
> outputs for large data set.
>
> On May 10, 1:23 am, Carlos Guia  wrote:
>
>
>
>
>
> > You can download your own submissions, and check if you did send the right
> > file.
>
> > 64 bits are indeed needed.
>
> > Carlos Guía
>
> > On Sun, May 9, 2010 at 4:17 PM, Hassan .  wrote:
> > > *i think you had same issue as me*
> > > *
> > > *
> > > *i use Int32 in C# to calculate the result *
> > > *i wasn't enough :)*
> > > *
> > > *
> > > *and as i did it, the compiler didn't warned me*
> > > *
> > > *
> > > *
> > > *
> > > *i rechecked that with int 64 and the result was correct.*
> > > *
> > > *
> > > On Sun, May 9, 2010 at 10:10 PM, Chethan B  wrote:
>
> > >> @Felipe : Thanks for the link. That's pretty much what i have done..
> > >> My code takes couple of seconds to process large data set.
>
> > >> On May 10, 12:17 am, Felipe Sodré Silva  wrote:
> > >> >http://code.google.com/codejam/contest/dashboard?c=433101#s=a&a=2
>
> > >> > On Sun, May 9, 2010 at 4:09 PM, Chethan B  wrote:
> > >> > > Hi,
>
> > >> > > My source code for Problem C in qualification round GCJ 2010 is
> > >> > > rejected for some unknown reason!
> > >> > > At the time of submission i got "submission successful" message. Now,
> > >> > > i see ' 1 wrong try' message.
> > >> > > I have downloaded a correct source code written by 'epsalon' (Rank
> > >> > > 2360) for large input data.
> > >> > > The output of epsalon's source code and that of my source code match
> > >> > > exactly for the large input data that i got during the competition.
> > >> > > So i believe that my source code must also be working fine. Please
> > >> > > help me in understanding why my code was considered to be a wrong 
> > >> > > one.
>
> > >> > > thanks,
> > >> > > Chethan B
>
> > >> > > --
> > >> > > You received this message because you are subscribed to the Google
> > >> Groups
> > >> > > "google-codejam" group.
> > >> > > To post to this group, send email to google-c...@googlegroups.com.
> > >> > > To unsubscribe from this group, send email to
> > >> > > google-code+unsubscr...@googlegroups.com > >> > >  oups.com>
> > >> 
> > >> > > .
> > >> > > For more options, visit this group at
> > >> > >http://groups.google.com/group/google-code?hl=en.
>
> > >> > --
> > >> > You received this message because you are subscribed to the Google
> > >> Groups "google-codejam" group.
> > >> > To post to this group, send email to google-c...@googlegroups.com.
> > >> > To unsubscribe from this group, send email to
> > >> google-code+unsubscr...@googlegroups.com > >>  oups.com>
> > >> .
> > >> > For more options, visit this group athttp://
> > >> groups.google.com/group/google-code?hl=en.
>
> > >> --
> > >> You received this message because you are subscribed to the Google Groups
> > >> "google-codejam" group.
> > >> To post to this group, send email to google-c...@googlegroups.com.
> > >> To unsubscribe from this group, send email to
> > >> google-code+unsubscr...@googlegroups.com > >>  oups.com>
> > >> .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/google-code?hl=en.
>
> > >  --
> > > You received this message because you are subscribed to the Google Groups
> > > "google-codejam" group.
> > > To post to this group, send email to google-c...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > google-code+unsubscr...@googlegroups.com > >  oups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-code?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "google-codejam" group.
> > To post to this group, send email to google-c...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > google-

[gcj] Re: Reg : Optimazation in Theme Park

2010-05-09 Thread ijacek
You can check my solution, it's O(N).

First I precalculate the group sizes for every starting group.
It gives two arrays
 - cost[N] - how many fits to the run
 - next[N] - which group will be at the start in next run
This can be done incrementally and it takes max 2N time.

With those arrays one run is O(1) and the loop can
be optimized to O(N) as described in the analysis. There you
have O(N) in total.


On May 9, 8:21 pm, "coder.ankur"  wrote:
> Can anybody explain how the problem can be optimized to O(N) as
> mentioned in the the last of contest analysis for this problem.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Hassan .
*check this link*
*http://code.google.com/codejam/contest/scoreboard?c=433101#st=nbr&vf=1
*
*you will find their there
*
On Sun, May 9, 2010 at 10:32 PM, Chethan B  wrote:

> @Carlos: I would really like to do that, download my own submission
> and check if i have sent the right file... but the problem is, its not
> available for download.. as i mentioned earlier, i had to do lots of
> optimization for large data and hence my source code for small data is
> different from my source code for large data. My source code for large
> data is not available for download. It simply says 1 wrong try.
> Is there some other way to check the file i have submitted?? Am i
> checking at wrong place??
> @All : I really really appreciate all your responses and i am sorry if
> this is spamming. I am just trying out to find out where i could have
> gone wrong or if there is any bug in validating source codes or
> outputs for large data set.
>
>
>
> On May 10, 1:23 am, Carlos Guia  wrote:
> > You can download your own submissions, and check if you did send the
> right
> > file.
> >
> > 64 bits are indeed needed.
> >
> > Carlos Guía
> >
> >
> >
> >
> >
> > On Sun, May 9, 2010 at 4:17 PM, Hassan .  wrote:
> > > *i think you had same issue as me*
> > > *
> > > *
> > > *i use Int32 in C# to calculate the result *
> > > *i wasn't enough :)*
> > > *
> > > *
> > > *and as i did it, the compiler didn't warned me*
> > > *
> > > *
> > > *
> > > *
> > > *i rechecked that with int 64 and the result was correct.*
> > > *
> > > *
> > > On Sun, May 9, 2010 at 10:10 PM, Chethan B 
> wrote:
> >
> > >> @Felipe : Thanks for the link. That's pretty much what i have done..
> > >> My code takes couple of seconds to process large data set.
> >
> > >> On May 10, 12:17 am, Felipe Sodré Silva  wrote:
> > >> >http://code.google.com/codejam/contest/dashboard?c=433101#s=a&a=2
> >
> > >> > On Sun, May 9, 2010 at 4:09 PM, Chethan B 
> wrote:
> > >> > > Hi,
> >
> > >> > > My source code for Problem C in qualification round GCJ 2010 is
> > >> > > rejected for some unknown reason!
> > >> > > At the time of submission i got "submission successful" message.
> Now,
> > >> > > i see ' 1 wrong try' message.
> > >> > > I have downloaded a correct source code written by 'epsalon' (Rank
> > >> > > 2360) for large input data.
> > >> > > The output of epsalon's source code and that of my source code
> match
> > >> > > exactly for the large input data that i got during the
> competition.
> > >> > > So i believe that my source code must also be working fine. Please
> > >> > > help me in understanding why my code was considered to be a wrong
> one.
> >
> > >> > > thanks,
> > >> > > Chethan B
> >
> > >> > > --
> > >> > > You received this message because you are subscribed to the Google
> > >> Groups
> > >> > > "google-codejam" group.
> > >> > > To post to this group, send email to google-code@googlegroups.com
> .
> > >> > > To unsubscribe from this group, send email to
> > >> > > google-code+unsubscr...@googlegroups.com
> 
> > >> 
> > >> > > .
> > >> > > For more options, visit this group at
> > >> > >http://groups.google.com/group/google-code?hl=en.
> >
> > >> > --
> > >> > You received this message because you are subscribed to the Google
> > >> Groups "google-codejam" group.
> > >> > To post to this group, send email to google-c...@googlegroups.com.
> > >> > To unsubscribe from this group, send email to
> > >> google-code+unsubscr...@googlegroups.com
> 
> > >> .
> > >> > For more options, visit this group athttp://
> > >> groups.google.com/group/google-code?hl=en.
> >
> > >> --
> > >> You received this message because you are subscribed to the Google
> Groups
> > >> "google-codejam" group.
> > >> To post to this group, send email to google-c...@googlegroups.com.
> > >> To unsubscribe from this group, send email to
> > >> google-code+unsubscr...@googlegroups.com
> 
> > >> .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/google-code?hl=en.
> >
> > >  --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "google-codejam" group.
> > > To post to this group, send email to google-c...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > google-code+unsubscr...@googlegroups.com
> 
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-code?hl=en.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> > To post to this group, send email to google-c...@googlegroups.com.
> > To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> > For more options, visit this group athttp://
> groups.google.com/group/google-code?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> goo

[gcj] Re: Reg : Optimazation in Theme Park

2010-05-09 Thread marcog
On May 9, 9:57 pm, Brian Watkins  wrote:
> I can see O(N log r), but O(N) seems pretty tough.

http://pastebin.com/z8h82e99 is a Python implementation of the O(N)
algorithm. The difference is in the jump table calculation: instead of
calculating each entry independently, use a moving pointer that runs
ahead.

Marco

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Chethan B
@Carlos: I would really like to do that, download my own submission
and check if i have sent the right file... but the problem is, its not
available for download.. as i mentioned earlier, i had to do lots of
optimization for large data and hence my source code for small data is
different from my source code for large data. My source code for large
data is not available for download. It simply says 1 wrong try.
Is there some other way to check the file i have submitted?? Am i
checking at wrong place??
@All : I really really appreciate all your responses and i am sorry if
this is spamming. I am just trying out to find out where i could have
gone wrong or if there is any bug in validating source codes or
outputs for large data set.



On May 10, 1:23 am, Carlos Guia  wrote:
> You can download your own submissions, and check if you did send the right
> file.
>
> 64 bits are indeed needed.
>
> Carlos Guía
>
>
>
>
>
> On Sun, May 9, 2010 at 4:17 PM, Hassan .  wrote:
> > *i think you had same issue as me*
> > *
> > *
> > *i use Int32 in C# to calculate the result *
> > *i wasn't enough :)*
> > *
> > *
> > *and as i did it, the compiler didn't warned me*
> > *
> > *
> > *
> > *
> > *i rechecked that with int 64 and the result was correct.*
> > *
> > *
> > On Sun, May 9, 2010 at 10:10 PM, Chethan B  wrote:
>
> >> @Felipe : Thanks for the link. That's pretty much what i have done..
> >> My code takes couple of seconds to process large data set.
>
> >> On May 10, 12:17 am, Felipe Sodré Silva  wrote:
> >> >http://code.google.com/codejam/contest/dashboard?c=433101#s=a&a=2
>
> >> > On Sun, May 9, 2010 at 4:09 PM, Chethan B  wrote:
> >> > > Hi,
>
> >> > > My source code for Problem C in qualification round GCJ 2010 is
> >> > > rejected for some unknown reason!
> >> > > At the time of submission i got "submission successful" message. Now,
> >> > > i see ' 1 wrong try' message.
> >> > > I have downloaded a correct source code written by 'epsalon' (Rank
> >> > > 2360) for large input data.
> >> > > The output of epsalon's source code and that of my source code match
> >> > > exactly for the large input data that i got during the competition.
> >> > > So i believe that my source code must also be working fine. Please
> >> > > help me in understanding why my code was considered to be a wrong one.
>
> >> > > thanks,
> >> > > Chethan B
>
> >> > > --
> >> > > You received this message because you are subscribed to the Google
> >> Groups
> >> > > "google-codejam" group.
> >> > > To post to this group, send email to google-c...@googlegroups.com.
> >> > > To unsubscribe from this group, send email to
> >> > > google-code+unsubscr...@googlegroups.com >> > >  oups.com>
> >> 
> >> > > .
> >> > > For more options, visit this group at
> >> > >http://groups.google.com/group/google-code?hl=en.
>
> >> > --
> >> > You received this message because you are subscribed to the Google
> >> Groups "google-codejam" group.
> >> > To post to this group, send email to google-c...@googlegroups.com.
> >> > To unsubscribe from this group, send email to
> >> google-code+unsubscr...@googlegroups.com >>  oups.com>
> >> .
> >> > For more options, visit this group athttp://
> >> groups.google.com/group/google-code?hl=en.
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "google-codejam" group.
> >> To post to this group, send email to google-c...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> google-code+unsubscr...@googlegroups.com >>  oups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/google-code?hl=en.
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "google-codejam" group.
> > To post to this group, send email to google-c...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-code+unsubscr...@googlegroups.com > oups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-code?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Carlos Guia
You can download your own submissions, and check if you did send the right
file.

64 bits are indeed needed.

Carlos Guía


On Sun, May 9, 2010 at 4:17 PM, Hassan .  wrote:

> *i think you had same issue as me*
> *
> *
> *i use Int32 in C# to calculate the result *
> *i wasn't enough :)*
> *
> *
> *and as i did it, the compiler didn't warned me*
> *
> *
> *
> *
> *i rechecked that with int 64 and the result was correct.*
> *
> *
> On Sun, May 9, 2010 at 10:10 PM, Chethan B  wrote:
>
>> @Felipe : Thanks for the link. That's pretty much what i have done..
>> My code takes couple of seconds to process large data set.
>>
>> On May 10, 12:17 am, Felipe Sodré Silva  wrote:
>> > http://code.google.com/codejam/contest/dashboard?c=433101#s=a&a=2
>> >
>> >
>> >
>> >
>> >
>> > On Sun, May 9, 2010 at 4:09 PM, Chethan B  wrote:
>> > > Hi,
>> >
>> > > My source code for Problem C in qualification round GCJ 2010 is
>> > > rejected for some unknown reason!
>> > > At the time of submission i got "submission successful" message. Now,
>> > > i see ' 1 wrong try' message.
>> > > I have downloaded a correct source code written by 'epsalon' (Rank
>> > > 2360) for large input data.
>> > > The output of epsalon's source code and that of my source code match
>> > > exactly for the large input data that i got during the competition.
>> > > So i believe that my source code must also be working fine. Please
>> > > help me in understanding why my code was considered to be a wrong one.
>> >
>> > > thanks,
>> > > Chethan B
>> >
>> > > --
>> > > You received this message because you are subscribed to the Google
>> Groups
>> > > "google-codejam" group.
>> > > To post to this group, send email to google-c...@googlegroups.com.
>> > > To unsubscribe from this group, send email to
>> > > google-code+unsubscr...@googlegroups.com
>> 
>> > > .
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/google-code?hl=en.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups "google-codejam" group.
>> > To post to this group, send email to google-c...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com
>> .
>> > For more options, visit this group athttp://
>> groups.google.com/group/google-code?hl=en.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to google-c...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Chethan B
@Hassan : Hmmm.. I used perl.. I dont think perl has any such
restrictions in size of variables. or is there any??  The point is my
output exactly matches with the supposedly 'correct' output..


On May 10, 1:17 am, "Hassan ."  wrote:
> *i think you had same issue as me*
> *
> *
> *i use Int32 in C# to calculate the result *
> *i wasn't enough :)*
> *
> *
> *and as i did it, the compiler didn't warned me*
> *
> *
> *
> *
> *i rechecked that with int 64 and the result was correct.*
> *
> *
>
>
>
>
>
> On Sun, May 9, 2010 at 10:10 PM, Chethan B  wrote:
> > @Felipe : Thanks for the link. That's pretty much what i have done..
> > My code takes couple of seconds to process large data set.
>
> > On May 10, 12:17 am, Felipe Sodré Silva  wrote:
> > >http://code.google.com/codejam/contest/dashboard?c=433101#s=a&a=2
>
> > > On Sun, May 9, 2010 at 4:09 PM, Chethan B  wrote:
> > > > Hi,
>
> > > > My source code for Problem C in qualification round GCJ 2010 is
> > > > rejected for some unknown reason!
> > > > At the time of submission i got "submission successful" message. Now,
> > > > i see ' 1 wrong try' message.
> > > > I have downloaded a correct source code written by 'epsalon' (Rank
> > > > 2360) for large input data.
> > > > The output of epsalon's source code and that of my source code match
> > > > exactly for the large input data that i got during the competition.
> > > > So i believe that my source code must also be working fine. Please
> > > > help me in understanding why my code was considered to be a wrong one.
>
> > > > thanks,
> > > > Chethan B
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "google-codejam" group.
> > > > To post to this group, send email to google-c...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > google-code+unsubscr...@googlegroups.com > > >  oups.com>
> > 
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/google-code?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > "google-codejam" group.
> > > To post to this group, send email to google-c...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > google-code+unsubscr...@googlegroups.com > oups.com>
> > .
> > > For more options, visit this group athttp://
> > groups.google.com/group/google-code?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "google-codejam" group.
> > To post to this group, send email to google-c...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-code+unsubscr...@googlegroups.com > oups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-code?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Hassan .
*i think you had same issue as me*
*
*
*i use Int32 in C# to calculate the result *
*i wasn't enough :)*
*
*
*and as i did it, the compiler didn't warned me*
*
*
*
*
*i rechecked that with int 64 and the result was correct.*
*
*
On Sun, May 9, 2010 at 10:10 PM, Chethan B  wrote:

> @Felipe : Thanks for the link. That's pretty much what i have done..
> My code takes couple of seconds to process large data set.
>
> On May 10, 12:17 am, Felipe Sodré Silva  wrote:
> > http://code.google.com/codejam/contest/dashboard?c=433101#s=a&a=2
> >
> >
> >
> >
> >
> > On Sun, May 9, 2010 at 4:09 PM, Chethan B  wrote:
> > > Hi,
> >
> > > My source code for Problem C in qualification round GCJ 2010 is
> > > rejected for some unknown reason!
> > > At the time of submission i got "submission successful" message. Now,
> > > i see ' 1 wrong try' message.
> > > I have downloaded a correct source code written by 'epsalon' (Rank
> > > 2360) for large input data.
> > > The output of epsalon's source code and that of my source code match
> > > exactly for the large input data that i got during the competition.
> > > So i believe that my source code must also be working fine. Please
> > > help me in understanding why my code was considered to be a wrong one.
> >
> > > thanks,
> > > Chethan B
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "google-codejam" group.
> > > To post to this group, send email to google-c...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > google-code+unsubscr...@googlegroups.com
> 
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-code?hl=en.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> > To post to this group, send email to google-c...@googlegroups.com.
> > To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> > For more options, visit this group athttp://
> groups.google.com/group/google-code?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Chethan B
@Luke Pebody: Yea.. that is one possibility... but i remember clearly,
submitting the correct files..

On May 10, 12:59 am, Luke Pebody  wrote:
> Maybe you submitted the small output data by mistake?
>
>
>
>
>
> On Sun, May 9, 2010 at 8:09 PM, Chethan B  wrote:
> > Hi,
>
> > My source code for Problem C in qualification round GCJ 2010 is
> > rejected for some unknown reason!
> > At the time of submission i got "submission successful" message. Now,
> > i see ' 1 wrong try' message.
> > I have downloaded a correct source code written by 'epsalon' (Rank
> > 2360) for large input data.
> > The output of epsalon's source code and that of my source code match
> > exactly for the large input data that i got during the competition.
> > So i believe that my source code must also be working fine. Please
> > help me in understanding why my code was considered to be a wrong one.
>
> > thanks,
> > Chethan B
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "google-codejam" group.
> > To post to this group, send email to google-c...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > google-code+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/google-code?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Discussion about Snapper Chain

2010-05-09 Thread Jacob Lyles
In other words, you are counting by one in binary. When you count to
2^N - 1, it is on.

On Sun, May 9, 2010 at 1:00 PM, Abizern  wrote:
> Here's a simple analysis:
> Imagine 3 lights plugged into a wall at the right and the state is 1 if it
> is on, and 0 if it is off.
> so for each 'click' the states will be:
> 0        0  0  0
> 1        0  0  1
> 2        0  1  0
> 3        0  1  1
> 4        1  0  0
> 5        1  0  1
> 6        1  0  1
> 7        1  1  1
> 8        0  0  0
> 9        0  0  1
> 10      0  1  1
> And so on. You can see a pattern here: that for the light to be on, all the
> switches need to be set to 1. And as a binary number -> so:
> for 1 snappers the number is 1 which is 1 in decimal
> for 2 snappers the number is 1 1 which is 3 in decimal
> for 3 snappers the number is 1 1 1 which is 7 in decimal.
> So can you see the pattern. for N snappers, all the digits in binary are 1
> for the number (2^N)-1. As this wraps around we bring in modulus which is
> where we see that k % 2^N must be (2^N)-1.
>
>
>
> On 9 May 2010 20:06, Douglas Drumond  wrote:
>>
>> > Is anyone interested in discussing the algorithm for Snapper Chain.
>> > What was the right approach to it?
>> >
>> > PS: I have seen some solved source code. But, would like to know about
>> > the
>> > approach.
>>
>>
>> You should check contest analysis:
>> http://code.google.com/codejam/contest/dashboard?c=433101#s=a
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to google-c...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>
>
>
> --
> Abizer
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Chethan B
@Felipe : Thanks for the link. That's pretty much what i have done..
My code takes couple of seconds to process large data set.

On May 10, 12:17 am, Felipe Sodré Silva  wrote:
> http://code.google.com/codejam/contest/dashboard?c=433101#s=a&a=2
>
>
>
>
>
> On Sun, May 9, 2010 at 4:09 PM, Chethan B  wrote:
> > Hi,
>
> > My source code for Problem C in qualification round GCJ 2010 is
> > rejected for some unknown reason!
> > At the time of submission i got "submission successful" message. Now,
> > i see ' 1 wrong try' message.
> > I have downloaded a correct source code written by 'epsalon' (Rank
> > 2360) for large input data.
> > The output of epsalon's source code and that of my source code match
> > exactly for the large input data that i got during the competition.
> > So i believe that my source code must also be working fine. Please
> > help me in understanding why my code was considered to be a wrong one.
>
> > thanks,
> > Chethan B
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "google-codejam" group.
> > To post to this group, send email to google-c...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-code+unsubscr...@googlegroups.com > oups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-code?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Discussion about Snapper Chain

2010-05-09 Thread Abizern
Here's a simple analysis:

Imagine 3 lights plugged into a wall at the right and the state is 1 if it
is on, and 0 if it is off.

so for each 'click' the states will be:

00  0  0
10  0  1
20  1  0
30  1  1
41  0  0
51  0  1
61  0  1
71  1  1
80  0  0
90  0  1
10  0  1  1

And so on. You can see a pattern here: that for the light to be on, all the
switches need to be set to 1. And as a binary number -> so:

for 1 snappers the number is 1 which is 1 in decimal
for 2 snappers the number is 1 1 which is 3 in decimal
for 3 snappers the number is 1 1 1 which is 7 in decimal.

So can you see the pattern. for N snappers, all the digits in binary are 1
for the number (2^N)-1. As this wraps around we bring in modulus which is
where we see that k % 2^N must be (2^N)-1.




On 9 May 2010 20:06, Douglas Drumond  wrote:

> > Is anyone interested in discussing the algorithm for Snapper Chain.
> > What was the right approach to it?
> >
> > PS: I have seen some solved source code. But, would like to know about
> the
> > approach.
>
>
> You should check contest analysis:
> http://code.google.com/codejam/contest/dashboard?c=433101#s=a
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>
>


-- 
Abizer

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Luke Pebody
Maybe you submitted the small output data by mistake?

On Sun, May 9, 2010 at 8:09 PM, Chethan B  wrote:
> Hi,
>
> My source code for Problem C in qualification round GCJ 2010 is
> rejected for some unknown reason!
> At the time of submission i got "submission successful" message. Now,
> i see ' 1 wrong try' message.
> I have downloaded a correct source code written by 'epsalon' (Rank
> 2360) for large input data.
> The output of epsalon's source code and that of my source code match
> exactly for the large input data that i got during the competition.
> So i believe that my source code must also be working fine. Please
> help me in understanding why my code was considered to be a wrong one.
>
>
> thanks,
> Chethan B
>
> --
> You received this message because you are subscribed to the Google Groups 
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/google-code?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: Reg : Optimazation in Theme Park

2010-05-09 Thread Brian Watkins
I can see O(N log r), but O(N) seems pretty tough.

On May 9, 12:21 pm, "coder.ankur"  wrote:
> Can anybody explain how the problem can be optimized to O(N) as
> mentioned in the the last of contest analysis for this problem.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] C/C++ Theme Park - Best Solution for large output

2010-05-09 Thread Felipe Sodré Silva
http://code.google.com/codejam/contest/dashboard?c=433101#s=a&a=2

On Sun, May 9, 2010 at 12:33 PM, Pakku  wrote:

> Guys,
>
> I am wondering what all optimization we can really do.
> Though, in the qualification, for the theme park problem, i could not
> solve the large input problem in the given time frame, i optimized it
> latter in the practice mode.
>
> These are the optimization that I did.
>
> for each test case,
>
> 1. if capacity of roller coaster >= total strength [ sum of all groups
> ] then simply total earnings = total strength * number of rides.
> 2. detect if can get a rep if yes, then
> TotalEarnings =  ( EarningsForRep * (RidesPerDay / TripsNeededToGetARep )
> );
> and then TotalEarnings += earnings for the TripsStillLeftInADay ;
>
> Apart from these 2 optimization is there any other place we can
> optimize. what is the best possible optimized solution.
> anyone willing to share the best solution.
>
> -Prakash
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] problem in largeinput

2010-05-09 Thread Luke Pebody
Looking at it from the other side, though, you can see how people
might think that this could be abused by people, say, switching off
their router immediately after downloading the data.

On Sun, May 9, 2010 at 8:13 AM, Mario Ynocente Castro  wrote:
> I went through the same thing while wanting to submit the large input for C.
> I hope in the future there will be a solution for this kind of problems.
>
> 2010/5/9 Douglas Drumond 
>>
>> On Sat, May 8, 2010 at 14:43, cstechguy  wrote:
>> > I successfully completed small input.
>> > While submitting for largeinput my net not worked and got shut down. I
>> > want to submit that again. Isn't possible? it shows the time
>> > expired.what to do? i cannot submit ah?
>>
>> No, you can't submit. I hope you managed to solve other problem.
>>
>> --
>> Douglas Drumond
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to google-c...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>
>
>
> --
> Mario Ynocente Castro
> Undergraduate Student of System Engineering
> National University of Engineering, Peru
>
> http://sites.google.com/site/ycmario
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Felipe Sodré Silva
http://code.google.com/codejam/contest/dashboard?c=433101#s=a&a=2

On Sun, May 9, 2010 at 4:09 PM, Chethan B  wrote:

> Hi,
>
> My source code for Problem C in qualification round GCJ 2010 is
> rejected for some unknown reason!
> At the time of submission i got "submission successful" message. Now,
> i see ' 1 wrong try' message.
> I have downloaded a correct source code written by 'epsalon' (Rank
> 2360) for large input data.
> The output of epsalon's source code and that of my source code match
> exactly for the large input data that i got during the competition.
> So i believe that my source code must also be working fine. Please
> help me in understanding why my code was considered to be a wrong one.
>
>
> thanks,
> Chethan B
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: next jam

2010-05-09 Thread Felipe Sodré Silva
maratona.ime.usp.br

On Sun, May 9, 2010 at 11:13 AM, Rahul Gulati (Phoenix) <
rahul.neot...@gmail.com> wrote:

> @ Felipe
>
> Is the competition for international teams as well? If so, could you please
> post a link related with the competition.
>
> On Sun, May 9, 2010 at 7:41 PM, Felipe Sodré Silva wrote:
>
>> On Sun, May 9, 2010 at 1:43 AM, Carlos Guia  wrote:
>>
>>>
>>> They also have a yearly big contest, www.topcoder.com/tco10, the next
>>> qualification round is this Wednesday if I remember correctly.
>>>
>>>
>> If I am not mistaken, the registration period has ended for tco10. But the
>> advice is nice.
>>
>> Mathias, are you a undegrad student? If so, you can get to participate in
>> Maratona Brasileira de Programação, which is a team-based programming
>> competition. If you need more info about it, contact me through private
>> e-mail.
>>
>> Regards
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to google-c...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Problem C source code rejected for some unknown reason!!

2010-05-09 Thread Chethan B
Hi,

My source code for Problem C in qualification round GCJ 2010 is
rejected for some unknown reason!
At the time of submission i got "submission successful" message. Now,
i see ' 1 wrong try' message.
I have downloaded a correct source code written by 'epsalon' (Rank
2360) for large input data.
The output of epsalon's source code and that of my source code match
exactly for the large input data that i got during the competition.
So i believe that my source code must also be working fine. Please
help me in understanding why my code was considered to be a wrong one.


thanks,
Chethan B

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: next jam

2010-05-09 Thread Ricardo Hahn
Maratona Brasileira de Programação is the brazilian phase of the ACM ICPC

On Sun, May 9, 2010 at 11:13 AM, Rahul Gulati (Phoenix)
 wrote:
> @ Felipe
>
> Is the competition for international teams as well? If so, could you please
> post a link related with the competition.
>
> On Sun, May 9, 2010 at 7:41 PM, Felipe Sodré Silva  wrote:
>>
>> On Sun, May 9, 2010 at 1:43 AM, Carlos Guia  wrote:
>>>
>>> They also have a yearly big contest, www.topcoder.com/tco10, the next
>>> qualification round is this Wednesday if I remember correctly.
>>
>> If I am not mistaken, the registration period has ended for tco10. But the
>> advice is nice.
>> Mathias, are you a undegrad student? If so, you can get to participate in
>> Maratona Brasileira de Programação, which is a team-based programming
>> competition. If you need more info about it, contact me through private
>> e-mail.
>> Regards
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to google-c...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>



-- 
[]'s,
Ricardo

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Discussion about Snapper Chain

2010-05-09 Thread Douglas Drumond
> Is anyone interested in discussing the algorithm for Snapper Chain.
> What was the right approach to it?
>
> PS: I have seen some solved source code. But, would like to know about the
> approach.


You should check contest analysis:
http://code.google.com/codejam/contest/dashboard?c=433101#s=a

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] C/C++ Theme Park - Best Solution for large output

2010-05-09 Thread Pakku
Guys,

I am wondering what all optimization we can really do.
Though, in the qualification, for the theme park problem, i could not
solve the large input problem in the given time frame, i optimized it
latter in the practice mode.

These are the optimization that I did.

for each test case,

1. if capacity of roller coaster >= total strength [ sum of all groups
] then simply total earnings = total strength * number of rides.
2. detect if can get a rep if yes, then
TotalEarnings =  ( EarningsForRep * (RidesPerDay / TripsNeededToGetARep ) );
and then TotalEarnings += earnings for the TripsStillLeftInADay ;

Apart from these 2 optimization is there any other place we can
optimize. what is the best possible optimized solution.
anyone willing to share the best solution.

-Prakash

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] C/C++ Theme Park - Best Solution for large output

2010-05-09 Thread Pakku
Guys,

I am wondering what all optimization we can really do.
Though, in the qualification, for the theme park problem, i could not
solve the large input problem in the given time frame, i optimized it
latter in the practice mode.

These are the optimization that I did.

for each test case,

1. if capacity of roller coaster >= total strength [ sum of all groups
] then simply total earnings = total strength * number of rides.
2. detect if can get a rep if yes, then
TotalEarnings =  ( EarningsForRep * (RidesPerDay / TripsNeededToGetARep ) );
and then TotalEarnings += earnings for the TripsStillLeftInADay ;

Apart from these 2 optimization is there any other place we can
optimize. what is the best possible optimized solution.
anyone willing to share the best solution.

-Prakash

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: Solutions for practice inputs

2010-05-09 Thread Chethan B
hey all..
my first time in GCJ.. it was really nice experience.. but i had
terrible luck :(
In problem C i first used brute force method n solved for small
input.. it worked.. but then realized that it wont be able to process
the large input data set..
So changed the whole code n tested it a lot.. it was working fine.. so
took large data and submitted the code... now it says 1 wrong try..
but guess what?!
I just downloaded randomly a perl source code written by 'epsalon'
which is supposedly 'correct'... generated the output for my large
input data set... the output matches exactly with the output i got
from my program!!! why was my code rejected?? :( is there anybody with
whom i can check?? is the code also checked for readability or
something by judges before accepting it to be correct??

-Cheb

PS: No offense to organizers.. all in all, the competition was
conducted well..


On May 9, 1:11 pm, Luciano Morozowski Junior 
wrote:
> Or you can quickly find solutions to each problem in a specific programming
> language here:
>
> http://www.go-hero.net/jam/10/solutions
>
>
>
>
>
> On Sun, May 9, 2010 at 01:47, Carlos Guia  wrote:
> > On the scoreboard, you can select the "Download solutions" check, then you
> > can download anyone's correct solution and generate the output you need.
>
> > Carlos Guía
>
> > On Sat, May 8, 2010 at 10:25 PM, Prateek Tambi 
> > wrote:
>
> >> You can send me the answers for Large input for problem C.
> >> Thanks.
>
> >> On Sun, May 9, 2010 at 7:54 AM, Prateek Tambi 
> >> wrote:
>
> >>> Hi
> >>> In the qualification round yesterday I got my answer for large input set
> >>> wrong, now I am trying with the practice set, still it is coming out to be
> >>> wrong. So to debug the problem I want to a correct output. Can any one 
> >>> tell
> >>> me where I can find the correct output for the practice set, or if its not
> >>> there in code jam site then can someone generate  and send me the answer 
> >>> for
> >>> output data set?
>
> >>> Thanks
> >>> Prateek Tambi
>
> >>  --
> >> You received this message because you are subscribed to the Google Groups
> >> "google-codejam" group.
> >> To post to this group, send email to google-c...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> google-code+unsubscr...@googlegroups.com >>  oups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/google-code?hl=en.
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "google-codejam" group.
> > To post to this group, send email to google-c...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-code+unsubscr...@googlegroups.com > oups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-code?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Reg : Optimazation in Theme Park

2010-05-09 Thread coder.ankur
Can anybody explain how the problem can be optimized to O(N) as
mentioned in the the last of contest analysis for this problem.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] problem C optimizations

2010-05-09 Thread Dario
I just made the large input case for problem C by storing 'next
position' and 'cash' arrays, then just iterating over them R times.
This seems to be O(N+R). But I've been wondering about possible
optimizations to this. I can think of an O(NlogR) solution in which I
nest the 'next position' and 'cash' arrays, only adding up cash/
changing position when the correct bit of R is on (binary). I've
pasted my code below (the algorithm described here is really just the
solve() function and the rest is wrapping). I'd be interested in a
comparison of different optimizations/algorithms over the problem
space?

def doProb(fname, ofname):
#do problem 3 given a file name
f = open(fname, 'r');
T = int(f.readline());
output = ['Case #' + str(i) + ': '+ \
str(solve([int(j) for j in f.readline().split()],
[int(j) for j in f.readline().split()])) + \
'\n' for i in range(1,T+1)];
f.close();
of = open(ofname, 'w');
of.writelines(output);
of.close();


def solve(x,g):
(R,k,N) = x; #unpack the input
(np, cash) = getParms(k,g);
cur = 0;
tot = 0;

while(R>0):
incl = R%2;
R = R//2;
if(incl==1):
tot += cash[cur];
cur = np[cur];
(np, cash) = nest(np, cash);
return tot;

def nest(np, cash):
#thinking of np as a permutation, get np^2 and total cash list
np2 = [0]*len(np);
c2  = [0]*len(np);
for i in range(len(np)):
np2[i] = np[np[i]];
c2[i] = cash[i]+cash[np[i]];
return (np2, c2);

def getParms(k,g):
N= len(g);

#special case, all passengers fit in the roller coaster:
if(sum(g) <= k):
np = [i for i in range(N)];
cash = [sum(g)]*N;
return (np, cash);

#other cases
np = [];
cash = [];
for i in range(N):
tot = g[i];
j = i;
while(tot <= k):
j = (j+1)%N;
tot += g[j];
tot -= g[j];
np.append(j);
cash.append(tot);

return (np, cash);

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Mathematics

2010-05-09 Thread sharad singh
go with steven skiena "algorithm Design mannual", nice text and you
will come to know how to apply optimization technique with your
mathematical skills

On Sun, May 9, 2010 at 7:57 PM, Mathias Grimm  wrote:
> Mathematics is base for all algorithms. Algorithm is Mathematics!
>
> Someone indicate a book, tutorial or anything for help me?
> I've read an Top Coder tutorial, but a need more.
>
> --
> Att.
> Mathias Grimm
>
> http://mathiasgrimm.com.br
> http://phpempregos.com.br
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Mathematics

2010-05-09 Thread Rahul Gulati (Phoenix)
"Problem Solving Strategies" is more for Olympiad preparation I guess.
However, it is a very good book for increasing your problem solving skills.

On Sun, May 9, 2010 at 7:59 PM, Leopoldo Taravilse wrote:

> If you want to learn Maths I recommend you to read "Problem Solving
> Strategies" from Arthur Engel. You can search for the e-book on the web.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Mathematics

2010-05-09 Thread Rahul Gulati (Phoenix)
A good book for algorithms is "Introduction to Algorithms" by Cormen.

On Sun, May 9, 2010 at 7:57 PM, Mathias Grimm wrote:

> Mathematics is base for all algorithms. Algorithm is Mathematics!
>
> Someone indicate a book, tutorial or anything for help me?
> I've read an Top Coder tutorial, but a need more.
>
> --
> Att.
> Mathias Grimm
>
> http://mathiasgrimm.com.br
> http://phpempregos.com.br
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: next jam

2010-05-09 Thread Rahul Gulati (Phoenix)
@ Felipe

Is the competition for international teams as well? If so, could you please
post a link related with the competition.

On Sun, May 9, 2010 at 7:41 PM, Felipe Sodré Silva  wrote:

> On Sun, May 9, 2010 at 1:43 AM, Carlos Guia  wrote:
>
>>
>> They also have a yearly big contest, www.topcoder.com/tco10, the next
>> qualification round is this Wednesday if I remember correctly.
>>
>>
> If I am not mistaken, the registration period has ended for tco10. But the
> advice is nice.
>
> Mathias, are you a undegrad student? If so, you can get to participate in
> Maratona Brasileira de Programação, which is a team-based programming
> competition. If you need more info about it, contact me through private
> e-mail.
>
> Regards
>
>  --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Performance with huge data sets

2010-05-09 Thread revant nadgouda
Even i faced the same problem...!

On Sat, May 8, 2010 at 11:42 PM, goutham  wrote:

> well I got the prob with Theme Park... the small inputs were solving
> good but the large inputs contained loops for 100,000,000 which are
> huge and time consuming  and all my 8 min of submission time went
> away...
>
> is anyone else facing the same problem.
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: Difficult!

2010-05-09 Thread wRabbit_AlMag
Yep, agree

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] confirmation mail

2010-05-09 Thread nuttyroll
When we willl get confirmation mail that we have qualified

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: New website layout

2010-05-09 Thread Sarma Tangirala
Yeah!

On 9 May 2010 05:39, Nikaustr  wrote:

> Definitely!
>
>
> On May 9, 12:53 am, Luke Pebody  wrote:
> > I really like the new website layout. The archive sections look awesome
> now.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> > To post to this group, send email to google-c...@googlegroups.com.
> > To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> > For more options, visit this group athttp://
> groups.google.com/group/google-code?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>
>


-- 
Regards,
Sarma Tangirala, tvssarma.ome...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: RESULTS OF QUALIFICATION ROUND

2010-05-09 Thread Rahul Gulati (Phoenix)
Thanks mate!

Regards,

Rahul Gulati

On Sun, May 9, 2010 at 10:19 AM, Carlos Guia  wrote:

> You can here, http://go-hero.net/jam/
> 
> Carlos Guía
>
>
> On Sat, May 8, 2010 at 10:29 PM, Rahul Gulati (Phoenix) <
> rahul.neot...@gmail.com> wrote:
>
>> Is there a way that I could see my who all have been selected from my
>> country except for putting in the usernames of all in the "add friend" box?
>>
>>
>> On Sun, May 9, 2010 at 7:45 AM, Shoubhik  wrote:
>>
>>> Thanks a lot :-)
>>>
>>> On May 9, 7:06 am, Abhishek Chandel  wrote:
>>> > On Sun, May 9, 2010 at 7:34 AM, Shoubhik  wrote:
>>> > > Have the large inputs been evaluated(thats what i feel).. but I want
>>> > > to be sure, as I havent recieved a notification yet..
>>> >
>>> > > --
>>> > > You received this message because you are subscribed to the Google
>>> Groups
>>> > > "google-codejam" group.
>>> > > To post to this group, send email to google-c...@googlegroups.com.
>>> > > To unsubscribe from this group, send email to
>>> > > google-code+unsubscr...@googlegroups.com
>>> 
>>> > > .
>>> > > For more options, visit this group at
>>> > >http://groups.google.com/group/google-code?hl=en.
>>> >
>>> > > yes, they 've been :)
>>> >
>>> > --
>>> > --
>>> > Thanks and Regards
>>> > --
>>> > Abhishek Chandel
>>> >
>>> > BTech
>>> >
>>> > Computer Engineering
>>> > Malaviya National Institute of Technology,Jaipur.
>>> > 91-9660753545
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups "google-codejam" group.
>>> > To post to this group, send email to google-c...@googlegroups.com.
>>> > To unsubscribe from this group, send email to
>>> google-code+unsubscr...@googlegroups.com
>>> .
>>> > For more options, visit this group athttp://
>>> groups.google.com/group/google-code?hl=en.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "google-codejam" group.
>>> To post to this group, send email to google-c...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> google-code+unsubscr...@googlegroups.com
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-code?hl=en.
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to google-c...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Solutions for practice inputs

2010-05-09 Thread prateek.tambi
yeah Thanks! :)

On Sun, May 9, 2010 at 10:42 AM, Dhruva Sagar wrote:

> Hi Prateek, you can simply download the solution of someone who solved it
> correctly and run his program to get the correct output.
>
> On Sun, May 9, 2010 at 07:54, Prateek Tambi wrote:
>
>> Hi
>> In the qualification round yesterday I got my answer for large input set
>> wrong, now I am trying with the practice set, still it is coming out to be
>> wrong. So to debug the problem I want to a correct output. Can any one tell
>> me where I can find the correct output for the practice set, or if its not
>> there in code jam site then can someone generate  and send me the answer for
>> output data set?
>>
>> Thanks
>> Prateek Tambi
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to google-c...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>
>
>
> --
>
> Thanks & Regards,
> Dhruva Sagar.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Discussion about Snapper Chain

2010-05-09 Thread Varun Nischal
Hello all,

Is anyone interested in discussing the algorithm for Snapper Chain.
What was the right approach to it?

PS: I have seen some solved source code. But, would like to know about the
approach.

Thanks,
Varun

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] problem in largeinput

2010-05-09 Thread Mario Ynocente Castro
I went through the same thing while wanting to submit the large input for C.
I hope in the future there will be a solution for this kind of problems.

2010/5/9 Douglas Drumond 

> On Sat, May 8, 2010 at 14:43, cstechguy  wrote:
> > I successfully completed small input.
> > While submitting for largeinput my net not worked and got shut down. I
> > want to submit that again. Isn't possible? it shows the time
> > expired.what to do? i cannot submit ah?
>
> No, you can't submit. I hope you managed to solve other problem.
>
> --
> Douglas Drumond
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>
>


-- 
Mario Ynocente Castro
Undergraduate Student of System Engineering
National University of Engineering, Peru

http://sites.google.com/site/ycmario

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: Weird experience with "Theme Park"

2010-05-09 Thread guest
Well, I've thought of some solutions and I think maybe solution 4
would be the best :)

1. O(RN)naive search
naive.
2. O(RlgN)  binary search
well, quite easy to think of. but according to the size of the test
data, it is quite risky.
3. O(R+N)   queue
just computing the next[N] and value[N] array. Risky either.
4. O(NlgR)  queue+doubling
doubling next[lgnR][N] and value[lgnR][N] array.  Can be improved by
rolling the arrays.
5. O(N) queue+graph+math
construting the next[N] array (edges) into a graph, and by computing
cycles, we can do an effecient linear programming.

Well, solution 5 may be the best in Time and Memory,

solution 4 should be best for programmers 'cause it has the greatest
balance in either Time, Memory and Code Length.

* next[i] means the first group of the next rollercoasting round.
  value[i] means the earning of the round started by group i.

:)

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: How to read and write files

2010-05-09 Thread Chuchox
That means compiling the program several times (one for the test, one
for the small input, one for the large input...). You can compile one
time using the standard input and output


#include<>
#include<>
#include<>
#include<>
...

(defines)

using namespace std;

int main()
{
string st;
while(getline(cin,st))
cout << st << endl;

}


And run the program using the comand line: program A-
small.out
This run the program using A-small.in like stdin and A-smal.out like
stdout
Run the program one more time:  program A-large.out

This work in Windows, if your SO is Mac or Linux, don't know if works

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: RESULTS OF QUALIFICATION ROUND

2010-05-09 Thread Mudit Jain
Me too was wondering that :)

On Sun, May 9, 2010 at 7:59 AM, Rahul Gulati (Phoenix) <
rahul.neot...@gmail.com> wrote:

> Is there a way that I could see my who all have been selected from my
> country except for putting in the usernames of all in the "add friend" box?
>
>
> On Sun, May 9, 2010 at 7:45 AM, Shoubhik  wrote:
>
>> Thanks a lot :-)
>>
>> On May 9, 7:06 am, Abhishek Chandel  wrote:
>> > On Sun, May 9, 2010 at 7:34 AM, Shoubhik  wrote:
>> > > Have the large inputs been evaluated(thats what i feel).. but I want
>> > > to be sure, as I havent recieved a notification yet..
>> >
>> > > --
>> > > You received this message because you are subscribed to the Google
>> Groups
>> > > "google-codejam" group.
>> > > To post to this group, send email to google-c...@googlegroups.com.
>> > > To unsubscribe from this group, send email to
>> > > google-code+unsubscr...@googlegroups.com
>> 
>> > > .
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/google-code?hl=en.
>> >
>> > > yes, they 've been :)
>> >
>> > --
>> > --
>> > Thanks and Regards
>> > --
>> > Abhishek Chandel
>> >
>> > BTech
>> >
>> > Computer Engineering
>> > Malaviya National Institute of Technology,Jaipur.
>> > 91-9660753545
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups "google-codejam" group.
>> > To post to this group, send email to google-c...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com
>> .
>> > For more options, visit this group athttp://
>> groups.google.com/group/google-code?hl=en.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to google-c...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: RESULTS OF QUALIFICATION ROUND

2010-05-09 Thread M. Shuaib Khan
On Sun, May 9, 2010 at 7:29 AM, Rahul Gulati (Phoenix) <
rahul.neot...@gmail.com> wrote:

> Is there a way that I could see my who all have been selected from my
> country except for putting in the usernames of all in the "add friend" box?


http://www.go-hero.net/jam/10/regions


>
> On Sun, May 9, 2010 at 7:45 AM, Shoubhik  wrote:
>
>> Thanks a lot :-)
>>
>> On May 9, 7:06 am, Abhishek Chandel  wrote:
>> > On Sun, May 9, 2010 at 7:34 AM, Shoubhik  wrote:
>> > > Have the large inputs been evaluated(thats what i feel).. but I want
>> > > to be sure, as I havent recieved a notification yet..
>> >
>> > > --
>> > > You received this message because you are subscribed to the Google
>> Groups
>> > > "google-codejam" group.
>> > > To post to this group, send email to google-c...@googlegroups.com.
>> > > To unsubscribe from this group, send email to
>> > > google-code+unsubscr...@googlegroups.com
>> 
>> > > .
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/google-code?hl=en.
>> >
>> > > yes, they 've been :)
>> >
>> > --
>> > --
>> > Thanks and Regards
>> > --
>> > Abhishek Chandel
>> >
>> > BTech
>> >
>> > Computer Engineering
>> > Malaviya National Institute of Technology,Jaipur.
>> > 91-9660753545
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups "google-codejam" group.
>> > To post to this group, send email to google-c...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com
>> .
>> > For more options, visit this group athttp://
>> groups.google.com/group/google-code?hl=en.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to google-c...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>



-- 
M. Shuaib Khan
http://mshuaibkhan.blogspot.com

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Large Input Timer Expired

2010-05-09 Thread Lucas Piva
On Sat, May 8, 2010 at 1:48 PM, giri  wrote:
> I have solved the small input but the time for submitting large input
> expired. The code I submitted works for both, as far as I know. Will
> it be run against large inputs too during evaluation or I lost the 23
> points already?
> Thanks.

That's the reason there's a small input and a large input. Brute force
*might* work for small input, but the large input is usually coined so
that you have to think of clever solutions with lower time
complexities or good optimizations or it won't run on time. I suggest
you take a look at the Contest Analysis.

>
> --
> You received this message because you are subscribed to the Google Groups 
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-code+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/google-code?hl=en.
>
>



-- 
Piva

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Mathematics

2010-05-09 Thread Carlos Guia
I haven't read it, but have heard many good things about
http://en.wikipedia.org/wiki/Concrete_Mathematics

But knowing Knuth, it is
probably not the easiest book to start with.

Carlos Guía


On Sun, May 9, 2010 at 9:59 AM, Leopoldo Taravilse wrote:

> If you want to learn Maths I recommend you to read "Problem Solving
> Strategies" from Arthur Engel. You can search for the e-book on the web.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Mathematics

2010-05-09 Thread Felipe Sodré Silva
There is not A BOOK of Mathematics. But if you want a good one to help on
algorithm design, I'd recommend *Concrete Mathematics: A Foundation for
Computer Science, by Knuth et al.*

On Sun, May 9, 2010 at 11:27 AM, Mathias Grimm wrote:

> Mathematics is base for all algorithms. Algorithm is Mathematics!
>
> Someone indicate a book, tutorial or anything for help me?
> I've read an Top Coder tutorial, but a need more.
>
> --
> Att.
> Mathias Grimm
>
> http://mathiasgrimm.com.br
> http://phpempregos.com.br
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Mathematics

2010-05-09 Thread Leopoldo Taravilse
If you want to learn Maths I recommend you to read "Problem Solving
Strategies" from Arthur Engel. You can search for the e-book on the web.

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Mathematics

2010-05-09 Thread Mathias Grimm
Mathematics is base for all algorithms. Algorithm is Mathematics!

Someone indicate a book, tutorial or anything for help me?
I've read an Top Coder tutorial, but a need more.

-- 
Att.
Mathias Grimm

http://mathiasgrimm.com.br
http://phpempregos.com.br

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: next jam

2010-05-09 Thread Carlos Guia
Registration for TCO10 is still open, if someone registers before the 11th,
he/she can participate on Wednesday's qualification round, and before the
23th to be able to participate in the last qualification on the 24th.


Carlos Guía


On Sun, May 9, 2010 at 9:41 AM, Felipe Sodré Silva  wrote:

> On Sun, May 9, 2010 at 1:43 AM, Carlos Guia  wrote:
>
>>
>> They also have a yearly big contest, www.topcoder.com/tco10, the next
>> qualification round is this Wednesday if I remember correctly.
>>
>>
> If I am not mistaken, the registration period has ended for tco10. But the
> advice is nice.
>
> Mathias, are you a undegrad student? If so, you can get to participate in
> Maratona Brasileira de Programação, which is a team-based programming
> competition. If you need more info about it, contact me through private
> e-mail.
>
> Regards
>
>  --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Problem B wording -> did I misunderstand something?

2010-05-09 Thread Luke Pebody
The apocalypse can't happen before the day of reckoning, can it?

On Sun, May 9, 2010 at 2:43 PM, Gustavo Pacianotto Gouveia
 wrote:
> It was needed N events... 2 wasn't enough...
>
> 2010/5/9 Bharath Raghavendran 
>>
>> Its so easy to prove that the prophecy is wrong ... Take the
>> chronologically first distinct two occurrences of the apocalypse. Now, if
>> you consider the prophecy one slarbosecond after the second occurrence, its
>> quite obvious that, with T as the difference in time of the 2 occurences,
>> the next apocalypse should occur T slarboseconds after the second one. So,
>> if the prophecy is true, an apocalypse should occur every T slarboseconds
>> after the first occurrence. But obviously, this did not happen for most test
>> cases. Hence the prophecy is wrong :). The people of Jamcode X are wasting a
>> lot of time trying to determine the next occurrence based on a wrong
>> prophecy :P
>>
>> Maybe when they realized that the apocalypse did not occur, they decided
>> to have a giant party :).
>>
>> On 9 May 2010 17:17, Ketan Joshi  wrote:
>>>
>>> what was the epilogoue about? I couldn't understand it
>>>
>>> On Sun, May 9, 2010 at 4:01 PM, Luke Pebody 
>>> wrote:

 +1

 On Sun, May 9, 2010 at 5:36 AM, Bharath Raghavendran
  wrote:
 > I like the epilogue in the problem :)
 >
 > On 9 May 2010 06:22, ijacek  wrote:
 >>
 >> I must say that I did understand to this badly too,
 >> but luckily the library function handles this case in favor my
 >> intentions :-)
 >>
 >>
 >> On May 9, 1:41 am, Abizern  wrote:
 >> > @Michael Dyck -- That makes perfect sense; thank you!
 >> >
 >> > On 9 May 2010 00:36, Michael Dyck  wrote:
 >> >
 >> >
 >> >
 >> >
 >> >
 >> > > Abizern wrote:
 >> >
 >> > >> The wording for Fair warning stated that t[i] <>t[j] for some i,
 >> > >> j.
 >> >
 >> > >> I took this to mean that there would be no duplicate times, but
 >> > >> there
 >> > >> clearly were in the small test input that I saw.
 >> >
 >> > >> Did I misunderstand something?
 >> >
 >> > > No duplicate times would be:
 >> > >    t[i] != t[j] for ALL i != j
 >> >
 >> > > Instead,
 >> > >    t[i] != t[j] for SOME i, j
 >> > > just means that there are at least two non-simultaneous events.
 >> >
 >> > > -Michael
 >> >
 >> > > --
 >> > > You received this message because you are subscribed to the
 >> > > Google
 >> > > Groups
 >> > > "google-codejam" group.
 >> > > To post to this group, send email to
 >> > > google-c...@googlegroups.com.
 >> > > To unsubscribe from this group, send email to
 >> > >
 >> > >
 >> > > google-code+unsubscr...@googlegroups.com>>> >> > > oups.com>
 >> > > .
 >> > > For more options, visit this group at
 >> > >http://groups.google.com/group/google-code?hl=en.
 >> >
 >> > --
 >> > Abizer
 >> >
 >> > --
 >> > You received this message because you are subscribed to the Google
 >> > Groups "google-codejam" group.
 >> > To post to this group, send email to google-c...@googlegroups.com.
 >> > To unsubscribe from this group, send email to
 >> > google-code+unsubscr...@googlegroups.com.
 >> > For more options, visit this group
 >> > athttp://groups.google.com/group/google-code?hl=en.
 >>
 >> --
 >> You received this message because you are subscribed to the Google
 >> Groups
 >> "google-codejam" group.
 >> To post to this group, send email to google-c...@googlegroups.com.
 >> To unsubscribe from this group, send email to
 >> google-code+unsubscr...@googlegroups.com.
 >> For more options, visit this group at
 >> http://groups.google.com/group/google-code?hl=en.
 >>
 >
 > --
 > You received this message because you are subscribed to the Google
 > Groups
 > "google-codejam" group.
 > To post to this group, send email to google-c...@googlegroups.com.
 > To unsubscribe from this group, send email to
 > google-code+unsubscr...@googlegroups.com.
 > For more options, visit this group at
 > http://groups.google.com/group/google-code?hl=en.
 >

 --
 You received this message because you are subscribed to the Google
 Groups "google-codejam" group.
 To post to this group, send email to google-c...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

>>>
>>>
>>>
>>> --
>>> Blog: http://beingkejo.wordpress.com
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "google-codejam" group.
>>> To post to this group, send email to google-c...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> google-code+unsubscr...@goog

Re: [gcj] Re: next jam

2010-05-09 Thread Felipe Sodré Silva
On Sun, May 9, 2010 at 1:43 AM, Carlos Guia  wrote:

>
> They also have a yearly big contest, www.topcoder.com/tco10, the next
> qualification round is this Wednesday if I remember correctly.
>
>
If I am not mistaken, the registration period has ended for tco10. But the
advice is nice.

Mathias, are you a undegrad student? If so, you can get to participate in
Maratona Brasileira de Programação, which is a team-based programming
competition. If you need more info about it, contact me through private
e-mail.

Regards

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Is Qt a valid platform to be used in codejam

2010-05-09 Thread Felipe Sodré Silva
By classes I don't mean just data structures, but also some basic algorithms
(like intersections and such), that are not usually hard to implement, but
it saves you a considerable amount of time if you have it done. Not to
mention regular expressions operations.


On Sun, May 9, 2010 at 12:07 AM, Mathias Grimm wrote:

> in general case, just a pair of arrays will be suficient.
>
> On Sat, May 8, 2010 at 11:19 PM, Felipe Sodré Silva wrote:
>
>> Qt has some classes that may be useful for solving geometry or string
>> processing (regular expressions) problems.
>> Another library that may be a lot useful for C++ programmers is Boost.
>>
>>
>> On Sat, May 8, 2010 at 11:07 PM, shravan kumar wrote:
>>
>>> Why do you want to use Qt unless you need to develop some widgets.You can
>>> use PHP.
>>>
>>>
>>> On 8 May 2010 23:23, goutham  wrote:
>>>
 Can I use the freely available Qt framework for C++ in codejam. and
 how about php.

 --
 You received this message because you are subscribed to the Google
 Groups "google-codejam" group.
 To post to this group, send email to google-c...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.


>>>  --
>>> You received this message because you are subscribed to the Google Groups
>>> "google-codejam" group.
>>> To post to this group, send email to google-c...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> google-code+unsubscr...@googlegroups.com
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-code?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to google-c...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>
>
>
> --
> Att.
> Mathias Grimm
>
> http://mathiasgrimm.com.br
> http://phpempregos.com.br
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Problem B wording -> did I misunderstand something?

2010-05-09 Thread Dhruva Sagar
The epilogue said that the prophesy was mistranslated and that what was
considered to be an apocalypse, happened to actually be a Giant Party.
And Jamcode IX people were so busy enjoying the party that they forgot to
communicate that to Jamcode X, and so X still tried to find the time to
apocalypse :)

On Sun, May 9, 2010 at 19:01, Bharath Raghavendran wrote:

> Its so easy to prove that the prophecy is wrong ... Take the
> chronologically first distinct two occurrences of the apocalypse. Now, if
> you consider the prophecy one slarbosecond after the second occurrence, its
> quite obvious that, with T as the difference in time of the 2 occurences,
> the next apocalypse should occur T slarboseconds after the second one. So,
> if the prophecy is true, an apocalypse should occur every T slarboseconds
> after the first occurrence. But obviously, this did not happen for most test
> cases. Hence the prophecy is wrong :). The people of Jamcode X are wasting a
> lot of time trying to determine the next occurrence based on a wrong
> prophecy :P
>
> Maybe when they realized that the apocalypse did not occur, they decided to
> have a giant party :).
>
>
> On 9 May 2010 17:17, Ketan Joshi  wrote:
>
>> what was the epilogoue about? I couldn't understand it
>>
>>
>> On Sun, May 9, 2010 at 4:01 PM, Luke Pebody wrote:
>>
>>> +1
>>>
>>> On Sun, May 9, 2010 at 5:36 AM, Bharath Raghavendran
>>>  wrote:
>>> > I like the epilogue in the problem :)
>>> >
>>> > On 9 May 2010 06:22, ijacek  wrote:
>>> >>
>>> >> I must say that I did understand to this badly too,
>>> >> but luckily the library function handles this case in favor my
>>> >> intentions :-)
>>> >>
>>> >>
>>> >> On May 9, 1:41 am, Abizern  wrote:
>>> >> > @Michael Dyck -- That makes perfect sense; thank you!
>>> >> >
>>> >> > On 9 May 2010 00:36, Michael Dyck  wrote:
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> > > Abizern wrote:
>>> >> >
>>> >> > >> The wording for Fair warning stated that t[i] <>t[j] for some i,
>>> j.
>>> >> >
>>> >> > >> I took this to mean that there would be no duplicate times, but
>>> there
>>> >> > >> clearly were in the small test input that I saw.
>>> >> >
>>> >> > >> Did I misunderstand something?
>>> >> >
>>> >> > > No duplicate times would be:
>>> >> > >t[i] != t[j] for ALL i != j
>>> >> >
>>> >> > > Instead,
>>> >> > >t[i] != t[j] for SOME i, j
>>> >> > > just means that there are at least two non-simultaneous events.
>>> >> >
>>> >> > > -Michael
>>> >> >
>>> >> > > --
>>> >> > > You received this message because you are subscribed to the Google
>>> >> > > Groups
>>> >> > > "google-codejam" group.
>>> >> > > To post to this group, send email to google-code@googlegroups.com
>>> .
>>> >> > > To unsubscribe from this group, send email to
>>> >> > >
>>> >> > > google-code+unsubscr...@googlegroups.com
>>> >> >> > > oups.com>
>>> >> > > .
>>> >> > > For more options, visit this group at
>>> >> > >http://groups.google.com/group/google-code?hl=en.
>>> >> >
>>> >> > --
>>> >> > Abizer
>>> >> >
>>> >> > --
>>> >> > You received this message because you are subscribed to the Google
>>> >> > Groups "google-codejam" group.
>>> >> > To post to this group, send email to google-c...@googlegroups.com.
>>> >> > To unsubscribe from this group, send email to
>>> >> > google-code+unsubscr...@googlegroups.com
>>> .
>>> >> > For more options, visit this group
>>> >> > athttp://groups.google.com/group/google-code?hl=en.
>>> >>
>>> >> --
>>> >> You received this message because you are subscribed to the Google
>>> Groups
>>> >> "google-codejam" group.
>>> >> To post to this group, send email to google-c...@googlegroups.com.
>>> >> To unsubscribe from this group, send email to
>>> >> google-code+unsubscr...@googlegroups.com
>>> .
>>> >> For more options, visit this group at
>>> >> http://groups.google.com/group/google-code?hl=en.
>>> >>
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups
>>> > "google-codejam" group.
>>> > To post to this group, send email to google-c...@googlegroups.com.
>>> > To unsubscribe from this group, send email to
>>> > google-code+unsubscr...@googlegroups.com
>>> .
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/google-code?hl=en.
>>> >
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "google-codejam" group.
>>> To post to this group, send email to google-c...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> google-code+unsubscr...@googlegroups.com
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-code?hl=en.
>>>
>>>
>>
>>
>> --
>> Blog: http://beingkejo.wordpress.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to google-c...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com

Re: [gcj] Re: Problem B wording -> did I misunderstand something?

2010-05-09 Thread Gustavo Pacianotto Gouveia
It was needed N events... 2 wasn't enough...

2010/5/9 Bharath Raghavendran 

> Its so easy to prove that the prophecy is wrong ... Take the
> chronologically first distinct two occurrences of the apocalypse. Now, if
> you consider the prophecy one slarbosecond after the second occurrence, its
> quite obvious that, with T as the difference in time of the 2 occurences,
> the next apocalypse should occur T slarboseconds after the second one. So,
> if the prophecy is true, an apocalypse should occur every T slarboseconds
> after the first occurrence. But obviously, this did not happen for most test
> cases. Hence the prophecy is wrong :). The people of Jamcode X are wasting a
> lot of time trying to determine the next occurrence based on a wrong
> prophecy :P
>
> Maybe when they realized that the apocalypse did not occur, they decided to
> have a giant party :).
>
>
> On 9 May 2010 17:17, Ketan Joshi  wrote:
>
>> what was the epilogoue about? I couldn't understand it
>>
>>
>> On Sun, May 9, 2010 at 4:01 PM, Luke Pebody wrote:
>>
>>> +1
>>>
>>> On Sun, May 9, 2010 at 5:36 AM, Bharath Raghavendran
>>>  wrote:
>>> > I like the epilogue in the problem :)
>>> >
>>> > On 9 May 2010 06:22, ijacek  wrote:
>>> >>
>>> >> I must say that I did understand to this badly too,
>>> >> but luckily the library function handles this case in favor my
>>> >> intentions :-)
>>> >>
>>> >>
>>> >> On May 9, 1:41 am, Abizern  wrote:
>>> >> > @Michael Dyck -- That makes perfect sense; thank you!
>>> >> >
>>> >> > On 9 May 2010 00:36, Michael Dyck  wrote:
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> > > Abizern wrote:
>>> >> >
>>> >> > >> The wording for Fair warning stated that t[i] <>t[j] for some i,
>>> j.
>>> >> >
>>> >> > >> I took this to mean that there would be no duplicate times, but
>>> there
>>> >> > >> clearly were in the small test input that I saw.
>>> >> >
>>> >> > >> Did I misunderstand something?
>>> >> >
>>> >> > > No duplicate times would be:
>>> >> > >t[i] != t[j] for ALL i != j
>>> >> >
>>> >> > > Instead,
>>> >> > >t[i] != t[j] for SOME i, j
>>> >> > > just means that there are at least two non-simultaneous events.
>>> >> >
>>> >> > > -Michael
>>> >> >
>>> >> > > --
>>> >> > > You received this message because you are subscribed to the Google
>>> >> > > Groups
>>> >> > > "google-codejam" group.
>>> >> > > To post to this group, send email to google-code@googlegroups.com
>>> .
>>> >> > > To unsubscribe from this group, send email to
>>> >> > >
>>> >> > > google-code+unsubscr...@googlegroups.com
>>> >> >> > > oups.com>
>>> >> > > .
>>> >> > > For more options, visit this group at
>>> >> > >http://groups.google.com/group/google-code?hl=en.
>>> >> >
>>> >> > --
>>> >> > Abizer
>>> >> >
>>> >> > --
>>> >> > You received this message because you are subscribed to the Google
>>> >> > Groups "google-codejam" group.
>>> >> > To post to this group, send email to google-c...@googlegroups.com.
>>> >> > To unsubscribe from this group, send email to
>>> >> > google-code+unsubscr...@googlegroups.com
>>> .
>>> >> > For more options, visit this group
>>> >> > athttp://groups.google.com/group/google-code?hl=en.
>>> >>
>>> >> --
>>> >> You received this message because you are subscribed to the Google
>>> Groups
>>> >> "google-codejam" group.
>>> >> To post to this group, send email to google-c...@googlegroups.com.
>>> >> To unsubscribe from this group, send email to
>>> >> google-code+unsubscr...@googlegroups.com
>>> .
>>> >> For more options, visit this group at
>>> >> http://groups.google.com/group/google-code?hl=en.
>>> >>
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups
>>> > "google-codejam" group.
>>> > To post to this group, send email to google-c...@googlegroups.com.
>>> > To unsubscribe from this group, send email to
>>> > google-code+unsubscr...@googlegroups.com
>>> .
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/google-code?hl=en.
>>> >
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "google-codejam" group.
>>> To post to this group, send email to google-c...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> google-code+unsubscr...@googlegroups.com
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-code?hl=en.
>>>
>>>
>>
>>
>> --
>> Blog: http://beingkejo.wordpress.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to google-c...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To

Re: [gcj] Re: Problem B wording -> did I misunderstand something?

2010-05-09 Thread Bharath Raghavendran
Its so easy to prove that the prophecy is wrong ... Take the chronologically
first distinct two occurrences of the apocalypse. Now, if you consider the
prophecy one slarbosecond after the second occurrence, its quite obvious
that, with T as the difference in time of the 2 occurences, the next
apocalypse should occur T slarboseconds after the second one. So, if the
prophecy is true, an apocalypse should occur every T slarboseconds after the
first occurrence. But obviously, this did not happen for most test cases.
Hence the prophecy is wrong :). The people of Jamcode X are wasting a lot of
time trying to determine the next occurrence based on a wrong prophecy :P

Maybe when they realized that the apocalypse did not occur, they decided to
have a giant party :).

On 9 May 2010 17:17, Ketan Joshi  wrote:

> what was the epilogoue about? I couldn't understand it
>
>
> On Sun, May 9, 2010 at 4:01 PM, Luke Pebody  wrote:
>
>> +1
>>
>> On Sun, May 9, 2010 at 5:36 AM, Bharath Raghavendran
>>  wrote:
>> > I like the epilogue in the problem :)
>> >
>> > On 9 May 2010 06:22, ijacek  wrote:
>> >>
>> >> I must say that I did understand to this badly too,
>> >> but luckily the library function handles this case in favor my
>> >> intentions :-)
>> >>
>> >>
>> >> On May 9, 1:41 am, Abizern  wrote:
>> >> > @Michael Dyck -- That makes perfect sense; thank you!
>> >> >
>> >> > On 9 May 2010 00:36, Michael Dyck  wrote:
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > > Abizern wrote:
>> >> >
>> >> > >> The wording for Fair warning stated that t[i] <>t[j] for some i,
>> j.
>> >> >
>> >> > >> I took this to mean that there would be no duplicate times, but
>> there
>> >> > >> clearly were in the small test input that I saw.
>> >> >
>> >> > >> Did I misunderstand something?
>> >> >
>> >> > > No duplicate times would be:
>> >> > >t[i] != t[j] for ALL i != j
>> >> >
>> >> > > Instead,
>> >> > >t[i] != t[j] for SOME i, j
>> >> > > just means that there are at least two non-simultaneous events.
>> >> >
>> >> > > -Michael
>> >> >
>> >> > > --
>> >> > > You received this message because you are subscribed to the Google
>> >> > > Groups
>> >> > > "google-codejam" group.
>> >> > > To post to this group, send email to google-c...@googlegroups.com.
>> >> > > To unsubscribe from this group, send email to
>> >> > >
>> >> > > google-code+unsubscr...@googlegroups.com
>> > >> > > oups.com>
>> >> > > .
>> >> > > For more options, visit this group at
>> >> > >http://groups.google.com/group/google-code?hl=en.
>> >> >
>> >> > --
>> >> > Abizer
>> >> >
>> >> > --
>> >> > You received this message because you are subscribed to the Google
>> >> > Groups "google-codejam" group.
>> >> > To post to this group, send email to google-c...@googlegroups.com.
>> >> > To unsubscribe from this group, send email to
>> >> > google-code+unsubscr...@googlegroups.com
>> .
>> >> > For more options, visit this group
>> >> > athttp://groups.google.com/group/google-code?hl=en.
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> Groups
>> >> "google-codejam" group.
>> >> To post to this group, send email to google-c...@googlegroups.com.
>> >> To unsubscribe from this group, send email to
>> >> google-code+unsubscr...@googlegroups.com
>> .
>> >> For more options, visit this group at
>> >> http://groups.google.com/group/google-code?hl=en.
>> >>
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "google-codejam" group.
>> > To post to this group, send email to google-c...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > google-code+unsubscr...@googlegroups.com
>> .
>> > For more options, visit this group at
>> > http://groups.google.com/group/google-code?hl=en.
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-codejam" group.
>> To post to this group, send email to google-c...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-code+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-code?hl=en.
>>
>>
>
>
> --
> Blog: http://beingkejo.wordpress.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-codejam" group.
> To post to this group, send email to google-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-code+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



[gcj] Re: Performance with huge data sets

2010-05-09 Thread ijacek
What do you mean by the shift?

I saved the state (earnings and runs) for every group I needed
to calculate and I detected the repetition next time with the same
starting group. In most cases it occured much sooner than after N
runs. This itself drops the calc time under 0.1s!

I made the cummulative cost array optimalization in my original
solution but when I removed that later, it didn't have any negative
impact. It's because the # of groups is quite small and it calculates
much more than needed in most cases.

The caching of group sizes doesn't have any impact too because
the cache is used at most once (with rep. detection).

So there are several possible optimizations but in this case (small #
of groups)
the repetition detection makes the other useless :-)


On May 9, 4:14 am, Abhishek Chandel  wrote:
> On Sun, May 9, 2010 at 6:09 AM, Abdelrhman Abotaleb <
>
>
>
>
>
> profvip.abota...@gmail.com> wrote:
> > mmm
> > To deduce all the patterns ; the overhead may be large
> > number of groups are 1
> > and each group members could be upto 10^7
>
> > or rather than deducing the patterns
> >  each time we rotate the queue[or dequeue then enqueue]  ;
> > compare with the original queue to test if the repetition rate is less than
> > N
>
> > it could dramatically increase the efficiency.
>
> > On Sun, May 9, 2010 at 2:29 AM, Luke Pebody  wrote:
>
> >> Not sure I agree that the queue of the groups is repeated after N times.
>
> >> Let N = 7, and let k = 6, and let the groups be size 1,1,1,1,1,1,6.
> >> Here the repetition is every 2 times.
>
> >> On Sun, May 9, 2010 at 1:23 AM, Abdelrhman Abotaleb
> >>  wrote:
> >> > mmm you may note that the queue of the groups is repeated after N times
> >> > where N is the number of the groups
> >> > So if R>N
> >> > you will only calculate the earning from N rounds
> >> > and multiply this earn by R[i]/N[i]
>
> >> > if R[i]%N[i] is a value
> >> > so make a loop over a rounds number =R[i]%N[i]
> >> > and add the earning from it to the first earning
> >> > that's all
>
> >> > I make the solution and the output is so fast with me [about 10 seconds]
> >> > but the contest was over :d
>
> >> > On Sun, May 9, 2010 at 2:03 AM, sanjay sinha 
> >> wrote:
>
> >> >> Hey i have also used only one loop for R (Number of rounds in one day)
> >> >> but got some values of R about1 and looping through this takes
> >> >> a lot of time...
> >> >> This was the only one which i failed to submitt.
> >> >> @Filpe can you paste a sudo code
>
> >> >> Thanks
>
> >> >> On Sun, May 9, 2010 at 5:11 AM, Felipe Sodré Silva 
> >> >> wrote:
> >> >> > My solution has only one loop with R cycles for each input, and it
> >> >> > solved
> >> >> > the large input in less than a minute. The problem is probably what
> >> you
> >> >> > are
> >> >> > doing inside the loop. There's no way to solve it in time if you just
> >> do
> >> >> > a straightforward simulation on each cycle.
> >> >> > Malkava
>
> >> >> > On Sat, May 8, 2010 at 3:12 PM, goutham 
> >> wrote:
>
> >> >> >> well I got the prob with Theme Park... the small inputs were solving
> >> >> >> good but the large inputs contained loops for 100,000,000 which are
> >> >> >> huge and time consuming  and all my 8 min of submission time
> >> went
> >> >> >> away...
>
> >> >> >> is anyone else facing the same problem.
>
> >> >> >> --
> >> >> >> You received this message because you are subscribed to the Google
> >> >> >> Groups
> >> >> >> "google-codejam" group.
> >> >> >> To post to this group, send email to google-c...@googlegroups.com.
> >> >> >> To unsubscribe from this group, send email to
> >> >> >> google-code+unsubscr...@googlegroups.com >> >> >>  oups.com>
> >> .
> >> >> >> For more options, visit this group at
> >> >> >>http://groups.google.com/group/google-code?hl=en.
>
> >> >> > --
> >> >> > You received this message because you are subscribed to the Google
> >> >> > Groups
> >> >> > "google-codejam" group.
> >> >> > To post to this group, send email to google-c...@googlegroups.com.
> >> >> > To unsubscribe from this group, send email to
> >> >> > google-code+unsubscr...@googlegroups.com >> >> >  oups.com>
> >> .
> >> >> > For more options, visit this group at
> >> >> >http://groups.google.com/group/google-code?hl=en.
>
> >> >> --
> >> >> You received this message because you are subscribed to the Google
> >> Groups
> >> >> "google-codejam" group.
> >> >> To post to this group, send email to google-c...@googlegroups.com.
> >> >> To unsubscribe from this group, send email to
> >> >> google-code+unsubscr...@googlegroups.com >> >>  oups.com>
> >> .
> >> >> For more options, visit this group at
> >> >>http://groups.google.com/group/google-code?hl=en.
>
> >> > --
> >> > You received this message because you are subscribed to the Google
> >> Groups
> >> > "google-codejam" group.
> >> > To post to this group, send email to google-c...@googlegroups.com.
> >> > To unsubscribe from this group, send email to
> >> > google-code+unsubscr...@googlegr

  1   2   >