On Sun, May 9, 2010 at 6:09 AM, Abdelrhman Abotaleb <
[email protected]> wrote:

> mmm
> To deduce all the patterns ; the overhead may be large
> number of groups are 10000
> 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 <[email protected]> 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
>> <[email protected]> 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 <[email protected]>
>> wrote:
>> >>
>> >> Hey i have also used only one loop for R (Number of rounds in one day)
>> >> but got some values of R about100000000 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 <[email protected]>
>> >> 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 <[email protected]>
>> 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 [email protected].
>> >> >> To unsubscribe from this group, send email to
>> >> >> [email protected]<google-code%[email protected]>
>> .
>> >> >> 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 [email protected].
>> >> > To unsubscribe from this group, send email to
>> >> > [email protected]<google-code%[email protected]>
>> .
>> >> > 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 [email protected].
>> >> To unsubscribe from this group, send email to
>> >> [email protected]<google-code%[email protected]>
>> .
>> >> 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 [email protected].
>> > To unsubscribe from this group, send email to
>> > [email protected]<google-code%[email protected]>
>> .
>> > 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 [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<google-code%[email protected]>
>> .
>> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-code%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-code?hl=en.
>

or rather you check out the shifts in the array, the moment the shift is
multiple of N, the pattern is repeated. no need even to compare with orignal
array.Efficiency at its best
(cummulative Cost array would better the solution).

-- 
-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.

Reply via email to