Re: [code jam] Code Jam Round 1B is happening soon!

2021-04-30 Thread Luke Pebody
Yes

On Mon, 26 Apr 2021, 14:27 Louis Yang,  wrote:

> Are we allowed to talk about the solution to the contest after the round
> finished?
>
> lu...@pebody.org 在 2021年4月25日 星期日上午8:41:45 [UTC-7] 的信中寫道:
>
>> Good luck everybody!
>>
>> On Sun, Apr 25, 2021 at 4:32 PM 'Chelsea Lieb' via Google Code Jam <
>> googl...@googlegroups.com> wrote:
>>
>>> Hi,
>>>
>>> Code Jam Round 1B is starting soon! Visit the schedule page
>>>  to see
>>> rounds in your browser's local time zone and to add events to your calendar.
>>>
>>> Important information for those who have qualified:
>>>
>>>-
>>>
>>>Round 1 is divided into three sub-rounds (1A, 1B and 1C). Each lasts
>>>for two hours and thirty minutes. Those who have qualified may compete in
>>>as many of the sub-rounds as you want, but if you place in the top 1500 
>>> in
>>>any sub-round, you'll qualify for Round 2 and won't be eligible to 
>>> compete
>>>in any later sub-rounds
>>>-
>>>
>>>Round results will not be immediately finalized when the round is
>>>over. Participants will be notified of their advancement status to Round 
>>> 2
>>>at least one day before that round by email from the Code Jam team.
>>>-
>>>
>>>Unlike in the Qualification Round, collaboration is strictly
>>>prohibited in Round 1 and all future rounds of Code Jam 2021. Section 7 
>>> of
>>>the Code Jam Terms
>>> 
>>> prohibits
>>>sharing or using from others any information about a problem before the 
>>> end
>>>of the round. Such actions that violate those Terms & Conditions will
>>>result in your disqualification. Moreover, please note that if you
>>>are utilizing a web integrated development environment (IDE), be sure to
>>>not publish your code or otherwise allow it to be publicly visible during
>>>the contest, or you could be subject to disqualification.
>>>
>>> If you have any questions, start by reviewing the FAQs
>>> . If you can't
>>> find an answer there, use the "Ask a Question" feature during the round for
>>> the quickest reply.
>>>
>>> Good luck to everyone participating!
>>>
>>> Chelsea, on behalf of the Code Jam Team
>>>
>>> --
>>> -- You received this message because you are subscribed to the Google
>>> Groups Code Jam group. To post to this group, send email to
>>> googl...@googlegroups.com. To unsubscribe from this group, send email
>>> to google-code...@googlegroups.com. For more options, visit this group
>>> at https://groups.google.com/d/forum/google-code?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Code Jam" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-code...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-code/a4af1242-5243-4b91-b515-1557ce45cf99n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> -- You received this message because you are subscribed to the Google
> Groups Code Jam 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 https://groups.google.com/d/forum/google-code?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/174ad8c6-6d62-48f6-9180-83bda31b9d64n%40googlegroups.com
> 
> .
>

-- 
-- You received this message because you are subscribed to the Google Groups 
Code Jam 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 
https://groups.google.com/d/forum/google-code?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-NY7rj5cDAO0n%2BAfndADV1Z1wF8y3avp%2BfcU5G4CK9%2BeQ%40mail.gmail.com.


Re: [code jam] Code Jam Round 1B is happening soon!

2021-04-26 Thread Luke Pebody
Yes I submitted the same code three times for problem C and it worked the
third time!

On Mon, 26 Apr 2021, 00:05 Bartholomew Furrow,  wrote:

> Great problems today! I have to admit that my solution to C was to invent
> some heuristics, then keep refining them until they had about a 50% chance
> of working, then submit until they succeeded. The DP solution is... a
> little more elegant.
>
> On Sun, Apr 25, 2021 at 9:41 AM Luke Pebody  wrote:
>
>> Good luck everybody!
>>
>> On Sun, Apr 25, 2021 at 4:32 PM 'Chelsea Lieb' via Google Code Jam <
>> google-code@googlegroups.com> wrote:
>>
>>> Hi,
>>>
>>> Code Jam Round 1B is starting soon! Visit the schedule page
>>> <https://codingcompetitions.withgoogle.com/codejam/schedule> to see
>>> rounds in your browser's local time zone and to add events to your calendar.
>>>
>>> Important information for those who have qualified:
>>>
>>>-
>>>
>>>Round 1 is divided into three sub-rounds (1A, 1B and 1C). Each lasts
>>>for two hours and thirty minutes. Those who have qualified may compete in
>>>as many of the sub-rounds as you want, but if you place in the top 1500 
>>> in
>>>any sub-round, you'll qualify for Round 2 and won't be eligible to 
>>> compete
>>>in any later sub-rounds
>>>-
>>>
>>>Round results will not be immediately finalized when the round is
>>>over. Participants will be notified of their advancement status to Round 
>>> 2
>>>at least one day before that round by email from the Code Jam team.
>>>-
>>>
>>>Unlike in the Qualification Round, collaboration is strictly
>>>prohibited in Round 1 and all future rounds of Code Jam 2021. Section 7 
>>> of
>>>the Code Jam Terms
>>><https://codingcompetitions.withgoogle.com/codejam/rulesandterms> 
>>> prohibits
>>>sharing or using from others any information about a problem before the 
>>> end
>>>of the round. Such actions that violate those Terms & Conditions will
>>>result in your disqualification. Moreover, please note that if you
>>>are utilizing a web integrated development environment (IDE), be sure to
>>>not publish your code or otherwise allow it to be publicly visible during
>>>the contest, or you could be subject to disqualification.
>>>
>>> If you have any questions, start by reviewing the FAQs
>>> <https://codingcompetitions.withgoogle.com/codejam/faq>. If you can't
>>> find an answer there, use the "Ask a Question" feature during the round for
>>> the quickest reply.
>>>
>>> Good luck to everyone participating!
>>>
>>> Chelsea, on behalf of the Code Jam Team
>>>
>>> --
>>> -- You received this message because you are subscribed to the Google
>>> Groups Code Jam 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 https://groups.google.com/d/forum/google-code?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Code Jam" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-code+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-code/a4af1242-5243-4b91-b515-1557ce45cf99n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/google-code/a4af1242-5243-4b91-b515-1557ce45cf99n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
>> -- You received this message because you are subscribed to the Google
>> Groups Code Jam 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 https://groups.google.com/d/forum/google-code?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/CAECKw-M3N0eMG22zfFmvm%2BFU

Re: [code jam] 2021 Round 1A - Hacked Exam

2021-04-25 Thread Luke Pebody
Basically, your strategy for a given question might as well depend only on
which of the candidates agreed with each other on the answer. (In that for
any two questions with the same agreements, agreeing with candidate 1 has
the same expected score, and since expectation is linear, you might as well
do the same for each).

For the two person situation, you therefore have 4 different strategies
based on
: * if the two students put the same answer, put the same answer as them or
the opposite answer
: * if the two students put different answers, put the same as student 1 or
student 2.

These four strategies work out as:
 (same => same, different => student 1): copy student 1
 (same => same, different => student 2): copy student 2
 (same => opposite, different => student 1): write the exact opposite of
student 2
 (same => opposite, different => student 2): write the exact opposite of
student 1

For the three person situation, there are 16 different strategies which are:
 1-3: copy student 1, 2 or 3
 4-6: write the exact opposite of student 1,2 or 3
 7: go with the majority
 8: disagree with the majority
 9: if they all agree, write the same as them, otherwise write the opposite
of student 1
10: if they all agree, write the same as them, otherwise write the opposite
of student 2
11: if they all agree, write the same as them, otherwise write the opposite
of student 3
12-14: write the opposite of strategy 9-11
15: if they all agree, write the same as them, otherwise write the opposite
of the majority
16: if they all agree, write the opposite of them, otherwise write the same
as the majority


On Sun, Apr 25, 2021 at 4:27 PM Jakub Nogły  wrote:

> Hi all,
>
> At the beginning I wanted to thank the code jam team for great problems.
> Keep up the good work!
>
> I have a question regarding the "Hacked Exam". The solution I submitted
> for the competition was to select the best or the worst score from the
> samples and return the same or "opposite" string (replace T with F and F
> with T). The expected score was the exact score this exam answer would have
> achieved. To my surprise it passed both tests for N=2. Obviously it did not
> work for the largest test case.
>
> Since this "solution" was not mentioned in the analysis I am curious if it
> was accident that it passed or indeed for N=2 we can't do better than
> replicating the best/worst answer. I could not prove the latter, maybe
> someone on this list has more idea about that?
>
> My hypothesis is that if question can have B possible answers then if we
> get B or less samples we can't do better than replicating worst/best one.
> In other words we can't get more insights about any of the questions in a
> sense.
>
> Thank you,
> Jakub
>
> --
> -- You received this message because you are subscribed to the Google
> Groups Code Jam 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 https://groups.google.com/d/forum/google-code?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CABoOB-XWUih3Fm48cd5N1xCy35VndbmLOnMim2isyR0ASvSWow%40mail.gmail.com
> 
> .
>

-- 
-- You received this message because you are subscribed to the Google Groups 
Code Jam 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 
https://groups.google.com/d/forum/google-code?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-N%3DYKXZ7gFiRai0W93ZkD-tLE8zHHo4GXfek4wykCcTmw%40mail.gmail.com.


Re: [code jam] Code Jam Round 1B is happening soon!

2021-04-25 Thread Luke Pebody
Good luck everybody!

On Sun, Apr 25, 2021 at 4:32 PM 'Chelsea Lieb' via Google Code Jam <
google-code@googlegroups.com> wrote:

> Hi,
>
> Code Jam Round 1B is starting soon! Visit the schedule page
>  to see
> rounds in your browser's local time zone and to add events to your calendar.
>
> Important information for those who have qualified:
>
>-
>
>Round 1 is divided into three sub-rounds (1A, 1B and 1C). Each lasts
>for two hours and thirty minutes. Those who have qualified may compete in
>as many of the sub-rounds as you want, but if you place in the top 1500 in
>any sub-round, you'll qualify for Round 2 and won't be eligible to compete
>in any later sub-rounds
>-
>
>Round results will not be immediately finalized when the round is
>over. Participants will be notified of their advancement status to Round 2
>at least one day before that round by email from the Code Jam team.
>-
>
>Unlike in the Qualification Round, collaboration is strictly
>prohibited in Round 1 and all future rounds of Code Jam 2021. Section 7 of
>the Code Jam Terms
> prohibits
>sharing or using from others any information about a problem before the end
>of the round. Such actions that violate those Terms & Conditions will
>result in your disqualification. Moreover, please note that if you are
>utilizing a web integrated development environment (IDE), be sure to not
>publish your code or otherwise allow it to be publicly visible during the
>contest, or you could be subject to disqualification.
>
> If you have any questions, start by reviewing the FAQs
> . If you can't
> find an answer there, use the "Ask a Question" feature during the round for
> the quickest reply.
>
> Good luck to everyone participating!
>
> Chelsea, on behalf of the Code Jam Team
>
> --
> -- You received this message because you are subscribed to the Google
> Groups Code Jam 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 https://groups.google.com/d/forum/google-code?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/a4af1242-5243-4b91-b515-1557ce45cf99n%40googlegroups.com
> 
> .
>

-- 
-- You received this message because you are subscribed to the Google Groups 
Code Jam 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 
https://groups.google.com/d/forum/google-code?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-M3N0eMG22zfFmvm%2BFUVXe4MXU%2BVtOcNZRwmjjq6foyMA%40mail.gmail.com.


Re: [code jam] Code Jam 2021 - Round 1A - Problem B - Magic number 3025

2021-04-10 Thread Luke Pebody
3025 is 31+499x6 and 31*499^6 is just lower than 499*10^15, while 37*499^6
is more than it.

On Sat, 10 Apr 2021, 10:55 Luke Pebody,  wrote:

> The reason the number is not actually as high as 29940 is because 499^60
> is WAY larger than 2^60.
>
>
>
> On Sat, 10 Apr 2021, 10:47 priyank doshi, 
> wrote:
>
>>
>> There is a magic number 3025! In problem analysis, it is mentioned that
>> the actual maximum possible sum of the second group numbers is 3025
>> under the problem's constraint
>> Now I can't figure out what is the logic behind this. I understood we
>> need to see numbers upto X - 29940 and X but can someone explain reasons
>> behind 3025 and how it is derived.
>>
>> --
>> -- You received this message because you are subscribed to the Google
>> Groups Code Jam 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 https://groups.google.com/d/forum/google-code?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/7b8fd0c8-931d-4007-b485-7db39ce8a695n%40googlegroups.com
>> <https://groups.google.com/d/msgid/google-code/7b8fd0c8-931d-4007-b485-7db39ce8a695n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
-- You received this message because you are subscribed to the Google Groups 
Code Jam 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 
https://groups.google.com/d/forum/google-code?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-PetaM0iBr%2B7ZcGkoaoZ1DzWw2NVozdBf1rZBZZBu0Kxw%40mail.gmail.com.


Re: [code jam] Code Jam 2021 - Round 1A - Problem B - Magic number 3025

2021-04-10 Thread Luke Pebody
The reason the number is not actually as high as 29940 is because 499^60 is
WAY larger than 2^60.



On Sat, 10 Apr 2021, 10:47 priyank doshi, 
wrote:

>
> There is a magic number 3025! In problem analysis, it is mentioned that
> the actual maximum possible sum of the second group numbers is 3025 under
> the problem's constraint
> Now I can't figure out what is the logic behind this. I understood we need
> to see numbers upto X - 29940 and X but can someone explain reasons
> behind 3025 and how it is derived.
>
> --
> -- You received this message because you are subscribed to the Google
> Groups Code Jam 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 https://groups.google.com/d/forum/google-code?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/7b8fd0c8-931d-4007-b485-7db39ce8a695n%40googlegroups.com
> 
> .
>

-- 
-- You received this message because you are subscribed to the Google Groups 
Code Jam 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 
https://groups.google.com/d/forum/google-code?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-PFotqPf4Y_DDpL87gFrQgiL52bB5v3cUCPcTC6N%3DB8%2Bw%40mail.gmail.com.


Re: [gcj] Round 1B 2020 Blindfolded Bullseye: method of finding initial point in dartboard

2020-04-22 Thread Luke Pebody
One possible issue in your problem is you don't check any of the initial
queries for if they are equal to 'CENTER'

On Wed, 22 Apr 2020, 16:32 Arti Schmidt,  wrote:

> In Round 1B 2020 I'm getting TLE on test set 3 for Blindfolded Bullseye
> using nearly the same strategy explained in the analysis (binary search
> from a point in the dartboard to the edge of the wall in four directions
> and find midpoints). The only difference is how I am finding the initial
> point inside the dartboard. I queried points (-10^9/2, 0), (10^9/2, 0), (0,
> -10^9/2), and (0, 10^9/2). I thought this would ensure that at least one
> point is in the dartboard, but I must be missing something because when I
> add a few additional points to query my program passes all test sets. My
> full program is below, can anyone tell me why it doesn't work with just the
> four mentioned points?
>
> bound_max = 10 ** 9
> t, a, b = map(int, input().split())
>
> def query(x, y):
>   print(x, y)
>   return input()
>
> def binary_search(lower, upper, axis, pos, miss_lower):
>   while lower < upper:
> mid = (lower + upper) // 2
> point = (mid, pos) if axis == 'x' else (pos, mid)
> if query(*point) == 'MISS':
>   if miss_lower:
> lower = mid + 1
>   else:
> upper = mid - 1
> else:
>   if miss_lower:
> upper = mid - 1
>   else:
> lower = mid + 1
>   return upper if upper > -bound_max else -bound_max
>
> for case in range(t):
>
>   # fails with these points
>   points = (
> (-bound_max // 2, 0),
> (bound_max // 2, 0),
> (0, -bound_max // 2),
> (0, bound_max // 2)
>   )
>
>   # succeeds with these points
>   points = (
> (-bound_max // 2, -bound_max // 2),
> (0, -bound_max // 2),
> (bound_max // 2, -bound_max // 2),
> (-bound_max // 2, 0),
> (0, 0),
> (bound_max // 2, 0),
> (-bound_max // 2, bound_max // 2),
> (0, bound_max // 2),
> (bound_max // 2, bound_max // 2),
>   )
>
>   for point in points:
> if query(*point) == 'HIT':
>   hit_x, hit_y = point
>   break
>
>   left = binary_search(-bound_max, hit_x, 'x', hit_y, True)
>   right = binary_search(hit_x, bound_max, 'x', hit_y, False)
>   bot = binary_search(-bound_max, hit_y, 'y', hit_x, True)
>   top = binary_search(hit_y, bound_max, 'y', hit_x, False)
>
>   x = (left + right) // 2
>   y = (bot + top) // 2
>
>   done = False
>   for i in range(-2, 3):
> for j in range(-2, 3):
>   if query(x + i, y + j) == 'CENTER':
> done = True
> break
> if done:
>   break
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/3cba1a61-2b8b-4925-ade2-2534fb88dc3f%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-NnefCPqLPh24NoniJVJ_tafZ6XcqRtgoTgj-zq-t3YzA%40mail.gmail.com.


Re: [gcj] Cryptopanagram problem: sample failed RE

2020-03-14 Thread Luke Pebody
Case #{1} looks funny to me. Shouldn't it be Case #{k}?

On Fri, Mar 13, 2020 at 7:47 PM Benjamin Ononogbu 
wrote:

> Hi every one i recently registered for the code jam 2020, so i was trying
> my hands on some past problem like the Cryptopanagram
> but when i post my solution, the online judge keep showing sample failed
> RE. am using python3 and i ran those samples locally and it worked.
> i have been checking for bugs for long now but could not find one.Any
> assistance will be greatly appreciated. i used sympy module before but the
> error pesist.so i removed it and wrote a simple prime factorisation
> function(the factor function).please i really need help on this,because it
> is really energy sapping
> here's my code:
>
>
> from math import *
>
> def factor(q):
> m = floor(sqrt(q))
> y = []
> for k in range(2,m):
> if q % k == 0:
> y.append(k)
> break
> y.append(q//k)
> return y
>
>
> def reppt(li):
> nlist = []
> for k in li:
> if k in nlist:
> continue
> else:
> nlist.append(k)
> return nlist
>
>
> def decrypt(n):
> n = [int(x) for x in n.split()]
> z = []
> y = factor(n[0])
> if n[1] % y[0] == 0:
> a = y[0]
> z.append(y[-1])
> else:
> a = y[-1]
> z.append(y[0])
> for k in n[1:]:
> z.append(a)
> a = k//a
> z.append(a)
> m = reppt(z)
> m.sort()
> alpha =
> ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
> plaintext = ''
> for l in z:
> r = m.index(l)
> plaintext += alpha[r]
> return plaintext
>
>
>
> def main():
> T = int(input())
> for k in range(1,T+1):
> x,y = [int(a) for a in input().split()]
> n = input()
> print(f'Case #{1}: {decrypt(n)}')
>
> main()
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/9021d1b6-48cc-46f3-8a4d-ba9d40300171%40googlegroups.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-NSkdrWigwG06L%2BWvtgbbmBjKrDHqCMjTLzYdkmZyut%2Bw%40mail.gmail.com.


Re: [gcj] Registration is open! New scoring rules

2020-03-10 Thread Luke Pebody
Aha indeed you did. Clear now. Thanks!

On Tue, 10 Mar 2020, 15:35 Bartholomew Furrow,  wrote:

> In C, I got my second submission's visible set wrong. In that scenario, my
> first submission is the "latest submission that passes all Visible Verdict
> Test Sets," so it can receive points for the Hidden Verdict Test Set.
>
> On Tue, Mar 10, 2020 at 9:21 AM Luke Pebody  wrote:
>
>> I think you mistyped Situation B? Seems to be the same as Situation C.
>>
>> On Tue, 10 Mar 2020, 15:15 Bartholomew Furrow,  wrote:
>>
>>> I just got an email from the Code Jam Team. It said:
>>>
>>> 1. Registration is open. Presumably you can access that at
>>> https://g.co/codejam.
>>> 2. There are small changes to the rules for scoring.
>>>
>>> I've copy/pasted them here for discussion:
>>>
>>> (C) Points on Hidden Verdict Test Sets. For each problem, only the
>>>> latest submission that passes all Visible Verdict Test Sets can possibly
>>>> receive points for the Hidden Verdict Test Sets. All other submissions will
>>>> be rejected on all Hidden Verdict Test Sets.
>>>> (D) Primary Submission. The primary submission for each problem is the
>>>> submission with the largest sum of the values of all passed test sets on
>>>> that problem (the submission’s score), breaking ties by selecting the one
>>>> with the earliest submission time.
>>>> If no submission received points for a problem, then there is no
>>>> primary submission for that problem and you receive a score of zero (0) for
>>>> that problem.
>>>
>>>
>>> I *believe* this addresses some frustrations of previous years. I'll
>>> walk through a few scenarios.
>>>
>>> Imagine I have a problem with a visible set worth 10 points, and a
>>> hidden set worth 20 points.
>>>
>>> *Situation A:*
>>> 1. I submit a problem get the visible set right, but the hidden set
>>> wrong, at 1 hour.
>>> 2. I submit again and get the visible set right, but the hidden set
>>> wrong, at 2 hours.
>>>
>>> My score is 10 points, and my penalty time is 1 hour.
>>> Under the previous rules, my score would be 10 points and my penalty
>>> time would be 2 hours, 4 minutes.
>>>
>>> *Situation B:*
>>> 1. I submit a problem get the visible set right, and the hidden set
>>> right, at 1 hour.
>>> 2. I submit again and get the visible set right, but the hidden set
>>> wrong, at 2 hours.
>>>
>>> My score is 10 points, and my penalty time is 1 hour.
>>> Under the previous rules, my score would be 10 points and my penalty
>>> time would be 2 hours, 4 minutes.
>>>
>>> *Situation C:*
>>> 1. I submit a problem get the visible set right, and the hidden set
>>> right, at 1 hour.
>>> 2. I submit again and get the visible set wrong, and the hidden set
>>> wrong, at 2 hours.
>>>
>>> My score is 30 points, and my penalty time is 1 hour.
>>> I forget how the old scoring system would have scored this.
>>>
>>>
>>> I hope that's helpful!
>>> Bartholomew
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Code Jam" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-code+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-code/CAHaiWHMz%2BHY2YTGbXUB7Q4eB6pjezsFG-rb2uhgWQ8-E430z4A%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/google-code/CAHaiWHMz%2BHY2YTGbXUB7Q4eB6pjezsFG-rb2uhgWQ8-E430z4A%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/CAECKw-MPf5L-LGLxc7eR6YFsbRVcRg4dEfHwXe_cHF8yQ8SdVQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/google-code/CAECKw-MPf5L-LGLxc7eR6YFsbRVcRg4dEfHwXe_cHF8yQ8SdVQ%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CAHaiWHO3Kx9kMS1%2BqU0JiSDHgXv5uMvd-do7BMpPiV3NgpzRhg%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-code/CAHaiWHO3Kx9kMS1%2BqU0JiSDHgXv5uMvd-do7BMpPiV3NgpzRhg%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-OvzDZjq2G-uR6q%2BunDFwNF5P-9ynehnJCUAOqGKkEg%3DQ%40mail.gmail.com.


Re: [gcj] Registration is open! New scoring rules

2020-03-10 Thread Luke Pebody
I think you mistyped Situation B? Seems to be the same as Situation C.

On Tue, 10 Mar 2020, 15:15 Bartholomew Furrow,  wrote:

> I just got an email from the Code Jam Team. It said:
>
> 1. Registration is open. Presumably you can access that at
> https://g.co/codejam.
> 2. There are small changes to the rules for scoring.
>
> I've copy/pasted them here for discussion:
>
> (C) Points on Hidden Verdict Test Sets. For each problem, only the latest
>> submission that passes all Visible Verdict Test Sets can possibly receive
>> points for the Hidden Verdict Test Sets. All other submissions will be
>> rejected on all Hidden Verdict Test Sets.
>> (D) Primary Submission. The primary submission for each problem is the
>> submission with the largest sum of the values of all passed test sets on
>> that problem (the submission’s score), breaking ties by selecting the one
>> with the earliest submission time.
>> If no submission received points for a problem, then there is no primary
>> submission for that problem and you receive a score of zero (0) for that
>> problem.
>
>
> I *believe* this addresses some frustrations of previous years. I'll walk
> through a few scenarios.
>
> Imagine I have a problem with a visible set worth 10 points, and a hidden
> set worth 20 points.
>
> *Situation A:*
> 1. I submit a problem get the visible set right, but the hidden set wrong,
> at 1 hour.
> 2. I submit again and get the visible set right, but the hidden set wrong,
> at 2 hours.
>
> My score is 10 points, and my penalty time is 1 hour.
> Under the previous rules, my score would be 10 points and my penalty time
> would be 2 hours, 4 minutes.
>
> *Situation B:*
> 1. I submit a problem get the visible set right, and the hidden set right,
> at 1 hour.
> 2. I submit again and get the visible set right, but the hidden set wrong,
> at 2 hours.
>
> My score is 10 points, and my penalty time is 1 hour.
> Under the previous rules, my score would be 10 points and my penalty time
> would be 2 hours, 4 minutes.
>
> *Situation C:*
> 1. I submit a problem get the visible set right, and the hidden set right,
> at 1 hour.
> 2. I submit again and get the visible set wrong, and the hidden set wrong,
> at 2 hours.
>
> My score is 30 points, and my penalty time is 1 hour.
> I forget how the old scoring system would have scored this.
>
>
> I hope that's helpful!
> Bartholomew
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CAHaiWHMz%2BHY2YTGbXUB7Q4eB6pjezsFG-rb2uhgWQ8-E430z4A%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-MPf5L-LGLxc7eR6YFsbRVcRg4dEfHwXe_cHF8yQ8SdVQ%40mail.gmail.com.


Re: [gcj] Python/pypy viability for future Codejam rounds

2019-05-01 Thread Luke Pebody
No

On Wed, 1 May 2019, 1:46 pm Alex Wice,  wrote:

> @Luke Are you a codejam staff member?
>
> On Tuesday, April 30, 2019 at 11:09:42 PM UTC+9, Luke Pebody wrote:
> > Also, no the problems are not specifically tested to be solvable in
> Python
> >
> >
> > On Tue, 30 Apr 2019, 3:08 pm Luke Pebody,  wrote:
> >
> > I did Problem C large in Python
> >
> >
> > On Tue, 30 Apr 2019, 3:05 pm Alex Wice,  wrote:
> > In 2019 round 1B, problem C large doesn't seem to be possible with Pypy.
> >
> > If this is true, are the problems not specifically tested to be possible
> with Python?
> >
> >
> >
> > --
> >
> > You received this message because you are subscribed to the Google
> Groups "Google Code Jam" group.
> >
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to googl...@googlegroups.com.
> >
> > To post to this group, send email to googl...@googlegroups.com.
> >
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/720185a5-eddf-4977-8058-377f23c5574f%40googlegroups.com
> .
> >
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/c92a77c2-a2de-48b4-ab53-a8f1c5969c57%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-OL0b5Zk%2B2WS35uz2g%3D-PGfk6BunOum-9pBj2c0efkJdw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Is the scoring rule strange?

2019-05-01 Thread Luke Pebody
Yes, this is correct.

On Wed, 1 May 2019, 1:46 pm 姚炫容,  wrote:

> Bartholomew Furrow於 2019年4月30日星期二 UTC+8下午11時09分58秒寫道:
> > During the contest, you can't see whether you solved hidden inputs
> correctly or not. The score you see on the scoreboard, which I'll call your
> "apparent score," is what your score would be if you solved every possible
> hidden input correctly. If you make an additional attempt, your apparent
> score can only get worse -- but your real score might get better.
> > For example, if you first submit O(N^2) code for a problem with a hidden
> input of size 10^6, then later submit O(N) code, your apparent score goes
> down (because your submission is now later), but your actual score could go
> up.
> >
> >
> > Does that help?
> > Bartholomew
> >
> >
> > On Tue, Apr 30, 2019 at 8:05 AM 姚炫容  wrote:
> > Once your attempt solve all the test set(visible and hidden), then any
> additional attempt will lower your final score for penalty time, or even
> for the score.
> >
> >
> >
> > Is it right?
> >
> >
> >
> > --
> >
> > You received this message because you are subscribed to the Google
> Groups "Google Code Jam" group.
> >
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to googl...@googlegroups.com.
> >
> > To post to this group, send email to googl...@googlegroups.com.
> >
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/033b23a0-066c-43b2-8499-ac06b80872df%40googlegroups.com
> .
> >
> > For more options, visit https://groups.google.com/d/optout.
>
> yes, but if my first submit is O(N) and solve all the test set, then any
> additional submit will make my score worse.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/957cd774-75b9-4c65-bc17-4856b522b17e%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-MshbPGHjUyBQO75u7oiHXK%3DVv00yXts8o-aB4vmS0JLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Python/pypy viability for future Codejam rounds

2019-05-01 Thread Luke Pebody
This was my source code:
from sys import stdin, stdout, stderr

def get_int():
return int(stdin.readline())

def get_ints():
return tuple(int(z) for z in stdin.readline().split())

# Quickly calculate cumulative sums of a sequence
# And quickly increment or decrement individual elements of it
class seq:
def __init__(self, n):
self.n = n
self.a = [0] * (n + 1)

def inc(self, i, j):
while i <= self.n:
self.a[i] += j
i += (i & -i)

def cumul(self, i):
tot = 0
while i > 0:
tot += self.a[i]
i -= (i & -i)
return tot

class SpecialSet:
def __init__(self, n):
self.n = n
self.abv = seq(n+2)
self.abv.inc(1, n+2)
self.blw = seq(n+2)
self.blw.inc(1, 1)

def remove(self,k):
b = self.blw.cumul(k)
dif = self.abv.cumul(b) - k
self.abv.inc(b, dif)
self.abv.inc(k, -dif)

a = self.abv.cumul(k)
dif = self.blw.cumul(a) - k
self.blw.inc(a + 1, -dif)
self.blw.inc(k + 1, dif)

def add(self, k):
b = self.blw.cumul(k)
dif = self.abv.cumul(b) - k
self.abv.inc(b, -dif)
self.abv.inc(k, dif)

a = self.abv.cumul(k)
dif = self.blw.cumul(a) - k
self.blw.inc(a + 1, dif)
self.blw.inc(k + 1, -dif)

def above(self, k):
return self.abv.cumul(k)

def below(self, k):
return self.blw.cumul(k)

def scr(i, lE, hE, tL, tH):
return max(tH-i,0)*max(min(i,lE)-tL,0) +
max(tH-max(hE,i),0)*max(i-max(lE,tL),0)

other = {'C':'D','D':'C'}

for cn in xrange(1,1+get_int()):
(N,K) = get_ints()
cs = get_ints()
ds = get_ints()
swords = [(cs[i],i+2,'C') for i in xrange(N)]+[(ds[i],i+2,'D') for i in
xrange(N)]
swords.sort()

stillValid = {}
stillValid['C'] = SpecialSet(N)
stillValid['D'] = SpecialSet(N)

tooGood = {}
tooGood['C'] = SpecialSet(N)
tooGood['D'] = SpecialSet(N)

w = 2 * N - 1
w2 = 2 * N - 1

tot = 0
while w >= 0:
(str, indx, p) = swords[w]
# sword is valid
stillValid[p].add(indx)
# remove swords that aare stronger than K + str
while swords[w2][0] > K + str:
tooGood[swords[w2][2]].add(swords[w2][1])
w2 -= 1
# count the number of ranges that:

# (i) do not include any too good sword
tooHigh = min(tooGood[q].above(indx-1) for q in 'CD')
tooLow = max(tooGood[q].below(indx+1) for q in 'CD')

# (ii) do not include any other still valid sword for p
tooHigh = min(tooHigh, stillValid[p].above(indx))
tooLow = max(tooLow, stillValid[p].below(indx))

# (iii) do include a still valid sword for otherp
otherp = other[p]
highEnough = stillValid[otherp].above(indx-1)
lowEnough = stillValid[otherp].below(indx+1)

sc = scr(indx, lowEnough, highEnough, tooLow, tooHigh)
tot += sc
w -= 1

print "Case #{}: {}".format(cn, tot)
if (cn == -1):
break

On Tue, Apr 30, 2019 at 3:09 PM Luke Pebody  wrote:

> Also, no the problems are not specifically tested to be solvable in Python
>
> On Tue, 30 Apr 2019, 3:08 pm Luke Pebody,  wrote:
>
>> I did Problem C large in Python
>>
>> On Tue, 30 Apr 2019, 3:05 pm Alex Wice,  wrote:
>>
>>> In 2019 round 1B, problem C large doesn't seem to be possible with Pypy.
>>> If this is true, are the problems not specifically tested to be possible
>>> with Python?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Code Jam" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-code+unsubscr...@googlegroups.com.
>>> To post to this group, send email to google-code@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-code/720185a5-eddf-4977-8058-377f23c5574f%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-O-x-HhfcsfKx9swsF-ixm3HC3ZKWN65DFTN4iThoBqAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Python/pypy viability for future Codejam rounds

2019-04-30 Thread Luke Pebody
Also, no the problems are not specifically tested to be solvable in Python

On Tue, 30 Apr 2019, 3:08 pm Luke Pebody,  wrote:

> I did Problem C large in Python
>
> On Tue, 30 Apr 2019, 3:05 pm Alex Wice,  wrote:
>
>> In 2019 round 1B, problem C large doesn't seem to be possible with Pypy.
>> If this is true, are the problems not specifically tested to be possible
>> with Python?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/720185a5-eddf-4977-8058-377f23c5574f%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-OVB1mZi-6XYb5RyqBfqJBBobMsGMn7wo6CNUnn3gG9Eg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Python/pypy viability for future Codejam rounds

2019-04-30 Thread Luke Pebody
I did Problem C large in Python

On Tue, 30 Apr 2019, 3:05 pm Alex Wice,  wrote:

> In 2019 round 1B, problem C large doesn't seem to be possible with Pypy.
> If this is true, are the problems not specifically tested to be possible
> with Python?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/720185a5-eddf-4977-8058-377f23c5574f%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-PnM4qED7adeVmjWD_dm60yPbhTCVvnGp_WOK4p6B_R1w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] GCJ 2019 Qualification Round: Cryptopangram; help me resolve RE status

2019-04-08 Thread Luke Pebody
What is RE? If you are running out of time, it could be because the primes
are too big to find by trial division.

On Mon, 8 Apr 2019, 6:33 pm ACTECH,  wrote:

> Hi,
> Can you provide any specific testcases which you considered?
> Because I also considered the scenario you depicted here, still got RE..
> It would be great if you could give an example if what case you are
> talking about.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/a1aadc24-9f49-4150-b50b-56e782c2e693%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CADat-Ge-29FDGhpSZ%3Dn-oi6u7aeuHU5cq%3D_XoSmXcoLJtUu8Og%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Doubt regarding logic for 2nd problem of CodeJAM 2019

2019-04-08 Thread Luke Pebody
Mine was to walk down the diagonal making sure that each time you stopped
off the diagonal you were the opposite side of the diagonal from Angela or
whatever the other walker was called.

On Sun, 7 Apr 2019, 10:36 pm Ronan Burke,  wrote:

> My solution for this one was to just do the opposite of the route the
> other person took. If you did something other than, I imagine things could
> get quite messy and it would be easy to make a mistake.
>
> Their route: "SSEESE" then I would do "EESSES"
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/7f2f7c1f-1e3c-46ed-8253-af9d8beeae07%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-Nezk_QDo%3Ds_aeK9O0uZH9QfSVXj44AtVrgmXmvVny-CA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Timing

2019-04-04 Thread Luke Pebody
Wait it's this weekend?!

On Thu, 4 Apr 2019, 5:12 pm Bartholomew Furrow,  wrote:

> You can look at the Code Jam homepage
> , where there's a
> countdown in the top-left corner, saying that it starts in about 1 day, 7
> hours.
> You can also look at the schedule
> , which says
> that it starts at Apr 5 2019, 23:00 UTC. There's a slider at the top that
> lets you change it to your local timezone. There's also a little "calendar"
> button so you can add it to your calendar at the right time.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CAHaiWHPvfCKykMXu1XhJ2pMJgQOFsVvEczSsQL6N98wevSPKbA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-NHDj2a0KgWjhaaA9%3DNfK0-vjO52EdcrsWOpUc-BACnbA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Qualification Round 2018 Trouble Sort RunTime Error

2019-03-20 Thread Luke Pebody
You seem to be assuming all the integers are single digits.

On Wed, 20 Mar 2019, 5:29 pm Παυλος Τιριτιρης  Here is my code in C++ i tried a lot and i didn't find anything , i would
> appreciate if someone finds where the error is.
>
>
> #pragma GCC optimize "O3,inline"
> #include 
> #include 
> #include 
> #include 
>
> using namespace std;
>
>
>
> int checkSort(int *even,int *odd,int len){
> int i=0;
> while(i<(len-1)/2){
> if(even[i]>odd[i]){
> return 2*i;
> }else if(odd[i]>even[i+1]){
> return 2*i+1;
> }
> ++i;
> }
>
> return -1;
> }
> int main() {
> int N;
> cin>>N;cin.ignore();
> char *buff=(char *)malloc(50);
> int *evenlist=(int *)malloc(4*20);
> int *oddlist=(int *)malloc(4*20);
> for(int i=0;i int len,len0,len1;
> cin>>len;cin.ignore();
> len0=(len+1)/2;
> len1=len/2;
> cin.read(buff,len*2 - 1);cin.ignore();
> for(int j=0;j evenlist[j]=buff[4*j]-48;
> oddlist[j]=buff[4*j + 2]-48;
> }
>
> if(len%2==1){
> evenlist[len0-1]=buff[4*(len0-1)]-48;
> }
> sort(evenlist,evenlist+len0);
> sort(oddlist,oddlist+len1);
> int check=checkSort(evenlist,oddlist,len);
> if(check==-1){
> cout<<"Case #"< }else{
> cout<<"Case #"< }
> }
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/b8903bd2-756b-48e5-87e7-ad2bc7028a81%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-MwnADLcoGxL181z%2BqBTpga%3D%3DWGNWmXx3jUxMBC2uDFRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Qualification Round 2018 Trouble Sort

2019-03-18 Thread Luke Pebody
I don't actually know what language this is. They all look the same to me
now. But I think the things in your sequence ls are strings and you need to
convert them to integers.

On Mon, 18 Mar 2019, 8:00 pm Ho Wei Hong 
>
>
> Hi all,
>
> I am having some problems with my code. I think I have the answer but
> somehow the grader mark me wrongly. I can't think of any cases that I might
> have miss out. I be glad if somebody can enlighten me. I placed the link of
> problem here for easy access
>
>
> https://codingcompetitions.withgoogle.com/codejam/round/00cb/79cb
>
>
> def main():
> for i in range(int(input())):
> n = int(input())
> ls = input().split(" ")
> c = sol(ls,n)
> print("Case #{}: {}".format(i+1, c))
>
> def sol(ls,n):
> ls1=[]
> ls2=[]
> i=0
> while i if i%2==0:
> ls1.append(ls[i])
> else:
> ls2.append(ls[i])
> i+=1
> ls1.sort()
> ls2.sort()
> #print(ls1,'\n',ls2)
> b=0
> e1,e2=0,0
> for i in range(n//2):
> if ls1[i]>ls2[i]:
> #print(ls1[i],ls2[i])
> e1 = 2*i
> b+=1
> break
> for i in range((n-1)//2):
> if ls2[i]>ls1[i+1]:
> e2 = 2*(i+1)-1
> b+=1
> break
> if b==2:
> return min(e1,e2)
> elif b==1: return max(e1,e2)
> else: return 'OK'
>
> main()
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/720d21f7-06c6-44d9-b676-eaf76231a502%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-NfSsc390aYo_zQZFrXELeToOiE1u73Q6dPk-iWpcQRZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Explanation to a past contest problem

2019-03-06 Thread Luke Pebody
You are supposed to work out if you can take the collection of all of the
names given and split them into two groups Group A and Group B so that each
of the pairs listed has one name in Group A and one name in Group B.

On Wed, 6 Mar 2019, 3:12 pm Harshad  Hello,
> I didn't understand what this problem statement wants us to do, and I'd
> really like it if someone helps me out.
>
> Link: https://code.google.com/codejam/contest/2933486/dashboard
> Details: The input is a pair of troublesome members. What do the multiple
> pairs with the same name mean? How will I judge if two groups can be
> separated or not? Requesting help ASAP.
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/7dbf9cf8-3df6-4c46-9121-1c55a92a7111%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-Oazoqe85JW%2Bd6JmUEmtRnCk%2BTWh0PoG3H1fBwJOkV2OQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Runtime Error problem about input and output

2019-02-13 Thread Luke Pebody
Yeah I used it once 11 years ago. Some aspects of the syntax might have
been forgotten.

I use C# for work and I know their syntaces are somewhat similar. Don't
know the differences.

On Wed, 13 Feb 2019, 11:56 am Bartholomew Furrow  Luke, you've just made me go through go-hero.net/jam to see whether you
> ever used Java before. Apparently you used it for Round 1A's problem B in
> 2008, and apparently not since then. I guess the dozens of languages you
> used in between provide *some* excuse for not remembering.
>
> On Wed, Feb 13, 2019 at 9:29 AM Luke Pebody  wrote:
>
>> Guessing the error is in the out: you are adding a string to an integer.
>> This works in JavaScript but not in most languages. Which language are you
>> using?
>>
>> On Wed, 13 Feb 2019, 11:23 am Ayyuce Demirbas >
>>> Hello,
>>>
>>>
>>> I am trying to submit my solution but I get a runtime error. I think the
>>> problem is about input and output.
>>>
>>>
>>> I use these ways to receive inputs and write outputs
>>>
>>>
>>> //For inputs
>>>
>>>  Scanner in = new Scanner(new BufferedReader(new
>>> InputStreamReader(System.in)));
>>>
>>> //For outputs
>>>
>>>System.out.println("Case #" + i + ": " + (n + m) + " " + (n * m));
>>>
>>>
>>>
>>> How can I solve this problem?
>>>
>>>
>>> Thank you so much!
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Code Jam" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-code+unsubscr...@googlegroups.com.
>>> To post to this group, send email to google-code@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-code/cae3d61d-dbfe-48de-bd52-69c457522378%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/CAECKw-MwRxWA4GshBFa%3Dza7HyBxfk439LHfAYBfU4VsGLXCe%3Dw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/google-code/CAECKw-MwRxWA4GshBFa%3Dza7HyBxfk439LHfAYBfU4VsGLXCe%3Dw%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CAHaiWHMqxLHrWhJZAFyydS%3DGv_D4REPJEGhEPhcahNscndGdZw%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-code/CAHaiWHMqxLHrWhJZAFyydS%3DGv_D4REPJEGhEPhcahNscndGdZw%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-P-S3zPwMbSx2DHyz1oO%2BR%2Bkm8kGxjJukmVrP7K_vNVuQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Runtime Error problem about input and output

2019-02-13 Thread Luke Pebody
Guessing the error is in the out: you are adding a string to an integer.
This works in JavaScript but not in most languages. Which language are you
using?

On Wed, 13 Feb 2019, 11:23 am Ayyuce Demirbas  Hello,
>
>
> I am trying to submit my solution but I get a runtime error. I think the
> problem is about input and output.
>
>
> I use these ways to receive inputs and write outputs
>
>
> //For inputs
>
>  Scanner in = new Scanner(new BufferedReader(new
> InputStreamReader(System.in)));
>
> //For outputs
>
>System.out.println("Case #" + i + ": " + (n + m) + " " + (n * m));
>
>
>
> How can I solve this problem?
>
>
> Thank you so much!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/cae3d61d-dbfe-48de-bd52-69c457522378%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-MwRxWA4GshBFa%3Dza7HyBxfk439LHfAYBfU4VsGLXCe%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Round1c Ant stack issue ?

2018-05-08 Thread Luke Pebody
1 2 3 1 2 3 4 is valid

On Wed, 9 May 2018, 12:00 am Sergio Dos Santos, 
wrote:

> Hi,
>
> I have one test case for which I don't understand the output of most of
> the valid solutions.
>
> If I consider the following test case :
>
> 1
> 11
> 43 7 1 2 3 43 7 1 2 3 4
>
> As far as I have understood the problem, the possible stacks are the
> following : 1 2 3 43 and 1 2 3 4. They both have a length of 4.
>
> However solution in rank #1 (and all valid solutions I've checked so far)
> return 7.
>
> What have I missed ?
>
> Thanks,
> Sergio
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/e82a8a6a-659b-49ab-b95f-c5766ce47afa%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-Odke_C0Sz%3DbsjDYqAZ6md6fcaE8YErQ9er7LUQ4Uc7kw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Mystery Square

2018-04-20 Thread Luke Pebody
As the only person who solved the large on that question, the analysis
nails exactly what I did. The idea is that the first half or second half of
a square is enough to determine it. There are 40 missing digits and at most
20 of them are in the first half or second half. 2^20 is a million* and so
you can run all possibilities and see if they make a square. There are some
slight issues with having 00 at the end.

Interestingly we had 8 minutes to submit and my code gave me about 5
seconds to spare. This is what you get for using python and not using pypy

On Thu, 19 Apr 2018, 3:37 am Serhat Giydiren, 
wrote:

> Hi all.
>
> I am reviewing past problems. Is there anyone who has another analysis /
> approach for the following problem.
>
> https://code.google.com/codejam/contest/1158485/dashboard#s=p3
>
> I could not get the following analysis.
>
> https://code.google.com/codejam/contest/1158485/dashboard#s=a=3
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/e6eb907d-b701-4dbf-8103-873da5bedac1%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-NV73083b_xFemiiZyXqhusUfLw-pmv2rYNeXgSZ5L%2Btg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: practice mode + downgrading other contestants' code is live on our site!

2018-04-20 Thread Luke Pebody
Who me? I came 2404th in the Qualification Round. I found Problem C
interesting.

On Fri, 20 Apr 2018, 9:45 pm Bartholomew Furrow,  wrote:

> I've been waiting for this. Okay Luke, what's your rank in the rounds so
> far?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CAHaiWHPJQ-tb96mrPJjKZBgn4oTm_VXtjJc300_esmg6eywMqA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-PzyknqGzOd7L89bqdvvrBbEFL3tF%3DJwh4HUETBSBHYSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Practice mode coming soon!

2018-04-19 Thread Luke Pebody
[+1]

On Thu, Apr 19, 2018 at 11:37 PM, Bartholomew Furrow 
wrote:

> Woot woot!
>
> On Thu, Apr 19, 2018 at 11:58 AM 'Pablo Heiber' via Google Code Jam <
> google-code@googlegroups.com> wrote:
>
>>
>>
>>
>>
>>
>> *Hi Everyone,We announced last week that we'd be launching a one-week
>> optional practice session today for you to continue to test your solutions
>> on the new platform and practice for future rounds. In prioritizing a
>> better option for contestants, we'll instead be launching a practice mode
>> feature where you'll be able to log on to the new platform at anytime to
>> practice, test your code, and keep improving. Practice mode will open by
>> Friday, April 20th at 23:59 UTC and it will remain available under Past
>> Contests  for you to submit
>> solutions to 2018 problems at any time, except while official Code Jam
>> Rounds are in progress.There will be no scoreboard for the practice mode
>> submissions, but your solutions will be judged right away and you will be
>> able to see the status of your solutions under the Submissions section of
>> the platform. At launch, 2018 Practice Session, Qualification Round and
>> Round 1A problems will be available for practice, and future round problems
>> will become available shortly after the official round comes to a
>> close.Please remember we are unable to help with user-specific issues with
>> your submissions or understanding of the problems, but we encourage you to
>> reach out to the Code Jam community for support as you're practicing. We
>> hope you enjoy this feature and best of luck to all practicing for upcoming
>> rounds!Pablo, on behalf of the Code Jam team*
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/google-code/CANa5jcDA19Sf%2BKjV%3DTzobBvnbVBsXN2SwEJbdgZcqeL_
>> OvgY1A%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/CAHaiWHP5-9xaODvzyaenOZ%3DV_AbDVjdAs6dBrSA7ti%3D0Wzx3cg%
> 40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-P7bKKs%3DnbrOSu0Lyw8OheSNtYmyN0jJxk9gpz%2BhKp8AQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Mystery Square

2018-04-19 Thread Luke Pebody
First part: (in decimal) what are the following squares?

522???
??7609

On Thu, 19 Apr 2018, 3:37 am Serhat Giydiren, 
wrote:

> Hi all.
>
> I am reviewing past problems. Is there anyone who has another analysis /
> approach for the following problem.
>
> https://code.google.com/codejam/contest/1158485/dashboard#s=p3
>
> I could not get the following analysis.
>
> https://code.google.com/codejam/contest/1158485/dashboard#s=a=3
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/e6eb907d-b701-4dbf-8103-873da5bedac1%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-MtkVhPLzxH9k5NCj%3D2qzpnfONEdODPwWuef7M3tjkC0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Finding another competitor on the score board?

2018-04-10 Thread Luke Pebody
I wholeheartedly agree with bringing back that feature. Otherwise if a
contestant had written a solution in an outrageous choice of programming
language, then written a python interpreter for that language, found it too
slow and so written a C++ interpreter instead, what way would there be for
that competitor to pointlessly show off and further inflate his/her ego?

Also quite useful to see how the top competitors write solutions very
quickly.

On Tue, 10 Apr 2018, 8:36 pm Sid Vishnoi,  wrote:

> On Saturday, April 7, 2018 at 7:14:57 PM UTC+5:30, meir wrote:
> > I seem unable to find a way to look up another player in the scoreboard.
> > I used to do this, to track both real life friends and other notable
> competitors I become aware of.
> > Is this feature missing from current incarnation? or am I just not
> seeing it?
>
> It's missing. That was a nice feature. Lets request it back from the
> feedback form they provided:
> https://docs.google.com/forms/d/e/1FAIpQLSfE09X8Zdotkf8FYe-YczYs2eUBZtOC1yoxObpJrQiMAo0Qqg/viewform
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/daa639ee-53bb-4ae4-ad6f-50d91e02%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-Onv%2BHSmAodm%3DJfPUeZkJJvV6qPSMTEoJ33Uh%3D9n1Zr%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Messages on the mailing list

2018-04-06 Thread Luke Pebody
But we can wish you luck. Good luck! Enjoy the questions and the challenges!

On Fri, 6 Apr 2018, 9:34 pm Bartholomew Furrow,  wrote:

> It appears that the high volume of messages today is messages that people
> sent last week. I'm assuming that they were caught in a moderation queue.
>
> I'm also assuming that the Code Jam admins are going to shut down the
> mailing list during the contest. *If you have something to ask during the
> contest, ask code...@google.com .* We can't help you
> here.
>
> Bartholomew
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CAHaiWHMNnzCP4KmnQ%2BPUW0J0uEWhw9usvxX%3D1Hz9PgQ9d9T7bQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-MiZoDGr%2Bv5wr-g-mh86ZW9tr%2BzCosbTPWHUtXMZddicA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Your output should start with 'Case # 1

2018-03-22 Thread Luke Pebody
You need to input the output of your program, not the program itself. (for
tests of old code jams - as I understand it, the opposite will be true in
the new code jam)

On Thu, 22 Mar 2018, 10:32 pm ,  wrote:

> Hello
> I am preparing for the contest by trying to correct the past subject. I
> encounter the problem "Submission for input A-small Rejected: Your output
> should start with 'Case # 1:'". The subject is:
>   Qualification Round 2016
>   Problem:
>  A. Counting Sheep
> the code I edited is in python...
>
> 
> N = int(input())
> i=1
> while i<=N :
> list = set()
> j=1
> Val=input()
> if Val=='0':
> print("Case #{}: INSOMNIA".format(i))
> else:
> for e in Val:
> list.add(e)
> while len(list)<10:
> val=int(Val)
> val*=j
> val=str(val)
> for e in val:
> list.add(e)
> j+=1
> j-=1
> m=j*int(Val)
> print("Case #{}: {}".format(i, m))
> i+=1
> 
>
> the code works very well but on the platform it does not pass. Your help
> will be welcome
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/f9e3b26f-dc5c-4517-911d-e794c4fdafc7%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-NVN7Ca2p8hEMAdcOVpqfkq%2B3gghusC4P6yCniKieJRxw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Google Code Jam 2018 registration is open

2018-03-13 Thread Luke Pebody
I think the change that will have the biggest effect on my later round
strategy is that, if I understand correctly, we will not have access to the
test data from the Small/Visible data sets when programming the
Large/Hidden data sets.

For many problems I would solve the Small by brute force and use the data
set as extra test cases for the Large. Now I will be making my own extra
test cases.

On 7 Mar 2018 11:12 pm, "Felix Voituret"  wrote:

> Yes totally misread, confused regarding of various announcement during
> this day where I only retained « more contestant » and « 1000 to round 3 ».
> My bad :).
>
> All those new features are exiting !
>
> Envoyé de mon iPhone
>
> Le 7 mars 2018 à 23:41, 'Pablo Heiber' via Google Code Jam <
> google-code@googlegroups.com> a écrit :
>
>
>
> On Wed, Mar 7, 2018 at 2:30 PM, Bartholomew Furrow 
> wrote:
>
>> Pablo:
>>
>>
>>> The confusion probably arises because there were 500 advancers from
>>> Round 2 to Round 3 last year, and that's also the case this year.
>>>
>>
>> According to 3.1(c): "You will advance to Code Jam Round 3 if you are one
>> of the highest-ranked 1000 contestants from Code Jam Round 2."
>>
>>
> This further confusion probably arises from me being confusing (thanks
> Bart for paying attention!). 4500 people advance from R1 to R2, 1500 from
> each of the three subrounds. 1000 advance from R2 to R3.
>
> Felix, I see no 4000 number in the terms or in the rules, so I'm hoping
> you just misread the 4500. If not, feel free to ask again.
>
> Best,
> Pablo
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/CANa5jcDymJQfjgT089Zd-T5DUmLKLw0DpqvPn1K87jUf0Yde_g%
> 40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/D84270C8-F0F1-4662-9765-C0E17F23143E%40gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-OJZe47SMOYTp3LdH1yv_9Foj%2Bxs%2BiP1%3DLV%3D936S5CpTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Google Code Jam 2018 registration is open

2018-03-07 Thread Luke Pebody
You can only use one of twelve different programming languages?!?!?

This is the end of an error.


On 7 Mar 2018 4:02 am, "Bartholomew Furrow"  wrote:

> OK, things seem to have changed a tiny bit
> .
> I've read through the FAQ and here's my attempt at describing what's
> different:
>
> - Code is now run server-side. You don't download i/o sets.
> - Available languages: Bash, C, C++, C# (mono), Go, Haskell (ghc), Java 8,
> Javascript (nodejs), Python2, Python3, PHP, and Ruby. That covers 97.5% of
> what people used in last year's qualification round.
> - New "interactive" problems that let the server respond to the user's
> output, and vice-versa.
> - Instead of small/large, there's now "visible" / "hidden" -- you get to
> see your results on "visible" sets. There are some details
> ,
> especially regarding resubmission.
> - No "ask a question" in the platform -- only email. I presume this might
> come for next year.
> - There will be a chance to try the new platform prior to the
> qualification round, in case 27 hours isn't long enough to figure it out.
> - 4500 advance to round 2. 1000 advance to round 3. 1000 shirts.
>
> I'm really excited about the new problem type, and excited about not
> having to deal with i/o files, and about the problemsetters not being
> constrained by variable hardware anymore! Does anyone see anything I missed?
>
> Bartholomew
>
> On Tue, Mar 6, 2018 at 4:47 PM Joseph DeVincentis 
> wrote:
>
>> Registration is open and the full schedule is up.
>> https://code.google.com/codejam/
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/google-code/CAMAzhzgTpkSGUefgy9bNVyDuLZHaB%3Dj6m1OwO7x35df4hyghgQ%
>> 40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/CAHaiWHOspb9VUrD6-VapUsNZv4%2Bx90m_L%3DLjpHyrM8WTcB-cqw%
> 40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-P6VS1%2BMh86_HEqH5g2-TfTOp2-Fj8xaKRGppj8CpFm0w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] how much what advance topics should learn

2018-01-02 Thread Luke Pebody
For your other questions, start with
https://code.google.com/codejam/resources/quickstart-guide

On 2 Jan 2018 5:09 p.m., "Luke Pebody" <l...@pebody.org> wrote:

> No AI is needed for the code jam. as far as I know (would be pleased to be
> corrected), no AI has ever been used to solve a code jam problem. Although
> if I recall correctly someone used Simulated Annealing to solve two
> different problems in one Code Jam Final.
>
> On 2 Jan 2018 5:07 p.m., "Gaming & Fun" <hunterunkle...@gmail.com> wrote:
>
>> Hi! Anybody tell me that what advance topics and mathematics should i
>> learn and how much AI needed for codejam and become best in it :( i'm very
>> craziest about it but probably i'm not able to make the solutions of
>> codejam problems how could i reach on it with best source :( please tell me
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/google-code/c6f107b5-731b-4f5b-8c58-68ccee9b079d%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-NUCEL5FyniaY9nsbyvo%3DKEyFSba98jH_O%3DymmN_VqmQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] how much what advance topics should learn

2018-01-02 Thread Luke Pebody
No AI is needed for the code jam. as far as I know (would be pleased to be
corrected), no AI has ever been used to solve a code jam problem. Although
if I recall correctly someone used Simulated Annealing to solve two
different problems in one Code Jam Final.

On 2 Jan 2018 5:07 p.m., "Gaming & Fun"  wrote:

> Hi! Anybody tell me that what advance topics and mathematics should i
> learn and how much AI needed for codejam and become best in it :( i'm very
> craziest about it but probably i'm not able to make the solutions of
> codejam problems how could i reach on it with best source :( please tell me
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/c6f107b5-731b-4f5b-8c58-68ccee9b079d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-P9V4ssiaJvP8Aa1KKP%3DfktBYzTzUj8t5mssWi0UTv6BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] about problem query of death Distributed GCJ 2017

2017-06-05 Thread Luke Pebody
If you are getting WA you have probably made a logical error somewhere. You
might have to post your code to know where.

On 5 Jun 2017 2:35 p.m., "Reynaldo Gil-Pons" <gil...@gmail.com> wrote:

There are 100 computers, 1 microsecond = 1e-6 seconds, so time for reading
each number 30 times is: 10 ^ 8 * (0.2 * 10^ -6) / 100 * 30 = 6 seconds, so
a little bit above, but I have tested and it passes the time limit,
although giving WA, as if the probability reasoning were incorrect...

On Monday, June 5, 2017 at 12:59:48 AM UTC-4, Xiongqi ZHANG wrote:
> 10^8 * 0.2 microsecond = 20 seconds while Time Limit is 2 second.
>
>
> Reynaldo Gil-Pons <gil...@gmail.com>于2017年6月4日周日 下午7:39写道:
> 0.2 millisecons to read a single bit? They say 0.2 microseconds. I get WA
when doing what I explained, in 1.7 seconds...
>
>
>
> On Friday, June 2, 2017 at 12:09:47 PM UTC-4, Luke Pebody wrote:
>
> > I would think it can't work on the large case because it takes 0.2
milliseconds to read a single bit once and therefore 20 seconds to read all
100M bits once and 10 minutes to read them 30 times.
>
> >
>
> >
>
> > On 2 Jun 2017 4:56 p.m., "Reynaldo Gil-Pons" <gil...@gmail.com> wrote:
>
> > In the analisis they explain a solution for the Small case, and point
out it cannot work for the Large one. When I calculate the probabilities of
getting WA using 30 checks for each position, and assuming 100
testcases (cant be more than this right?) I get less than 1 / 1000. But I
still get WA. I calculate an upper bound on the probability of failure as 1
- (1 - 1 / (2 ** 30)) ** number_test_cases. Is there anything wrong?
>
> >
>
> >
>
> >
>
> > --
>
> >
>
> > You received this message because you are subscribed to the Google
Groups "Google Code Jam" group.
>
> >
>
> > To unsubscribe from this group and stop receiving emails from it, send
an email to google-code...@googlegroups.com.
>
> >
>
> > To post to this group, send email to googl...@googlegroups.com.
>
> >
>
> > To view this discussion on the web visit https://groups.google.com/d/
msgid/google-code/11b46b16-82c3-4824-b319-626b05cf9e76%40googlegroups.com.
>
> >
>
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an
email to google-code...@googlegroups.com.
>
> To post to this group, send email to googl...@googlegroups.com.
>
> To view this discussion on the web visit https://groups.google.com/d/
msgid/google-code/b8d61e73-ddb2-4fdf-bb32-7c61929055a7%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/google-code/cded6fcb-f302-42b2-98db-510d42d43980%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-Meq4LZR-F1arc7Jbnvp_-pC%2B8DFtzNCtwK6RQBHna58A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] about problem query of death Distributed GCJ 2017

2017-06-02 Thread Luke Pebody
I would think it can't work on the large case because it takes 0.2
milliseconds to read a single bit once and therefore 20 seconds to read all
100M bits once and 10 minutes to read them 30 times.

On 2 Jun 2017 4:56 p.m., "Reynaldo Gil-Pons"  wrote:

> In the analisis they explain a solution for the Small case, and point out
> it cannot work for the Large one. When I calculate the probabilities of
> getting WA using 30 checks for each position, and assuming 100
> testcases (cant be more than this right?) I get less than 1 / 1000. But I
> still get WA. I calculate an upper bound on the probability of failure as 1
> - (1 - 1 / (2 ** 30)) ** number_test_cases. Is there anything wrong?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/11b46b16-82c3-4824-b319-626b05cf9e76%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-PK61s%2BX0nwAABJP0SifyZ5s%2BoYtRMv%2B%2BfhkawVfA-jkQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[gcj] IPSC 2017

2017-05-23 Thread Luke Pebody
Does anyone know if there will be an IPSC this year? It is the highlight of
the programming contest year (No offence to GCJ and DCJ)

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-NgJLpZ%2BJ0yoWasP_rjrw7%3DNwiqhm970v-TkYXgT0cPuQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] 1A Problem C. Play the Dragon (Practice Version)

2017-04-21 Thread Luke Pebody
I don't agree that you have to cure on the second move. Surely you can
debuff and have 1 point left?

On 21 Apr 2017 1:38 p.m., "sg"  wrote:

> Hi,
>
> Input case no. 15 in the small input of this problem is:
>
> 92 1 97 47 0 1
>
> First Move:
> Dragon performs Debuff
> 92 1 97 46 0 1
> Knight replies with new attack power 46
> 46 1 97 46 0 1
>
> second move: Cure (anything else results in defeat)
> 92 1 97 46 0 1
> Knight attacks with 46
> 46 1 97 46 0 1
>
> third move: Cure (same logic)
> 92 1 97 46 0 1
> Knight attacks with 46
> 46 1 97 46 0 1
>
> Isn't this an IMPOSSIBLE scenario.
> However, the correct answer seems to be 166.
>
> Can anyone explain how?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/b3d02536-0ef8-471d-8ab9-da4044a9e0df%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-NW90Sybt86f3fnX-%2Bp5A%2BO-mG5PXm_p1h0yQBv4-hqnA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Round 1A - Alphabet Cake - (Edge Case)

2017-04-18 Thread Luke Pebody
All letters in the input data must be distinct. Your case has 2 Gs

On 18 Apr 2017 2:39 p.m., "varun vats"  wrote:

>
> In Question : Alphabet Cake,
> The greedy Large approach:
>
> There is a simple non-recursive approach as well. First, within each row,
> we can extend each existing letter into all cells to the right of that
> letter, until we reach another existing letter or the edge of the cake.
> Then, we can extend the leftmost existing letter (if any) into all cells to
> the left of that letter.
>
> Would give wrong answer for the below test case.
>
>
> Test Case:
> 1
> 2 4
> G ? ? K
> ? G R ?
>
> According to the mentioned greedy approach :
>
> G G G K
> G G R R
>
> Here the G is not rectangular.
>
> Correct answer could have been :
>
> G G K K
> G G R R
>
>
> Please team let me know if I am missing something.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/98239779-d1dd-42b1-8bf0-c4151e135527%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-Oinie4o9M71Npvw04DKTjpA8m8wS1NNoWg-carL0ni9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Problem D Fashion Show

2017-04-12 Thread Luke Pebody
Yes, but of any two models on a row or column, one must be a +. Since there
are two on that row that are not a +, that condition is not satisfied

On 12 Apr 2017 10:58 p.m., "newbie007"  wrote:

> https://code.google.com/codejam/contest/3264486/dashboard#s=p3
> [quote]
> ...
> x+o
> .+.
>
> The middle row has a pair of models (x and o) that does not include a +.
> [/quote]
>
> I didn't understand this part.
> The middle row HAS a +
>
> :(
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/f23951a1-9968-49a6-b3fe-b2400a61a863%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-O1DFOzK1vOc8LspypehADd4HcLjaDoK2nBta4fhhowgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Qualification round points needed?

2017-04-10 Thread Luke Pebody
It is at the top of the scoreboard for the round and is 25

On 10 Apr 2017 4:09 a.m., "Stefan Pochmann" 
wrote:

> The terms say "If you earn a minimum number of points during the
> qualification round, which will be displayed on the Contest website, you
> will advance to Round 1 of Code Jam."
>
> When and where will that number of points be displayed? Am I supposed to
> crawl+read the entire website in order to hopefully find it?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/f9b3e32e-3452-4c5f-a5d1-7cdbf20b5e4a%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-ME-UVnaE5w0o_sY48kfKiUavw9qU4QPzadeOm_iyD72A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] How many points are needed to qualify?

2017-04-08 Thread Luke Pebody
https://code.google.com/codejam/contest/3264486/scoreboard?c=3264486

25

On 8 Apr 2017 2:18 p.m., "Joel Berghoff"  wrote:

> I can't find this info anywhere :(
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/8b2f9758-c279-434e-a859-200e5966ea40%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-MOk7UG%2BzdDyLQ9OMJ%3DVxF%3D1aTCT2BUyZEwKtXLmXj_bQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] In case of Ties...

2017-04-05 Thread Luke Pebody
In https://code.google.com.codejam/terms it says "we reserve the right to break 
ties when necessary based on finer time precision than is specified on the 
scoreboard."

Sent from my iPad

> On 5 Apr 2017, at 15:48, Paul Smith  wrote:
> 
> I think it's very unlikely that 2 competitors will finish uploading correct 
> solutions to the same problems on the same second, and that the order of 
> those competitors is somehow relevant to any qualification or awarding of 
> prize.
> 
>> On Wed, 5 Apr 2017 at 15:43 Sanjay Arvind  wrote:
>> How does GCJ handle ties?
>> 
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/google-code/2b6bc952-20df-4865-94bb-e0b4954c7b82%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-code/CAJej63K7PsrG6C0HdhLQTHoA%3Dt-grGw5AVKSvzCGeb8Pgh_J%3DA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/A0938081-C717-4E27-95F1-52517D97244B%40pebody.org.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] GOOGLE SPACES

2017-03-29 Thread Luke Pebody
Google spaces will be discontinued on April 17th.

Sorry.

Sent from my iPad

> On 29 Mar 2017, at 18:29, Alcampo Torrejon  
> wrote:
> 
> I love Google spaces. Where it is? We are Google spaces. The door of the 
> communication, innovation and thecreativity.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-code/4de6d6b8-e2af-40a0-bb5a-5b6c1f51ec25%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/61681D1C-CBB6-43D4-A23F-6BD8A67AB738%40pebody.org.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Query

2017-03-27 Thread Luke Pebody
Suppose the problem was: you will receive an input file starting with a
number of cases, and then a number for each case, and you are to output in
a sentence the square of each number.

1) Create a c file called squareNumbers.c

#include 

int main(){
  int numCases;
  int value;
  int square;
  scanf("%d", );

  for (int caseIndex = 1; caseIndex <= numCases; ++caseIndex)
{
  scanf("%d", );
  square = value * value;
  printf("Case #%d: The square of %d is %d.\n", caseIndex, value,
square);
}
}

2) Download the input file, given here (call it squareNumbers.in)

6
32
1
147
73
0
-92

3) Compile and run your code:

gcc -o squareNumbers squareNumbers.c

./squareNumbers < squareNumbers.in > squareNumbers.out
4) Upload your output file (which should have this content)
Case #1: The square of 32 is 1024.
Case #2: The square of 1 is 1.
Case #3: The square of 147 is 21609.
Case #4: The square of 73 is 5329.
Case #5: The square of 0 is 0.
Case #6: The square of -92 is 8464.


On Mon, Mar 27, 2017 at 7:14 PM, arumugamgandhi156 <
arumugamgandhi...@gmail.com> wrote:

> How to save and submit the output file in c programming language
>
> Sent from my Superphone
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/ktsjcojd1gjcimaay5jt2c06.1490638468596%40email.android.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-NN-YPOvMZQo2ZhqDUeAsGsFdUj1jnBsNN1xnyexH7TLA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] query

2017-03-25 Thread Luke Pebody
Can confirm.

On Sat, Mar 25, 2017 at 4:23 PM, Bartholomew Furrow <fur...@gmail.com>
wrote:

> You only end up trying 68 times if you try to solve your problems in
> languages like LOLCODE <https://www.go-hero.net/jam/10/name/linguo>,
> though.
>
> On Sat, Mar 25, 2017 at 6:48 AM Luke Pebody <l...@pebody.org> wrote:
>
> python a.py < a-small-attempt68.in > a.out
>
> On 25 Mar 2017 12:20 p.m., "arumugam gandhi" <arumugamgandhi...@gmail.com>
> wrote:
>
> how to save the result in a file after running my program on that input
> file then submit the output file?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/94ab9740-ac43-477a-8ff5-12570f40626e%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/CAECKw-MZ0vE0jd2i_7zsF5Qsc%2BquaTS7bmLx_7kMei0gsSf_eQ%
> 40mail.gmail.com
> <https://groups.google.com/d/msgid/google-code/CAECKw-MZ0vE0jd2i_7zsF5Qsc%2BquaTS7bmLx_7kMei0gsSf_eQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/CAHaiWHMsgVyrpkvS0nnZzvfRQOVXF
> WvB5dW2GuD7zF6QL2dGng%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-code/CAHaiWHMsgVyrpkvS0nnZzvfRQOVXFWvB5dW2GuD7zF6QL2dGng%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-PhFbXnKfU1Zy8wn_hAQqyCwHP8pYmaY63%3DNHmq96uufg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] query

2017-03-25 Thread Luke Pebody
python a.py < a-small-attempt68.in > a.out

On 25 Mar 2017 12:20 p.m., "arumugam gandhi" 
wrote:

> how to save the result in a file after running my program on that input
> file then submit the output file?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/94ab9740-ac43-477a-8ff5-12570f40626e%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-MZ0vE0jd2i_7zsF5Qsc%2BquaTS7bmLx_7kMei0gsSf_eQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Code Jam 2017 Registration Now Open

2017-03-18 Thread Luke Pebody
The new front page is alright.

On 18 Mar 2017 10:04 a.m., "Felix Voituret" 
wrote:

> The new UI is great ! Is there any change regarding of switching
> ClientLogin authentification to OAuth ?
>
> Envoyé de mon iPhone
>
> Le 18 mars 2017 à 01:20, Bartholomew Furrow  a écrit :
>
> Oh wow, you guys have been busy -- the front page for Code jam is totally
> new!
>
> Stefan, it seems to me like you're registered if you see the text "The
> contest has not started yet." on the front page. As for the extra email,
> I'm guessing someone forgot to check the "don't send this to people who
> have already registered" button.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/CAHaiWHMC%2BrtWm6GjW-wOztpyMnfqvcbh0Wci3ScjUrRvKD3s
> 7Q%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/2C9CFC54-F102-476D-BFE1-99FF004D8940%40gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-ONtGdirtQEmQsNrf2pEo5cWA%3DrEAhiTCtjkYV8xWg1Ew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Code jam - can we use threads?

2017-03-06 Thread Luke Pebody
Yes. You are running on your own machine and can use any shortcuts or
helpers you like as long as they are freely available. It will often be
less helpful than you would hope. Many questions have only 1 or 2 extremely
difficult test cases and the other threads will be twiddling their thumbs.

On 6 Mar 2017 1:25 p.m., "Mutley"  wrote:

> Hi,
> Basic question - I noticed the Distributed Code Jam FAQs state that
> competitors are not allowed to spawn new threads.
>
> Just wanted to know - are threads allowed in the submissions for the
> Regular Code Jam problems? I was thinking that one way to finish processing
> would be to run 4 threads to handle 25 test cases each.
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/51a8adf6-88c1-4dbb-8599-f26ff5a37563%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-PKTu_P7-qMLtMYuiSe2OKXaibNBhzW1kM%3DOFhqUPQ%3Dbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Round 3 analysis thread - crowd source attemp

2016-06-30 Thread Luke Pebody
Hope you feel fully recovered!
On 29 Jun 2016 21:24, "'Ian Tullis' via Google Code Jam" <
google-code@googlegroups.com> wrote:

> Our analyses
>  for
> Round 3 are up now. Apologies for the delay. Our goal has been to post them
> right after each round, and we succeeded up until the GCJ Round 3 / DCJ
> Round 2 weekend. Various factors (including me getting sick for about a
> week) slowed us down leading up to and after that crunch weekend...
>
> - Ian
>
> On Monday, June 27, 2016 at 8:21:37 AM UTC-7, eatmore wrote:
>>
>> > I thought I'd start a thread with the aim to cover all questions of
>> round 3.
>> There is already one: http://codeforces.com/blog/entry/45358
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/3efa51ef-212c-4443-b296-0f86b7f325eb%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-NH2BQW7-PygWTyQXTP6%2BWuG1SwqFhtuWf%2BbkEoqFvjtQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Round 3 analysis thread - crowd source attemp

2016-06-25 Thread Luke Pebody
Here's a partly documented solution to Problem B: http://ideone.com/CjB58d

Basically, if problem X is basic and has K problems (including itself) that
depend on it, directly or indirectly, the K spots in which you do those
problems are chosen uniformly at random from all subsets of size K.

On Sat, Jun 25, 2016 at 6:54 AM, meir  wrote:

> So It's been two weeks and still no analysis for GCJ round 3.
> I thought I'd start a thread with the aim to cover all questions of round
> 3.
>
> I will start with what I know, and hope someone will add an explanation to
> the tougher problems.
>
> Problem A was fairly simple with nearly everyone in the competition
> solving correctly.
> The first observation I made is it that it is never in your interest to
> take a non preferred problem, this immediately limits your possible actions
> from 3 to 2. This however is not enough to make it brute forceable even for
> small input. The next thing we realize is that if you can get maximal
> points for a problem in hand you should do this and will never lose a
> better opportunity. Also you should never finish with problems in hand so
> if you have problems equal to the remaining days you must submit all of
> them. This leads to simple rules and a stack simulation, no look ahead
> beyond the number of days left required. A simpler to understand ,though
> slightly harder to code, solution my wife suggested is to repeatedly
> eliminate consecutive pairs of identical preferences for 10 points in any
> order, and when you are done you have an alternating list of preferences
> which in pairs are worth 5 points.
>
> Scala code for the stack based approach (single test):
>
> val n =in.readLine()
> val s = n.length
> var i = 0
> var stack = collection.mutable.Stack[Char]()
> var sum = 0
> while (i< s) {
>   if (stack.isEmpty) {
> stack.push(n.charAt(i))
>   } else {
> if (stack.size + i >= s || stack.top == n.charAt(i)) {
>   val submit = stack.pop()
>   if (n.charAt(i) == submit) sum+=10 else sum+=5
> } else {
>   stack.push(n.charAt(i))
> }
>   }
>   i += 1
> }
>
> sum.toString
>
>
> Problem B, We got some big hints in the problem definition, we saw only
> small which can submitted multiple times. This leads to an approach which
> is only probably correct, we have seen this in past competition. Also we
> see the accuracy requirement is reduced. So as the analysis stub suggests
> we need to randomly sample uniformly over possible orders. I don't have the
> details worked out. Would be glad if someone added them.
>
> Problem C small. We have no motion so we can easily look at this as a
> fully connected graph with N nodes. We are not looking for a shortest path
> we are looking for a path which minimizes the maximal hop. So we are
> looking for the minimal distance which if we take all shorter hops the
> source and destination are connected. We can sort the edges and then do a
> union merge starting with shortest hop stopping when the the source and
> destination become in the same component. complexity O(N^2*long(N))
>
>   val Array(n,s) =in.readLine().split(" ").map(_.toInt)
> val asteroids = (1 to n).map(x => in.readLine().split("
> ").map(_.toDouble))
>
> val distMat = (0 until n).map {i =>
>   (0 until n).map{j =>
> val dx = asteroids(i)(0) - asteroids(j)(0)
> val dy = asteroids(i)(1) - asteroids(j)(1)
> val dz = asteroids(i)(2) - asteroids(j)(2)
>
> val dist=(dx*dx+dy*dy+dz*dz)
> math.sqrt(dist)
>   }.toArray
> }.toArray
>
> val pairs = (for (i <- 0 until n;
>  j <- 0 until i) yield
> (i,j,distMat(i)(j))).sortBy(_._3)
>
> val union = (0 until n).toArray
>
> def fetch(a: Int): Int = {
>   if (union(a) == a) a else {
> val res = fetch(union(a))
> union(a) = res
> res
>   }
> }
>
> def merge(a: Int,b: Int) = {
>   union(fetch(a)) = fetch(b)
> }
>
> pairs.find{case (a,b,d) =>
>   merge(a,b)
>   fetch(0) == fetch(1)
> }.get._3.toString
>
>
> Problem D Small.
> It is possible to create a set of programs which can output any string
> with at least one zero and must output at least one zero.
> So All the program does is check if the Bad string is in the good list, if
> it is it outputs "IMPOSSIBLE" and otherwise it outputs
> the first program with L-1 "?" and the second program with "10" repeated
> 50 times followed by "?1".
> Totally ignoring the good list beyond impossibility check. We also add
> need an extra handling for the case of length 1 strings to make sure both
> programs are non empty.
>
> val Array(n,l) =in.readLine().split(" ").map(_.toInt)
> val good = in.readLine().split(" ")
> val bad = in.readLine()
> if (good.contains(bad)) "IMPOSSIBLE" else {
>   if (l == 1) "? 0" else
>
>   "?"*(l-1) + " " + ("10"*50+ "?" + "1")
> 

Re: [gcj] No more Python @ DCJ?

2016-05-20 Thread Luke Pebody
DISREGARD
On 20 May 2016 23:15, "Luke Pebody" <l...@pebody.org> wrote:

> What about Pascal?
> On 20 May 2016 21:46, "'Pablo Heiber' via Google Code Jam" <
> google-code@googlegroups.com> wrote:
>
>> Hi,
>>
>> As explained in the distributed FAQ:
>> https://code.google.com/codejam/distributed_faq.html#2
>>
>> "In 2016, we will support C++ and Java.
>>
>> Python and Pascal were only partially supported in 2015. We narrowed the
>> support to the two most popular languages so that we could focus on making
>> the system and our problems more robust. We will expand to other languages,
>> with Python getting first priority, in upcoming years."
>>
>> I hope we still see you competing this year.
>>
>> Best of luck,
>> Pablo
>>
>>
>>
>>
>> On Fri, May 20, 2016 at 1:26 PM, Bogdan Sachelarie <
>> bogdansachela...@gmail.com> wrote:
>> >
>> > Does anybody know if Python is going to be supported for the
>> Distributed Code Jam this year?
>> >
>> > The practice round currently only sports Java & C++ as opposed to last
>> year. That's a shame..
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups "Google Code Jam" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an email to google-code+unsubscr...@googlegroups.com.
>> > To post to this group, send email to google-code@googlegroups.com.
>> > To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/96c88081-03a4-4d69-b0c0-70dbc51d39fe%40googlegroups.com
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/CANa5jcDoBD5JbcmrjQJzbo4B7qwnLF3%3DgRRF6GyZHH0bxgo0ow%40mail.gmail.com
>> <https://groups.google.com/d/msgid/google-code/CANa5jcDoBD5JbcmrjQJzbo4B7qwnLF3%3DgRRF6GyZHH0bxgo0ow%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-N%3Dq8Bn%2ByfmmWW5sKUGGQTUwmacEovDK6LyGHLxb7bJ8A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] No more Python @ DCJ?

2016-05-20 Thread Luke Pebody
What about Pascal?
On 20 May 2016 21:46, "'Pablo Heiber' via Google Code Jam" <
google-code@googlegroups.com> wrote:

> Hi,
>
> As explained in the distributed FAQ:
> https://code.google.com/codejam/distributed_faq.html#2
>
> "In 2016, we will support C++ and Java.
>
> Python and Pascal were only partially supported in 2015. We narrowed the
> support to the two most popular languages so that we could focus on making
> the system and our problems more robust. We will expand to other languages,
> with Python getting first priority, in upcoming years."
>
> I hope we still see you competing this year.
>
> Best of luck,
> Pablo
>
>
>
>
> On Fri, May 20, 2016 at 1:26 PM, Bogdan Sachelarie <
> bogdansachela...@gmail.com> wrote:
> >
> > Does anybody know if Python is going to be supported for the Distributed
> Code Jam this year?
> >
> > The practice round currently only sports Java & C++ as opposed to last
> year. That's a shame..
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Google Code Jam" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to google-code+unsubscr...@googlegroups.com.
> > To post to this group, send email to google-code@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/96c88081-03a4-4d69-b0c0-70dbc51d39fe%40googlegroups.com
> .
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CANa5jcDoBD5JbcmrjQJzbo4B7qwnLF3%3DgRRF6GyZHH0bxgo0ow%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-PE-_e%3DDvX4hktMhBDknbqEvuYnhonF8eyhuE1RGYYCBw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Swithing from python to c++ for competitive programming. Any tips?

2016-05-09 Thread Luke Pebody
Why do you want to switch? Python is great for competitive programming!

Sent from my iPad

> On 8 May 2016, at 16:27, Amit Attia  wrote:
> 
> Hello,
> I'm new to competitive programming, currently at GCJ round 2. I program using 
> python, but familier with cpp from university course. I want to switch, but I 
> don't feel like my cpp skills are flexible enough for competitive 
> pragramming. Any tips for doing the switch?
> 
> Another question: In order to use cpp I need to compile and run the data 
> sets, in which environment and how contestants do it fast? Using an ide and 
> creating a new project for each solution sounds like a time waster.
> 
> Thenx in advance,
> Amit.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-code/77088e1d-8abb-48b0-8e93-7ec2b4ac4c77%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/AEE494CA-AA6E-449B-9FB8-CDDDE35F32C0%40pebody.org.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: manual solving of Numbers (https://code.google.com/codejam/contest/32016/dashboard#s=p2)

2016-05-02 Thread Luke Pebody
Nothing good I hope.
On 2 May 2016 21:16, "Anton Popov" <popov...@gmail.com> wrote:

> Spectacular! And thanks by the way! I learn a lot by reading your source
> code to other problems
>
> On 2 May 2016 at 21:59, Luke Pebody <l...@pebody.org> wrote:
>
>> I did problem C-small of the qualification round manually this year.
>> https://www.go-hero.net/jam/16/name/linguo
>>
>>
>> On Sun, May 1, 2016 at 10:10 AM, Anton Popov <popov...@gmail.com> wrote:
>>
>>> And on top, you still have to provide the source code (which in this
>>> case would be a text file with description of the manual actions performed)
>>>
>>> On 1 May 2016 at 01:46, Xiongqi ZHANG <zhangxion...@gmail.com> wrote:
>>>
>>>> It is perfectly fine to do a problem manually.
>>>>
>>>> However, for most of the problem, solving the problem by hand is almost
>>>> impossible (even for small test case).
>>>>
>>>> > is it ok to use wolfram alph to solve a solution partially by hands?
>>>> In that problem, it was required to compute the 3 last digits of (3+
>>>> sqrt(5)) ^ n). For the small input, it n <= 30, so it could be done with
>>>> any arbitrary precision library, but I have none for now, and am not very
>>>> proficient or fast at installing / accomodating to new libraries on fly, so
>>>> could (would have it be legit) I have just enter the values manually get
>>>> from wolfram alpha (not computed manually though)?
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Google Code Jam" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to google-code+unsubscr...@googlegroups.com.
>>>> To post to this group, send email to google-code@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/google-code/2923fe91-e290-4238-adaa-7cfc08556397%40googlegroups.com
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> --
>>> Best regards,
>>> Anton Popov
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Code Jam" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-code+unsubscr...@googlegroups.com.
>>> To post to this group, send email to google-code@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-code/CADp5X8PTzDCZpDF0r%3DYJwYMX30W-DrkibG_ni0-t7LhKB3TQEQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/google-code/CADp5X8PTzDCZpDF0r%3DYJwYMX30W-DrkibG_ni0-t7LhKB3TQEQ%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/CAECKw-Ps7SkjwYBoWaDv0esUT9NLxjjiAMtLHJb7-4h%2BRLDUGA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/google-code/CAECKw-Ps7SkjwYBoWaDv0esUT9NLxjjiAMtLHJb7-4h%2BRLDUGA%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Best regards,
> Anton Popov
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CADp5X8OGbhgV_A8S8S3Z4Mp61BX_4LpYaE7ySye%2BhJXy1rNH0g%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-code/CADp5X8OGbhgV_A8S8S3Z4Mp61BX_4LpYaE7ySye%2BhJXy1rNH0g%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-PF2tvJLVTfS9WeD3R%2BUpc0uS8CGbKoQN2Ycf6OMvk_0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Program Error

2016-03-23 Thread Luke Pebody
Which problem is it supposed to be a solution to?

Sent from my iPad

> On 23 Mar 2016, at 13:10, Amir Mallick  wrote:
> 
> #include 
> 
> using namespace std;
> 
> int main()
> { int t;
> cin>>t;
> int out=0;
> while(t--)
> {
> 
>   int a[10];
>   int h[15]={0};
>   int c[15]={0};
>   int i,j,k,n;
>   //cout<<"enter the sum"<   cin>>k;
>  // cout<<"enter the no of elemeents"<   cin>>n;
>   j=1;
>   //cout<<"enter the elements"<for(i=0;i   {
>   cin>>a[i];
> 
>   }
>   for(i=0;i   {
>   if((h[a[i]])==0)
>   {
>   //cout<<"y"<   //h[a[i]]=a[i];
>   h[a[i]]=a[i];
>   c[a[i]]=j;
>   j++;
>  if(h[a[i]]==k-h[k-a[i]] && k-a[i]!=a[i] && h[k-a[i]]!=0)
> 
>   {
>   out++;
>  cout<<"Case #"<  //"Case #x: "
> 
> 
> 
>   break;
> 
>   }
>   }
>   else
>   {
>   //cout<<"NO"< if(h[a[i]]==k-h[k-a[i]])
> 
>   {
>   out++;
>cout<<"Case #"< 
>   break;
> 
>   }
>   }
> 
>   }
> 
> 
> }
> 
> 
> }
> 
> 
> 
> I don't understand the problem with my code.Can You help in sorting out the 
> solution with the following code.
> The error says :Submission for input A-small Rejected: Your output should 
> start with 'Case #1:
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-code/e2c0ad60-8fed-4c50-b0da-e5c4ebe3fd87%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/45250BA3-4303-4390-8550-DA64A0DF268C%40pebody.org.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Helpful info for 2016 Code Jam

2016-03-15 Thread Luke Pebody
Most people use C++ because:
1) it is faster for execution time
2) they do other programming contests and c++ is good to use there because
of 1).

However I feel the code jam questions are almost all designed so that the
challenge is coming up with a good algorithm, but when you do that
algorithm can be written in any non-esoteric language.

I primarily use Python because I find it optimizes my developer time.
Ideally I think you should use the language you are most comfortable with.
On 15 Mar 2016 17:45, "John Paul Jones"  wrote:

> As Google Code Jam gets closer I had a couple questions.  I have done the
> code jam the past 4 years and have usually passed the qualification round.
> But I want to see if I can take it to the next level.  I used C#, C++ and
> JavaScript in the past but I am thinking of giving  python a try cause I
> hear that is a good one to use.
>
> What is the best language to use?
> What are some books you would recommend to read?
>
> -I am not talking really about new languages to use more about the
> algorithmic problems and solving them or doing competitive code
> competitions.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/1e374b54-6796-4a4a-bcb4-a1c4bd7adde6%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-MqSyHb7F28ypnjJGCcg85u8GWfWkNc4YugQx5QtB7ZfA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Code Jam 2016 Registration Now Open

2016-03-09 Thread Luke Pebody
If you are a beginner, I would recommend Stroustrup's Principles and
Practice.

Koenig and Moo or Lippman, LaJoie and Moo are good if you have good
programming experience in another language.

Bruce Eckel's Thinking in C++ is good and has the side benefit of being
free (like beer)
On 10 Mar 2016 06:30, "vivek dhiman" <vivek4dhi...@gmail.com> wrote:

> As we are on this thread. Any pointers to good resources for learning C++?
>
> Thanks & regards
> Vivek
>
> On Thu, Mar 10, 2016 at 6:58 AM, Luke Pebody <l...@pebody.org> wrote:
>
>> Porque no les dos?
>>
>> On 10 Mar 2016, at 04:10, Bartholomew Furrow <fur...@gmail.com> wrote:
>>
>> Hahaha. By the way, would you say that I'm a student of parenting, or a
>> professional parent? I need to know for this registration form I'm filling
>> out...
>>
>> On Wed, Mar 9, 2016 at 12:02 PM Hamza Mushaiti <hamzade...@gmail.com>
>> wrote:
>>
>>> This my first time to be in Google Code Jam
>>>
>>> I have learned Java but should i learn to be good competitor?
>>>
>>> Thanks
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Code Jam" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-code+unsubscr...@googlegroups.com.
>>> To post to this group, send email to google-code@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-code/a9025f9d-f937-45f9-8c4d-91c32f64d329%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/CAHaiWHMfoF8u5xHG%3DB%3DDNm8jVwt1W5xCBQ69nrbzrXWZuh1VoA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/google-code/CAHaiWHMfoF8u5xHG%3DB%3DDNm8jVwt1W5xCBQ69nrbzrXWZuh1VoA%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/ECB95E91-A2DD-431B-8E1E-6E984208011B%40pebody.org
>> <https://groups.google.com/d/msgid/google-code/ECB95E91-A2DD-431B-8E1E-6E984208011B%40pebody.org?utm_medium=email_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CABaJBvJrwZcwx6vMRUXB_A%2B%3DV0YN-_1yXuni5yAB%2B6BmahZm7w%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-code/CABaJBvJrwZcwx6vMRUXB_A%2B%3DV0YN-_1yXuni5yAB%2B6BmahZm7w%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-PpaP%3DPyObS7%3DXk-8GXSSrukwnDDRix6f2nk4ECaDUSXQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Code Jam 2016 Registration Now Open

2016-03-09 Thread Luke Pebody
Porque no les dos?

> On 10 Mar 2016, at 04:10, Bartholomew Furrow  wrote:
> 
> Hahaha. By the way, would you say that I'm a student of parenting, or a 
> professional parent? I need to know for this registration form I'm filling 
> out...
> 
>> On Wed, Mar 9, 2016 at 12:02 PM Hamza Mushaiti  wrote:
>> This my first time to be in Google Code Jam
>> 
>> I have learned Java but should i learn to be good competitor?
>> 
>> Thanks
>> 
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/google-code/a9025f9d-f937-45f9-8c4d-91c32f64d329%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-code/CAHaiWHMfoF8u5xHG%3DB%3DDNm8jVwt1W5xCBQ69nrbzrXWZuh1VoA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/ECB95E91-A2DD-431B-8E1E-6E984208011B%40pebody.org.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Code Jam 2016 Registration Now Open

2016-03-09 Thread Luke Pebody
Just to back this up: last year's 10th placed candidate (
http://www.go-hero.net/jam/15/name/pashka ) reached the top 10 just using
java and last year's 8th placed candidate (
http://www.go-hero.net/jam/15/name/linguo ) reached the top 10 just using
python ( well, one c++ for speed )

On Wed, Mar 9, 2016 at 9:00 PM, Luke Pebody <l...@pebody.org> wrote:

> Sorry, I cannot agree with this claim. People can certainly do well with
> just java. Or just python. Or just c++. Or just haskell. Possibly just vba,
> but that's pushing things.
>
> On Wed, Mar 9, 2016 at 8:56 PM, Fa Bel <faruqbe...@gmail.com> wrote:
>
>> Hamza, I think you should wait until next year, because you need more
>> than just java for this thing
>>
>> On Wed, Mar 9, 2016 at 4:47 AM, Hamza Mushaiti <hamzade...@gmail.com>
>> wrote:
>>
>>> This my first time to be in Google Code Jam
>>>
>>> I have learned Java but should i learn to be good competitor?
>>>
>>> Thanks
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Code Jam" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-code+unsubscr...@googlegroups.com.
>>> To post to this group, send email to google-code@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-code/a9025f9d-f937-45f9-8c4d-91c32f64d329%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/CAP27nz4-Umtor4c%3DJJeTGW--zWXhikuNiJ7y6Y5TvDk02XjU4Q%40mail.gmail.com
>> <https://groups.google.com/d/msgid/google-code/CAP27nz4-Umtor4c%3DJJeTGW--zWXhikuNiJ7y6Y5TvDk02XjU4Q%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-Pfp4tpfpo-AsSrWp-EUqvx0HGeONXuF38gSJMtiVsVgg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Code Jam 2016 Registration Now Open

2016-03-09 Thread Luke Pebody
To Hamza,

The best way to learn is to do. Look at some old problems, and try and work
out how you would approach them in a contest situation.
https://code.google.com/codejam/contests.html has some suggestions of good
problems for a new contestant to try.

Don't get disheartened if you find it hard initially. Lots of great
programmers I know would struggle with the qualification rounds, and most
would not reach Round 2. It's a very different skill set (with some
overlap) to being a great programmer, but it can be exceedingly enjoyable.

Welcome to the club, and I hope you enjoy the ride!

Luke


On Wed, Mar 9, 2016 at 9:00 PM, Luke Pebody <l...@pebody.org> wrote:

> Sorry, I cannot agree with this claim. People can certainly do well with
> just java. Or just python. Or just c++. Or just haskell. Possibly just vba,
> but that's pushing things.
>
> On Wed, Mar 9, 2016 at 8:56 PM, Fa Bel <faruqbe...@gmail.com> wrote:
>
>> Hamza, I think you should wait until next year, because you need more
>> than just java for this thing
>>
>> On Wed, Mar 9, 2016 at 4:47 AM, Hamza Mushaiti <hamzade...@gmail.com>
>> wrote:
>>
>>> This my first time to be in Google Code Jam
>>>
>>> I have learned Java but should i learn to be good competitor?
>>>
>>> Thanks
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Code Jam" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-code+unsubscr...@googlegroups.com.
>>> To post to this group, send email to google-code@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-code/a9025f9d-f937-45f9-8c4d-91c32f64d329%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/CAP27nz4-Umtor4c%3DJJeTGW--zWXhikuNiJ7y6Y5TvDk02XjU4Q%40mail.gmail.com
>> <https://groups.google.com/d/msgid/google-code/CAP27nz4-Umtor4c%3DJJeTGW--zWXhikuNiJ7y6Y5TvDk02XjU4Q%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-NbErecg_bsmpB2hQw7Zy3VrtTJN760RjXKeVv4QrvzTg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Code Jam 2016 Registration Now Open

2016-03-09 Thread Luke Pebody
Sorry, I cannot agree with this claim. People can certainly do well with
just java. Or just python. Or just c++. Or just haskell. Possibly just vba,
but that's pushing things.

On Wed, Mar 9, 2016 at 8:56 PM, Fa Bel  wrote:

> Hamza, I think you should wait until next year, because you need more than
> just java for this thing
>
> On Wed, Mar 9, 2016 at 4:47 AM, Hamza Mushaiti 
> wrote:
>
>> This my first time to be in Google Code Jam
>>
>> I have learned Java but should i learn to be good competitor?
>>
>> Thanks
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/a9025f9d-f937-45f9-8c4d-91c32f64d329%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CAP27nz4-Umtor4c%3DJJeTGW--zWXhikuNiJ7y6Y5TvDk02XjU4Q%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-NBK1Z24xDDdYqpTbsBbwiN37_bNqVT1kRoK99Q5Vht5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Please help in finding error. It works good still error is shown

2015-09-06 Thread Luke Pebody
I disagree with this diagnosis. I think it faults with the large data set
and gets the answer right if you make your array big enough.

A quick note: the 'break' breaks you out of the 'for (k = j + 1; k < p;
k++)' loop, but not the 'for (j = 0; j < p - 1; j++)' loop.



On Sat, Sep 5, 2015 at 7:47 AM, uDebug  wrote:

> Hi,
>
> Your code seg faults with both kinds of input.
>
> Thanks,
>
> Vinit
>
> - - - - -
> Check input and
> ​accepted ​
> output for over
> ​6​
> *,​00​0* problems on uDebug !
>
> ​Now including problems from* ACM-ICPC Live Archive* and *Google Code Jam*
> !​
>
>
> Find us on Facebook
> . Follow us on
> Twitter .
>
> On Sat, Sep 5, 2015 at 12:04 PM, yatingarg12 
> wrote:
>
>> # include 
>> using namespace std;
>> int main()
>> {int n,c,p,a[100],x,y;
>> cin>>n;
>> for(int i=0;i> {cin>>c>>p;
>> for(int j=0;j> {cin>>a[j];}
>> for(int j=0;j> for(int k=j+1;k> {if(a[j]+a[k]==c){x=j+1;y=k+1; break;}}
>> cout<<"Case #"<> return 0;
>> }
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/4842d4f2-732d-4490-8c6c-384d954da67a%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CA%2BXgmOU79UO%3DMHvgGz4uLMfnPBdxg_%3DquX0VR7u2%3DPTty_%2BTMw%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-PQ4EnqCrte5B0%2B78x3bscVg2Di4u4Rke4fAxr_TdiwmA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Store Credits

2015-09-05 Thread Luke Pebody
It won't work for the large data set because you have only made an array of
size 100 and you might need an array of size 2000.

On Sat, Sep 5, 2015 at 7:30 AM, yatingarg12  wrote:

> # include 
> using namespace std;
> int main()
> {int n,c,p,a[100],x,y;
> cin>>n;
> for(int i=0;i {cin>>c>>p;
> for(int j=0;j {cin>>a[j];}
> for(int j=0;j for(int k=j+1;k {if(a[j]+a[k]==c){x=j+1;y=k+1; break;}}
> cout<<"Case #"< return 0;
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/0cc78c96-b7c8-4421-a21c-b2029c4d4fce%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-Ok9HoNbhb2FArAhZvs88zkAQcXA8FCk%3DgtH3WK7DT6hw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Multiple Messages in Distributed Code Jam

2015-06-14 Thread Luke Pebody
Cool. This information will be useful, thankyou.

Sent from my iPad

 On 14 Jun 2015, at 13:34, Onufry Wojtaszczyk (Onufry) onu...@google.com 
 wrote:
 
 W dniu piątek, 12 czerwca 2015 08:43:01 UTC+2 użytkownik Luke Pebody napisał:
 Suppose node 180 does PutInt(280, 1); Send(280); PutInt(280, 2); Send(280);
 and then, 6 minutes later, node 280 does Receive(180); int x = GetInt(180); 
 Receive(180); int y = GetInt(180);.
 
 Which of these describes the values of x and y?
 
 1) x=1 and y=2 (180 sent [1] and [2], 280 received both)
 
 This one. Once you call Send, the message is sent, and you can begin a new 
 message, without any interaction with the previous one.
 
 Onufry
 
 2) x=1 and y=1 (180 sent [1] and [1,2], 280 received both)
 3) x=2 and y hangs (180 sent [1], but overwrote it with [2], 280 received 
 the latter)
 4) x=1 and y hangs (180 sent [1], but overwrote it with [1, 2], 280 received 
 the latter)
 
 Sent from my eMail
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/google-code/8dca3978-297a-46f0-8d1c-bf107a9e8050%40googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/7573C3F3-8EDD-4E14-AA61-51D6B018ECA7%40pebody.org.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Not sure if proposed solution for Shhhhh is possible with messaging system in use

2015-06-13 Thread Luke Pebody
Sorry for the stupid question, but where is the editorial?

On Sat, Jun 13, 2015 at 4:50 AM, Stanislav Zholnin 
stanislav.zhol...@gmail.com wrote:

 Thank you for editorial! Previously there was usually no editorial for
 practice rounds (if you look into 2008), so this is nice development.

 Referring to problem Sh, official editorial states:

 One way to handle this is to designate one node to be the master, and to
 handle distributing the intervals to calculate. This will also be the node
 that will output the answer. When any other node, going around the cycle
 from one special point, finds another special point, it will report the
 distance between them to the master. The master will then tell the
 reporting node what is the next special point it should start from (or that
 the calculation is finished, and it should exit).

 I don't know how to make it work, as we do not have way of checking if
 there is incoming message from another node and as soon as Master called
 Receive it is commited to wait for incoming message from that specific
 node. So, though paragraph above makes perfect sense in real life, within
 contests as it is now, we can't have master node acting like server -
 waiting for incoming messages and responding to other nodes.

 Do I miss something here?

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/e901ae21-0f69-4d96-9582-1030d7549e17%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-MGLvoFHuyWLNNmP8Ny5TRTJ4afvEcveo%2BmXCQBKJY0dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Not sure if proposed solution for Shhhhh is possible with messaging system in use

2015-06-13 Thread Luke Pebody
You can specify -1 as the node to receive from, and you block until you
receive from any node.
On 13 Jun 2015 04:51, Stanislav Zholnin stanislav.zhol...@gmail.com
wrote:

 Thank you for editorial! Previously there was usually no editorial for
 practice rounds (if you look into 2008), so this is nice development.

 Referring to problem Sh, official editorial states:

 One way to handle this is to designate one node to be the master, and to
 handle distributing the intervals to calculate. This will also be the node
 that will output the answer. When any other node, going around the cycle
 from one special point, finds another special point, it will report the
 distance between them to the master. The master will then tell the
 reporting node what is the next special point it should start from (or that
 the calculation is finished, and it should exit).

 I don't know how to make it work, as we do not have way of checking if
 there is incoming message from another node and as soon as Master called
 Receive it is commited to wait for incoming message from that specific
 node. So, though paragraph above makes perfect sense in real life, within
 contests as it is now, we can't have master node acting like server -
 waiting for incoming messages and responding to other nodes.

 Do I miss something here?

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/e901ae21-0f69-4d96-9582-1030d7549e17%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-PxneKvQu%3DNsoNbS8H87h7O8kstGdXJs%3D_mi%3D%2B1nWN2Tw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[gcj] Multiple Messages in Distributed Code Jam

2015-06-12 Thread Luke Pebody
Suppose node 180 does PutInt(280, 1); Send(280); PutInt(280, 2); Send(280);
and then, 6 minutes later, node 280 does Receive(180); int x = GetInt(180); 
Receive(180); int y = GetInt(180);.

Which of these describes the values of x and y?

1) x=1 and y=2 (180 sent [1] and [2], 280 received both)
2) x=1 and y=1 (180 sent [1] and [1,2], 280 received both)
3) x=2 and y hangs (180 sent [1], but overwrote it with [2], 280 received the 
latter)
4) x=1 and y hangs (180 sent [1], but overwrote it with [1, 2], 280 received 
the latter)

Sent from my eMail

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/4C06A75D-70D9-4814-8C42-D30E932AC2EB%40pebody.org.
For more options, visit https://groups.google.com/d/optout.


[gcj] dcj.sh for mac os x

2015-06-11 Thread Luke Pebody
Has anybody gotten dcj.sh to run on mac os x? Despite being ok at
algorithms, I am terrible at computers. I figured that mac os x = linux
as people who are good at computers tell me, so I downloaded the linux
version, but I am getting the message ld: library not found for -lcrt0.o.

Thanks all,

Luke

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-OOHbE-Miqs6pvFTnzHrnAOphiRLdZ8fj2cxK8%2BSqEpDg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] a Linear Programming approach to problem B of round 2

2015-06-11 Thread Luke Pebody
Check out my (linguo, 36th) solution to C-Large. Python solution using
linear programming tool. Make that runnable on your machine and you could
do the same.
On 10 Jun 2015 09:38, bigOnion haibren...@gmail.com wrote:

 On Wednesday, June 10, 2015 at 10:16:19 AM UTC+3, M.H. wrote:
   I know that obviously coding a solution to LP is much harder than the
 simple analysis of this specific problem.
 
  I think, GNU Octave + GLPK are acceptable tools in this contest (as both
 of them are open-source and free), so solving a LP (and MILP) problem is as
 hard as filling three matrices and calling one function. Correct me if I am
 wrong.
 
 

 Obviously you are right.

 A few questions, if you may:

 1. Do you know if octave and GLPK run smoothly on windows? Never heard of
 GLPK and I always had the impression that Octave is only for linux, but I
 search around and see that I may have been wrong about that.

 2. Is it possible to call such methods from another language? Specifically
 python, which is my bestest and most favorite language of use? Is it easy?

 3. Is it possible to have complete accuracy in octave/glpk when handling
 fractions? I have that option in python using the Fraction class, but I am
 not sure how many other languages have such classes...

 Thanks

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/10f414c5-ccf0-4f58-b27f-2773b3a58712%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-M%3D4fvqt7bbCsMOTKuWJX%2Bnpfq9POfAjZX3UbZipZx%3DAw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] a Linear Programming approach to problem B of round 2

2015-06-11 Thread Luke Pebody
Indeed I did. The linear programming library I used did not give accurate
enough answers on the small data set to pass, so I solved the dual problem
instead, which turned out to be quite easy.

On Tue, Jun 9, 2015 at 9:50 PM, Edward Lockhart edward.lockh...@gmail.com
wrote:

 Yes - see for example linguo's solution.
 He solved bilingual as an integer linear programming problem too.

 Edward

  On 9 Jun 2015, at 21:09, bigOnion haibren...@gmail.com wrote:
 
  During round 2 I recognized that problem B can be described as a Linear
 Programming problem.
 
  There are two restrictions:
  R_1 * t_1 + ... + R_n * t_n = V
  C_1 * R_1 * t_1 + ... + C_n * R_n * t_n = V * X
 
  t_1, ..., t_n are all non-negative
 
  Finally the objective is:
  Minimize (max{t_1, ...,  t_n} )
 
  That's quite a regular LP problem.
 
  I know that obviously coding a solution to LP is much harder than the
 simple analysis of this specific problem. Nevertheless, I was wondering –
 did anyone tried to solve it this way? I know that LP might need more time
 to solve. Is it doable in the GCJ time constraints (i.e., does it take less
 than 8 minutes to get the full output?) Does anyone know?
 
  --
  You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
  To unsubscribe from this group and stop receiving emails from it, send
 an email to google-code+unsubscr...@googlegroups.com.
  To post to this group, send email to google-code@googlegroups.com.
  To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/e782962e-7d0e-4fb0-b46d-d39f850e346b%40googlegroups.com
 .
  For more options, visit https://groups.google.com/d/optout.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/CD8F176F-A884-4F52-8CD6-30C1E8BE60D1%40gmail.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-MYAQ-b_f9hfhD%2BOx3ozj7Q-OaaS9vraNrtGyqmkVby7w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] dcj.sh for mac os x

2015-06-11 Thread Luke Pebody
Thanks! I will see if I have an opportunity to try it before the trial
round ends. Would be great to work out what is wrong with my submission.
On 11 Jun 2015 20:55, 'Ahmed Aly' via Google Code Jam 
google-code@googlegroups.com wrote:

 Hi Luke,

 We've just release a new version for Mac OS, please take a look and try
 it: https://code.google.com/codejam/distributed_guide.html

 --
 Ahmed Aly

 On Wed, Jun 10, 2015 at 9:29 PM, Luke Pebody l...@pebody.org wrote:

 Has anybody gotten dcj.sh to run on mac os x? Despite being ok at
 algorithms, I am terrible at computers. I figured that mac os x = linux
 as people who are good at computers tell me, so I downloaded the linux
 version, but I am getting the message ld: library not found for -lcrt0.o.

 Thanks all,

 Luke

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/CAECKw-OOHbE-Miqs6pvFTnzHrnAOphiRLdZ8fj2cxK8%2BSqEpDg%40mail.gmail.com
 https://groups.google.com/d/msgid/google-code/CAECKw-OOHbE-Miqs6pvFTnzHrnAOphiRLdZ8fj2cxK8%2BSqEpDg%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.




 --
 Ahmed Aly | Software Engineer | ahmed...@google.com | +1-650-283-1843

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/CAK4xB7aAFbV9EXn6b1DBeqk_AsWZNTSfkj6LkXPp%3DWEh59jSdg%40mail.gmail.com
 https://groups.google.com/d/msgid/google-code/CAK4xB7aAFbV9EXn6b1DBeqk_AsWZNTSfkj6LkXPp%3DWEh59jSdg%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-MC4ojxhc5C_n2nMPwS1-oXO5SYp5OqzjxoV%3DdK_ze9ow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Messages in Polish in parunner.exe

2015-06-11 Thread Luke Pebody
To prawda, sens, co jest powiedziane, może być wyrażona przez moc potężna
tłumaczyć Google'a
On 11 Jun 2015 21:03, evandrix evand...@gmail.com wrote:

 On Wednesday, June 10, 2015 at 4:17:38 AM UTC+8, Stanislav Zholnin wrote:
  Hi,
 
  Is it intended behavior that parunner.exe at some point prints messages
 in Polish?
 
  I am trying to use -trace_comm=true to see things like:
  czekam na wiadomość od instancji.
 
  It is similar enough to Russian for me to have any problems, but might
 be different for other contestants.

 Yes, I've raised a request to the author, and it's been partially resolved
 here: https://github.com/robryk/parunner/issues/4

 Google Translate does pretty well in the interim, I must say.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/df1f5f71-abf2-47be-9dfc-6fdb93cd284b%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-PCwTE-mHJxEZdXWtOA8Taf9XfX%3DDk_gQTh-uX%3DqTegJw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[gcj] Alternate solution to Qualification Round problem 'Dijkstra'

2015-05-17 Thread Luke Pebody
Thinking about regular expressions this weekend (and how they are
equivalent to discrete finite-state automatons), I realised that Problem C
from this year's Qualification Round could be solved quite cleanly by a
regular expression. I compiled a 653,804 character regex that would work,
but in order for it to compile in python, I needed to change the groups to
be non-capturing, which increased it to 880,876 characters. I'm sure there
is a shorter version of the regex possible.

I have left the beautiful regex solution at
https://gist.github.com/anonymous/b9e1f03249c7c2834484

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CADat-Gfr1Mz4gv5mxY_0v1TY_ft2%3D4VBcoYXr3D98Cu%3D2uaQeA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[gcj] Alternate solution for 2015 Qualification Round problem 'Dijkstra'

2015-05-17 Thread Luke Pebody
Thinking about regular expressions this weekend (and how they are
equivalent to discrete finite-state automatons), I realised that Problem C
from this year's Qualification Round could be solved quite cleanly by a
regular expression. I compiled a 653,804 character regex that would work,
but in order for it to compile in python, I needed to change the groups to
be non-capturing, which increased it to 880,876 characters. I'm sure there
is a shorter version of the regex possible.

I have left the beautiful regex solution at
https://gist.github.com/anonymous/b9e1f03249c7c2834484

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-Ozm-EG94F88TV1EPFgFzN5F%3DhxHEHRNyfL%2BFqqc4_dZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Any non-brute force solution for Typewriter monkey (Round 1C 2015 B)?

2015-05-11 Thread Luke Pebody
Dang it, you had this brainwave 3 hours before me.
On 12 May 2015 04:09, Joseph DeVincentis dev...@gmail.com wrote:

 Today while I was trying to explain this problem to a friend, I realized
 there was a simpler solution. No looping through letters typed or tracking
 states is necessary. To find the expected value, you just need to add up
 the number of sequences of S keypresses which have the target string
 starting at position 1, those which have the target string starting at
 position 2, etc. and divide by the K^S possible sequences. This counts some
 strings multiple times, but in exactly the way that we want; every
 occurrence of the target string, including overlapping ones, will be
 counted.

 The number of sequences with the target string in a given position is just
 the product of the number of keys containing each letter in the target
 string, for those positions, times K^(S-L) for the other positions which
 can be any key whatsoever.

 There are S-L+1 positions where the target string could start. So if X is
 the product of the number of keys containing each letter of the target,
 then the expected number of matches is X*(S-L+1)*K^(S-L)/K^S, or simply
 X*(S-L+1)/K^L.



 On Sun, May 10, 2015 at 8:40 PM, Joseph DeVincentis dev...@gmail.com
 wrote:

 I was already qualified, so I didn't wake up at 5 this morning to solve
 this round, but I just completed all the problems in practice.

 For typewriter monkey, the maximum matches is easy. Find the longest
 initial substring which matches a final substring of the target, shorter
 than the whole string. This is the maximum they can overlap, and L minus
 this length is how many more letters you have to add to the initial L for
 each subsequent match.

 I used a dynamic programming strategy to calculate the number of expected
 matches. At each position p in the string, keep track of how many of the
 k^p possible strings the monkey could have typed end with the correct 1
 first letter, 2 first letters, ..., L-1 first letters of the target. It is
 possible that a single state matches more than one case; for instance, if
 the target string was ANAGRAM, and the monkey has typed BANA, he has both 1
 correct letter and 3 correct letters for two different possible ways to
 match the word. But these overlaps are fixed; for this example, the monkey
 will always have 1 correct every time he has 3 correct. So there are at
 most L (100) states at any given time, including 0 correct.

 For each letter typed, go through the list of states from the previous
 letter, and find all the letters which will extend any of the strings, and
 the new set of initial substrings of the target which will be matched after
 that letter is typed. For the example above, if the monkey types G, he now
 has 4 correct letters, if N, 2 correct letters, and if A, 1 correct letter.
 If he types any other letter he has no correct letters.

 For each of these cases, multiply the number of ways the previous state
 was reached by the number of keys with that letter on the keyboard to get
 the number of ways to arrive at the new state. Store this in the set of
 states for the next iteration, adding it to the existing value if there was
 another way to get to this state. If the new state includes L correct
 letters (a complete match), don't include this in the new state, but add
 this to a running total of complete matches to the target string. Since
 this will be a match for all possible letters the monkey can type after
 this, the number you need to add is the number of ways to get here times
 K^R, where R is the number of remaining letters the monkey can type.

 When you reach the end of the string of S letters, divide the total
 number of matches by K^S to get the expected number of matches.


 On Sun, May 10, 2015 at 12:49 PM, Vincent Le Quang 
 vincent.lequ...@gmail.com wrote:

 For the question Round 1C 2015 B, (typewriter monkey), I think there
 must have been an elegant non-brute force method. But with the pressure of
 time I just decided to just go brute force and it was only good to solve
 the small data-set. (meaning trying out every typing combinations and
 counting probabilities).

 How did you guys manage to solve the large data-set?

 Thanks.

 --
 You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/2d98a18c-d205-4ca1-b41d-5d40bf9cf390%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.



  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to 

Re: [gcj] Just found out there's the solution / analysis for each problems in the code jam

2015-05-10 Thread Luke Pebody
There's a link to all of the old problems, submissions and analyses at
https://code.google.com/codejam/contests.html


On Sun, May 10, 2015 at 6:20 PM, Vincent Le Quang vincent.lequ...@gmail.com
 wrote:

 I'm a bit noob at this code jam thingy. I just realized there's analysis
 and solution for each of the past rounds!
 Qualification round:
 https://code.google.com/codejam/contest/6224486/dashboard#s=aa=4

 Round 1A:
 https://code.google.com/codejam/contest/4224486/dashboard#s=a

 Round 1B:
 https://code.google.com/codejam/contest/8224486/dashboard#s=a

 Round 1C:
 (guess we'll have to wait)

 Awesome!

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/d1340f7d-9cb1-476d-8a2e-d22b279df1c9%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-NNV%2BXYEFLfoxs6GMkpLKa%3Dm0oiC1R2zPeo0_abDM6xCA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Python Fast Enough For CodeJam?

2015-04-19 Thread Luke Pebody
There was no problem D in 2015 Round 1A.

On Sun, Apr 19, 2015 at 5:08 AM,
ll william...@gmail.com
wrote:

 As others have stated, Python is definitely fast enough. The problems are
 designed specifically so that there is leeway for slower languages.

 That being said, there are certain problems that are easier to do with
 other languages. For example, in the recent 2015 Round 1A Problem D, look
 at the fourth place contestant winger. His program for the large input is
 essentially a brute force crack with time complexity T * N^3 (T = 14, N =
 3000). However, it ran within the time limits due to well optimized code
 run on a 16 core computer. I can't imagine the same method working for
 Python.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/854d741a-3e5b-43fd-ab27-a89a75db2495%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-McKH6VuKe5Yjx32ARRdis4VpB-0UogL%3DZYhha%2BU06JvQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Can we do many Round 1?

2015-04-17 Thread Luke Pebody
Yes.

On Fri, Apr 17, 2015 at 6:08 PM, Vincent Le Quang vincent.lequ...@gmail.com
 wrote:

 I think in previous Google Code Jams, you could try the first Round 1,
 then if you failed, you could do the second Round 1 and the third.

 I just want to confirm, is it still the case? If I fail the first Round 1,
 can I try it again the next Round1?

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/532cf635-850a-472e-bab9-a661fdea696c%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-MYntwgCqnkdR%3DXA_-RvmUTLTuN%2Bdn-OhZ9gMmZ_LZVMg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Please help me with the Small B. Getting wrong.

2015-04-12 Thread Luke Pebody
1) If you have 6 stacks of size 4, then you are best off just letting
everyone eat
2) If you have a stack of size 9, the best thing to do is to have one
special minute where you give 3 to some other hungry customer, and then
another special minute where you do the same.

On Sun, Apr 12, 2015 at 9:10 AM, utkarsh gupta guptautkarsh2...@gmail.com
wrote:

 For small B, what I did was to first divide all the maximum sized pancakes
 to half giving the extra half to empty plates.Now it will be take special
 minutes equal to the frequency of maximum sized sized pancake.Check if the
 new maximum sized pancake + the special minutes added is less than your
 initial ans, update answer if it less. Now again divide the maximum into
 two add the special minutes required and check if the new maximum  +
 special minutes is less the your previous ans . Keep doing it until you
 have divided each pancake such that every pancake is either = 3 ,because
 for pancake = 1,2,3 answer will be same.
 Any help is appreciated.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/327a0d00-dc6c-4062-900c-d84da294ee6b%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-ObXjSZBj021L5LkFo3PMBOFso8zLSy7y57VNxLb_%3DWtw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Can't find problem in Magic Trick Program

2015-04-08 Thread Luke Pebody
Quick code review:

1. Your use of .replace(\n, ) is to get rid of an ending newline. It is
more pythonic to use .strip()

2. Suggest defining functions readInt() for int(s_input.readline()) and
readWords() for s_input.readline().split(). Note that if you do not specify
what you are splitting by, then you are splitting by chunks of whitespace.

3. Are you sure you are giving the correct answer when there is exactly one
number in common on the corresponding rows?

4. When you set row = grid.append(...), you aren't using the variable row,
so you can get rid of the row= part.

5. A bit picky here, but I don't agree with decreasing case_total by 1 each
case you do. The total number of cases stays the same. You could change the
parameter name to cases_left, or change the condiyion to case_number =
case_total.
On 9 Apr 2015 03:52, Kenny Kang kennykang...@gmail.com wrote:

 Hi I'm new to programming so sorry if i seem very inexperienced.

 When I ran my magic trick program I wasn't able to get the correct answer
 for every case. Can anyone help me find the problem in my program? I can't
 seem to find what's wrong



 s_input = open(/home/pi/Desktop/Code Jam Practice/Code Jam 2014/Magic
 Trick/A-small-practice.in, r)
 s_output = open(/home/pi/Desktop/Code Jam Practice/Code Jam 2014/Magic
 Trick/A-small-practice.out, w)

 case_total = int(s_input.readline())
 case_number = 1

 #Test Case while case  0
 def test_case():
 global case_total
 global case_number

 first_guess = int(s_input.readline().replace(\n, ))
 grid_1 = []
 #Make grid 1
 for i in range(0,4):
 row = grid_1.append(s_input.readline().replace(\n, ).split(
 ))

 second_guess = int(s_input.readline().replace(\n, ))
 grid_2 = []
 #Make grid 2
 for i in range(0,4):
 row = grid_2.append(s_input.readline().replace(\n, ).split(
 ))

 num_count = 0
 for i in grid_1[first_guess - 1]:
 if i in grid_2[second_guess - 1]:
 num_count += 1
 #Check Answer
 if num_count  1:
 answer = Bad magician!
 elif num_count == 1:
 answer = i
 elif num_count == 0:
 answer = Volunteer cheated!

 #Return Answer
 s_output.write(Case #%s: %s\n % (case_number, answer))
 case_total -= 1
 case_number += 1
 print answer

 #run
 while case_total  0:
 test_case()


 s_input.close()
 s_output.close()

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/0caee8c6-18f8-4d63-9c53-b65fc2d35316%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-Od1DtYhicfaM6OEEZpqu5UNq4%3D_tcvANZ57VrJrXmu_g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Please help me with solution submission...

2015-04-03 Thread Luke Pebody
Also, if you have saved a python script called myScript.py and downloaded
an input file called myData.in then you can run from the command line

myScript.py  myData.in  myOutput.out

On Fri, Apr 3, 2015 at 7:21 AM, ambreen haleem ambreen2...@gmail.com
wrote:

 I don't write in python much, but there are online tutorials on file
 processing.
 E.g. to write output you can do as follows:

 myfile=open(output.txt,'w')
 myfile.write(string to write)

 to read the file

 rfile=open(input.txt,'r')
 content = rfile.read()

 And you can change the first parameter in the open to the name of the
 input file you downloaded from the problem page. Where is the link to
 broken watch?

 link to reading/writing to file :
 http://learnpythonthehardway.org/book/ex16.html



 On Thu, Apr 2, 2015 at 11:06 PM, SYED FAHD sforsyed...@gmail.com wrote:

 I'm actually stuck in using command line tool and can you tell me how can
 i run my program against an input file and generate an output file in
 python.

 On 3 April 2015 at 00:35, Carlos Guia carlos.guia.v...@gmail.com wrote:

 You have to download the input file, run your program against it to
 generate the output file and submit that output file. The judge will
 determine the correctness based on your output file.

 During practice mode, that's all you have to do. It will tell you if
 it's correct or not.

 During a live contest, you'll also have a way to (and will be required
 to) upload your source code along with your output file.

 For now concentrate in being able to download input, use your code to
 produce an output file and submit it. The qualification round is long
 enough for you to see how the source code is uploaded, but it should pretty
 straightforward once you've practiced (it's basically just like the one for
 the output file). Be sure to upload the source code and output file to the
 correct fields though.

 Carlos Guía

 On Thu, Apr 2, 2015 at 12:23 AM, sforsyed158 sforsyed...@gmail.com
 wrote:

 here is my code for problem broken watch using python

 N = int(raw_input())
 for Z in range(1,N+1):
 A =
 [[1,1,1,1,1,1,0],[0,1,1,0,0,0,0],[1,1,0,1,1,0,1],[1,1,1,1,0,0,1],[0,1,1,0,0,1,1],[1,0,1,1,0,1,1],[1,0,1,1,1,1,1],[1,1,1,0,0,0,0],[1,1,1,1,1,1,1],[1,1,1,1,0,1,1]]
 b = raw_input()
 B = []
 for i in range(int(b[0])):
 B.append([])
 w = 0
 for i in b[2:]:
 if i ==  :
 w +=1
 else:
 B[w].append(int(i))
 Must = [0,0,0,0,0,0,0]
 for i in B:
 for r in range(7):
 if i[r] == 1:
 Must[r] = 1
 else:
 pass
 def MustMatch(l1,l2):
 result = True
 for i in range(7):
 if Must[i] == l2[i] ==1 and l2.count(1) = l1.count(1):
 if l1[i] == 1:
 pass
 else:
 result = False
 if l1[i] == 1:
 if l2[i] == 1:
 continue
 else:
 result = False
 return result
 def Matches(l1,l2):
 result = 0
 for i in range(len(l1)):
 if l1[i] == 1 == l2[i]:
 result +=1
 return result
 def GSI(l):
 li = l[:]
 result = []
 for i in range(len(li)):
 m = li.index(min(li))
 result.append(m)
 li[m] = 
 return result[::-1]
 ANS = ERROR!
 S = []
 w = 0
 while w  len(B):
 if w == 0:
 s = []
 scores = []
 for i in range(10):
 if MustMatch(B[w],A[i]) == True:
 scores.append(Matches(B[w],A[i]))
 else:
 scores.append(0)
 s = GSI(scores)
 for i in s:
 if scores[i]  0:
 S.append(i)
 else:
 s = []
 scores = []
 for i in S:
 if MustMatch(B[w],A[i-w]) == True:
 scores.append(Matches(B[w],A[i-w]))
 else:
 scores.append(0)
 for i in range(len(S)):
 if scores[i]  0:
 s.append(S[i])
 S = s
 w+=1
 if len(S) == 1:
 ANS = 
 for i in range(7):
 if Must[i] == 1:
 ANS = ANS+str(A[S[0]-w][i])
 else:
 ANS = ANS+str(0)
 print Case #%i: %s % (Z,ANS)

 --
 You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/c0188ece-7fdf-45e2-8780-6083b3b35b06%40googlegroups.com
 .
 For more options, visit 

Re: [gcj] C++11

2015-03-31 Thread Luke Pebody
You can use any language you like, as long as it has a free compiler and
interpreter. C++11 does, so it is perfectly legal.

On Wed, Apr 1, 2015 at 5:48 AM, ambreen haleem ambreen2...@gmail.com
wrote:

 Can we use C++11 standard ?

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/588d9f8b-e9f3-4d3e-bf6b-6a9133c8fcf7%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-P3H%3D-Z2HiOYa%3D4rGQFBGQjHVxkV_BT9XnnM8qo8LfVkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Square Fields - Google Code Jam

2015-01-28 Thread Luke Pebody
The crux of this solution is in the recursive function Rec. I have
rewritten this with easier to read variable names and with commenting at

http://ideone.com/TNrdFO

Essentially it recursively goes through all ways of separating these into
at most k sets, finds the minimum square size needed for each way and then
outputs the best one it has found.

On Wed, Jan 28, 2015 at 12:31 PM, sujit sali.su...@gmail.com wrote:

 Hi,

 I am not able to understand the solution of Square Fields problem.

 Problem - https://code.google.com/codejam/contest/32004/dashboard#s=p1

 Can you please explain below given solution for this problem (in detail)?


 --
 Solution -

 --

 #define _CRT_SECURE_NO_DEPRECATE
 #include cstdio
 #include algorithm
 #include iostream
 using namespace std;

 int N,kk,n,res,j;
 int x[100],y[100];
 int mnx[100],mny[100],mxx[100],mxy[100];


 void inline Rec(int i, int k, int sz)
 {

 if (k=kk  sz=res)
 {
 if (i==n)
 {
 res=min(res,sz);
 }
 else
 {
 for (int j=0; j=k; ++j)
 {
 int omnx=mnx[j],omny=mny[j],omxx=mxx[j],omxy=mxy[j];
 mnx[j]=min(mnx[j],x[i]);
 mny[j]=min(mny[j],y[i]);
 mxx[j]=max(mxx[j],x[i]);
 mxy[j]=max(mxy[j],y[i]);

 Rec(i+1,max(k,j+1),max(sz,max(mxx[j]-mnx[j],mxy[j]-mny[j])));
 mnx[j]=omnx,mny[j]=omny,mxx[j]=omxx,mxy[j]=omxy;

 }
 }
 }
 }

 int main()
 {
 #ifndef ONLINE_JUDGE
 freopen(B-small-attempt0.in, r, stdin);
 freopen(output.txt, w, stdout);
 #endif
 scanf(%d,N);
 for (int ii=0; iiN; ++ii)
 {
 scanf(%d%d,n,kk);
 for (int i=0; in; ++i)
 scanf(%d%d,x[i],y[i]);
 for (int i=0; i100; ++i)
 mnx[i] = mny[i] = 100,
 mxx[i] = mxy[i] = -100;
 res=100;
 Rec(0,0,0);
 printf(Case #%d: %d\n,ii+1,res);
 }
 return 0;
 }

 

 Thanks,
 Sujit

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/72ca9ae5-d9c9-4fab-b879-39539de73fae%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-NZUixBRnnWdLLUAJVgnchYBGXF8b03h2xbNQRsXGEiPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] how to approach this Q?

2015-01-27 Thread Luke Pebody
I have programmed the Binary Indexed Tree approach in C# here:
http://ideone.com/Ammsll

On Wed, Jan 28, 2015 at 3:42 AM, Luke Pebody l...@pebody.org wrote:

 Having verified that the contest this puzzle was in is no longer running:

 If the upper bound on the number of students is 10,000 and the upper bound
 on the number of chocolates is 105 then the total number of deliveries of
 chocolates to students is at most 1,050,000. As such a brute force method
 would work: set an array of the number of chocolates each student has
 (initially 0), and then do the deliveries manually. See
 http://ideone.com/6YqhYm for an implementation of this in Python.

 Now, if the bounds on N, u and k were all increased dramatically, it would
 still be solvable, but you would need a more complicated data structure.
 See this tutorial:
 http://community.topcoder.com/tc?module=Staticd1=tutorialsd2=binaryIndexedTrees


 On Mon, Jan 26, 2015 at 3:52 PM, Yask Srivastava yask...@gmail.com
 wrote:

 On the occasion of Republic day, Chef wants to give away chocolates to
 the students. N students are eagerly waiting for the Chef and they have
 formed a queue.
 Chef has u variety of chocolates. Looking at the strength of the students
 he is sure that he cannot provide chocolates of all the variety to all the
 students. He decided that he will start from ith student and end at jth
 student (0 ≤ i,j  N) and will give them K number of chocolates to each
 student. In the same manner chef distributed all the varieties of
 chocolates.
 Now Lemon Kumar, who is a very friendly student (as his other name is
 Yaar Kumar), has M number of friends. He knows the positions of each of his
 friend in the queue. Now he wants to query for each friend, how many
 chocolates his friend standing on pth position got.
 Input

 First line consists of T, the number of test cases.
 Each test case consists of two number, N u, the number of students in the
 queue and the number of varieties of chocolates Chef has.
 Then follow u lines, giving description of distribution of each variety
 of chocolate, in the format i j k.
 Next line contains M, the number of friends of Lemon Kumar.
 Next M lines contain a position p of Lemon's friend standing in the line.
 Output

 For each test case, print the result of the query for M friends, each on
 a separate line..
 Constraints

 1 ≤ T ≤ 30
 1 ≤ N ≤ 1
 1 ≤ u ≤ 105
 0 ≤ i,jN
 0 ≤ k1
 1 ≤ M1
 0 ≤ pN

 Example

 Input:
 1
 6 4
 3 5 2
 2 4 3
 1 5 1
 0 2 4
 4
 4
 3
 2
 0

 Output:
 6
 6
 8
 4

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/b0dcc504-079d-44db-a004-14ddc39b78a2%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.




-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-PAb%3D-%2B_og-gP2ViCravWVPpkVh9uCRaWdf1o5Q_%2Bf5hA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] how to approach this Q?

2015-01-27 Thread Luke Pebody
Having verified that the contest this puzzle was in is no longer running:

If the upper bound on the number of students is 10,000 and the upper bound
on the number of chocolates is 105 then the total number of deliveries of
chocolates to students is at most 1,050,000. As such a brute force method
would work: set an array of the number of chocolates each student has
(initially 0), and then do the deliveries manually. See
http://ideone.com/6YqhYm for an implementation of this in Python.

Now, if the bounds on N, u and k were all increased dramatically, it would
still be solvable, but you would need a more complicated data structure.
See this tutorial:
http://community.topcoder.com/tc?module=Staticd1=tutorialsd2=binaryIndexedTrees


On Mon, Jan 26, 2015 at 3:52 PM, Yask Srivastava yask...@gmail.com wrote:

 On the occasion of Republic day, Chef wants to give away chocolates to the
 students. N students are eagerly waiting for the Chef and they have formed
 a queue.
 Chef has u variety of chocolates. Looking at the strength of the students
 he is sure that he cannot provide chocolates of all the variety to all the
 students. He decided that he will start from ith student and end at jth
 student (0 ≤ i,j  N) and will give them K number of chocolates to each
 student. In the same manner chef distributed all the varieties of
 chocolates.
 Now Lemon Kumar, who is a very friendly student (as his other name is Yaar
 Kumar), has M number of friends. He knows the positions of each of his
 friend in the queue. Now he wants to query for each friend, how many
 chocolates his friend standing on pth position got.
 Input

 First line consists of T, the number of test cases.
 Each test case consists of two number, N u, the number of students in the
 queue and the number of varieties of chocolates Chef has.
 Then follow u lines, giving description of distribution of each variety of
 chocolate, in the format i j k.
 Next line contains M, the number of friends of Lemon Kumar.
 Next M lines contain a position p of Lemon's friend standing in the line.
 Output

 For each test case, print the result of the query for M friends, each on a
 separate line..
 Constraints

 1 ≤ T ≤ 30
 1 ≤ N ≤ 1
 1 ≤ u ≤ 105
 0 ≤ i,jN
 0 ≤ k1
 1 ≤ M1
 0 ≤ pN

 Example

 Input:
 1
 6 4
 3 5 2
 2 4 3
 1 5 1
 0 2 4
 4
 4
 3
 2
 0

 Output:
 6
 6
 8
 4

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/b0dcc504-079d-44db-a004-14ddc39b78a2%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-Of3TTZ0KiXq%3DzJ2moThUfKTa%2BpunvHsmM8Zec3ok3rWQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Minesweeper - trying the Backtracking approach discussed in Contest Analysis

2015-01-27 Thread Luke Pebody
In the contest analysis it says:

With this insight, we can implement a simpler backtracking algorithm that
places mines row by row from top to bottom with non-increasing number of
mines as we proceed to fill in the next row and prune if the configuration
for the current row is invalid (it can be checked by clicking at the bottom
right cell).
---

This pruning method doesn't actually work when we do the last-but-one row.
When you fill the last-but-one-row, you should also fill the last row as
well.

On Thu, Jan 15, 2015 at 6:53 PM, aman taneja aman.taneja.2...@gmail.com
wrote:

 Hi,
I was trying the backtracking approach discussed in Contest Analysis.

 What I am doing is -
 Say, we take the 5th test case of sample input - 10 10 82 .
 I am filling each row with mines till either 1. I have remaining mines or
 2. i start getting a configuration where the solution is Impossible.


 1. for each row starting from 0, filling each row with
 min(remainingMines,numColumns) eg. min(82,10),
 Thus we get 10 stars('*') in first row and 90 '.' in the below 9 rows.
 Then check whether this configuration gives a valid solvable Game.
 If not, then remove the bottom right-most filled '*' (backtrack and then
 check if this is a valid configuration). Now, the rightmost column to which
 the row could be filled changes to 'c-1'(if c was the previous column).
 If this is not a valid configuration, I would again backtrack and remove 1
 more '*'(the new rightmost filled '*'), else I would add a new '*' to the
 first index of next row.


 In the above test case, 10 10 82, I would fill the first 8 rows
 comfortably, then add 2 '*'s to the next(9th row).
 Now, this config would give Impossible result(by floodfill algorithm).
 Hence, I backtrack to 8 rows of '*' + 1 '*' in the 9th row.Now, this
 config  again gives Impossible answer.
 Thus, I go further back to 80 '*'s. Now, the backtracking solution returns
 to 'main' as I have reached the start of a row and have nowhere to go.


 Code -


 #includeiostream
 #include fstream
 #include cstdlib
 // for getch()
 #includestdio.h

 // For clock time and time duration stats
 #include time.h

 #include map
 #include vector
 #include string
 #include cstring

 #include set
 #include algorithm
 #include utility
 #include list
 #include queue
 #include stack
 #include limits.h
 #include iomanip
 #include math.h
 #include cmath
 #include assert.h
 #include complex
 #include valarray

 using namespace std;


 // Default For loop with variable name i, first = 0,
 increment = 1
 #define FOR_DEF(i, last) QL_FOR(i, 0, last, 1)
 #define QL_FOR_DEF FOR_DEF

 // check whether indices in range of an array/matrix
 #define in_bounds(x, y, r, c) (x  r  y  c  x = 0  y = 0)

 typedef pairint,int p_ii_t;
 typedef p_ii_t P_II;

 const int diff[]={-1,0,1};

 bool noNeighborMine(int (*bc)[51],int R,int C,int p,int q){
 QL_FOR_DEF(i,3){
 QL_FOR_DEF(j,3){
 if( in_bounds(p+diff[i],q+diff[j],R,C) 
 2==bc[p+diff[i]][q+diff[j]])
 return false;
 }
 }
 return true;
 }

 bool openAllNeighbors(int (*bc)[51],int R,int C,int p,int q,int
 safe,queueP_II qu){
 QL_FOR_DEF(i,3){
 QL_FOR_DEF(j,3){
 if( in_bounds(p+diff[i],q+diff[j],R,C) 
 !bc[p+diff[i]][q+diff[j]]){
 --safe;
 if(!safe)
 return true;
 bc[p+diff[i]][q+diff[j]]=1;
 qu.push(MKP(p+diff[i],q+diff[j]) );
 }
 }
 }
 return true;
 }
 /*  board - orig board
 cr - current row
 cc - current col, upto which the mines were filled in the last row.
 Note that the mines would get filled in a non-increasing fashion.
 Hence, the current col index can't exceed the one immediately before.

 R- tot rows
 C- tot cols
 safe - no. of non-mine/valid places yet to be uncovered
 */
 bool validConfig(int (*board)[51], int R,int C,int safe){
 if(2==board[R-1][C-1])return false;
 // copy board current config for validation
 int bc[51][51];
 QL_FOR_DEF(i,R){
 QL_FOR_DEF(j,C){
 bc[i][j]=board[i][j];
 }
 }

 // apply flood-fill
 queueP_II q;

 // clicked first block
 q.push( MKP(R-1,C-1) );
 bc[R-1][C-1]=1;
 --safe;

 while(!q.empty()){
 P_II p=q.front();
 q.pop();
 if(noNeighborMine(bc,R,C,p.first,p.second))
 openAllNeighbors(bc,R,C,p.first,p.second,safe,q);
 if(!safe)
 return true;
 }
 return false;
 }

 void backtrack_mines(int (*board)[51],int R,int C, int cr,int cc,int
 safe,int cnt){

 // put at most 1 

Re: [gcj] Compile Error

2014-11-07 Thread Luke Pebody
This seems to compile fine. Are you entering it as a different language
than C++?

On Fri, Nov 7, 2014 at 5:15 PM, Xiongqi ZHANG zhangxion...@gmail.com
wrote:

 Why would you need to capture runtime exception?

 2014-11-07 21:43 GMT+08:00 Hussam Cheema hussam7...@gmail.com:

 Guys UVA identify Compile error in this program plss help me out!!

 #includeiostream
 using namespace std;


 int main(){

 int T, num, greater, i, arr[50];
 int count=0;
 int *p;

 p=arr;

 cinT;
 try{
 if(T=50){

 while(T0){

 cinnum;
 greater=0;
 count++;

 for(i=0; inum; i++){

 cin*(p+i);

 if(greater*(p+i)) greater = *(p+i);

 }


 coutCase count: greaterendl;

 T--;

 }

 }
 }catch(runtime_error e){
 throw e;
 }

 return 0;

 }

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/b4cf295f-d61b-4198-a80e-2cefa9acaaa9%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/CAGDEU-%2BtBgetLLtwPohphC0x1ptuQBDmgpeneaim-Q%2BTZnZJ_w%40mail.gmail.com
 https://groups.google.com/d/msgid/google-code/CAGDEU-%2BtBgetLLtwPohphC0x1ptuQBDmgpeneaim-Q%2BTZnZJ_w%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-N5Ltk4Em9PowsS9mjRayOAcNLbp%3DwY0%3DjD5nq8pnkzBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Code Jam 2015 schedule

2014-10-11 Thread Luke Pebody
Seems unlikely, because there is no google office in Douala.

On Sat, Oct 11, 2014 at 2:41 PM, kwaye kant gabrielkw...@gmail.com wrote:

 @Luke in Douala/Cameroon , central Africa. Why not?

 On Oct 10, 2014 8:39 PM, Luke Pebody l...@pebody.org wrote:

 What city is the finals in?

 ... are the finals in?

 Luke

 On Fri, Oct 10, 2014 at 8:17 PM, 'Igor Naverniouk' via Google Code Jam 
 google-code@googlegroups.com wrote:

 Hi All,

 We're close to announcing the 2015 Code Jam schedule! But we want your
 feedback first. Here is the proposed schedule.

 DescriptionDurationTime (UTC)DateRegistration Opens1 month20:00Tuesday,
 March 3rdQualification Round27 hr23:00Friday, April 3rdQualification
 Round Ends | Reg Closesn/a3:00Saturday, April 4thRound 1A2 hr 30 
 min1:00Saturday,
 April 18thRound 1B2 hr 30 min16:00Saturday, May 2ndRound 1C2 hr 30 min
 9:00Sunday, May 17thRound 22 hr 30 min14:00Saturday, June 6thRound 32
 hr 30 min14:00Saturday, June 20thOnsite Finals4 hrsTBDFriday, August
 21st

 We did our best to avoid any overlap with other major programming
 competitions and holidays. If you know of any serious conflicts that
 will affect a significant number of contestants *please reply to this
 email by October 17th.*

 Thanks!
 The Google Code Jam Team

 --
 You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/CAKsNUjaFAhn4dr9_4q%3D4%3DtOSCzO4nwX5hpUx0zD_UuZ5%2B4SWSA%40mail.gmail.com
 https://groups.google.com/d/msgid/google-code/CAKsNUjaFAhn4dr9_4q%3D4%3DtOSCzO4nwX5hpUx0zD_UuZ5%2B4SWSA%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/CAECKw-PAVjPpJhJHArc%3DTaCHQpzuC6RZTKA8%2BkDZ4rgK_md8Vg%40mail.gmail.com
 https://groups.google.com/d/msgid/google-code/CAECKw-PAVjPpJhJHArc%3DTaCHQpzuC6RZTKA8%2BkDZ4rgK_md8Vg%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.

  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/CALRvV15gsooQsSk9H7dB3NyS7%2BrxkU%2B77BMxkmuHyVBwvTFSVQ%40mail.gmail.com
 https://groups.google.com/d/msgid/google-code/CALRvV15gsooQsSk9H7dB3NyS7%2BrxkU%2B77BMxkmuHyVBwvTFSVQ%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-NhekDR%3DZ9PkVkgT402Mc7s8COtpcO-Xkse%3Dir50A1NLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Code Jam 2015 schedule

2014-10-10 Thread Luke Pebody
What city is the finals in?

... are the finals in?

Luke

On Fri, Oct 10, 2014 at 8:17 PM, 'Igor Naverniouk' via Google Code Jam 
google-code@googlegroups.com wrote:

 Hi All,

 We're close to announcing the 2015 Code Jam schedule! But we want your
 feedback first. Here is the proposed schedule.

 DescriptionDurationTime (UTC)DateRegistration Opens1 month20:00Tuesday,
 March 3rdQualification Round27 hr23:00Friday, April 3rdQualification
 Round Ends | Reg Closesn/a3:00Saturday, April 4thRound 1A2 hr 30 
 min1:00Saturday,
 April 18thRound 1B2 hr 30 min16:00Saturday, May 2ndRound 1C2 hr 30 
 min9:00Sunday,
 May 17thRound 22 hr 30 min14:00Saturday, June 6thRound 32 hr 30 
 min14:00Saturday,
 June 20thOnsite Finals4 hrsTBDFriday, August 21st

 We did our best to avoid any overlap with other major programming
 competitions and holidays. If you know of any serious conflicts that will
 affect a significant number of contestants *please reply to this email
 by October 17th.*

 Thanks!
 The Google Code Jam Team

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/CAKsNUjaFAhn4dr9_4q%3D4%3DtOSCzO4nwX5hpUx0zD_UuZ5%2B4SWSA%40mail.gmail.com
 https://groups.google.com/d/msgid/google-code/CAKsNUjaFAhn4dr9_4q%3D4%3DtOSCzO4nwX5hpUx0zD_UuZ5%2B4SWSA%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-PAVjPpJhJHArc%3DTaCHQpzuC6RZTKA8%2BkDZ4rgK_md8Vg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] R1A 2014 'Full Binary Tree' , is there any pre defined algorithm to find if a graph is a full b tree

2014-08-07 Thread Luke Pebody
https://code.google.com/codejam/contest/2984486/dashboard#s=aa=1


On Thu, Aug 7, 2014 at 8:28 PM, Anubhav Sethi anubhavseth...@gmail.com
wrote:

 If no then how to approach with this probem, pls help

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/edb71de6-d96a-45fe-a97c-eb0a8343c98f%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-OGQS1NdFM0AGBBcHgd-rOJStqvF696goE7JumrAsypSA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Round 3, Problem A. Binary search really necessary for O(n) solution?

2014-06-22 Thread Luke Pebody
I guess you'd probably want res = 1 - (solveig + 0.0) / sum(ts) as the 
penultimate line.

Sent from my iPad

 On 22 Jun 2014, at 09:48, evandrix evand...@gmail.com wrote:
 
 Hi,
 
 I tried to run your solution through (using PyPy 2.3.1) A-large-practice, and 
 received the WA judgment on your output using that code.
 
 Is it meant to produce AC code through A-large-practice.in?
 
 Lee Wei
 
 On Sunday, June 22, 2014 12:09:54 AM UTC+8, Eibe wrote:
 I just read the analysis for problem A of round 3 and it is mentioned that 
 binary search is necessary for an O(n) solution.
 I don't think it is but maybe something with my thinking is wrong (I don't 
 have a strict proof of correctness of the following):
 
 Let ts be a list, where ts[i] is the numbers of transistors in device i. 
 
 Start with the following partition left, middle, right = [], ts, []
 Now repeatedly move either the leftmost element of middle into left or the 
 rightmost element of middle into right in  a way that increases
 max(sum(left), sum(right)) in the least possible way. 
 That is if sum(left) + middle[0]  sum(right) + middle[-1] move the leftmost 
 otherwise the rightmost element (middle[-1] denotes the rightmost element of 
 middle).
 
 I am a little sloppy here, but as we increase max(sum(left), sum(right)) by 
 a minimal amount it feels that we will visit an optimal partition of ts 
 eventually.
 
 In python code:
 T = int(raw_input())
 for case in range(1, T+1):
N, p, q, r, s = map(int, raw_input().split())
ts = [(i*p+q)%r+s for i in range(N)]
c0, c1, c2 = 0, sum(ts), 0
a, b = 0, N
solveig = sum(ts)
while a  b:
if c0 + ts[a] = c2 + ts[b-1]:
c0 += ts[a]
c1 -= ts[a]
a += 1
else:
c2 += ts[b-1]
c1 -= ts[b-1]
b -= 1
solveig = min(solveig, max(c0, c1, c2))
res = 1 - solveig / sum(ts)
print Case #%i: %.10f %(case, res)
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/google-code/869face2-2cb2-43c2-ab5c-b2555f010dad%40googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/7DF07896-3EF7-4BF5-9DD4-AA4FE20688F8%40pebody.org.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Round 3, Problem A. Binary search really necessary for O(n) solution?

2014-06-22 Thread Luke Pebody
Yes, this solution works. Sadly, I came up with this solution after the
contest.

The solution that I crafted during the contest was the binary-search
method, but I had a little bug in deciding whether a given value would not
work. My method worked for all of the examples in the small test, and all
of the examples but 1 in my large test. It actually works for all of the
examples in the version of the large data set that can be downloaded now.
Very frustrating.

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-ONix-1xkLKkKAd1YMZmQ036TLQ2eL%2BPSHVGAbY7CUBNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Don't Break the Nile

2014-06-02 Thread Luke Pebody
I didn't work it out during the round, but my solution involves using the
Maximum Flow - Minimum Cut theorem to say that the maximum flow is equal to
the number of vertices you need to remove for no flow to be possible.

Now any set of vertices that cut off all flow will start at the left edge,
then move through some number (possibly 0) of buildings and end up at the
right edge.

The number of squares needed to get from building 1 from (top1, left1,
bottom1, right1) to (top2, left2, bottom2, right) is
 max(top1-1-bottom2,top2-1-bottom1,left1-1-right2,left2-1-right1).

So:
 add 2 new buildings, the first representing the left edge at
(0,-1,height-1,-1) and the second representing the right edge at
(0,width,height-1,width), and find the shortest path from the left building
to the right building using the above metric. You could use Djikstra's
Algorithm

The code I wrote that solves it (using my Python code jam wrapper that can
be found at
http://jamftw.blogspot.co.uk/2012/05/python-code-jam-wrapper.html) is:

def reader(inFile):
(w,h,b) = inFile.getInts()
boxes = [((x0,y0),(x1,y1)) for i in xrange(b) for [x0,y0,x1,y1] in
[inFile.getInts()]]
return (w, h, boxes)

from fractions import gcd

def distance(((x0,y0),(x1,y1)),((x2,y2),(x3,y3))):
return max(x2-x1-1,x0-x3-1,y2-y1-1,y0-y3-1)

def solver((w, h, boxes)):
if len(boxes) == 0:
return w
n = len(boxes)
dists = [x0 for ((x0,y0),(x1,y1)) in boxes]
stilltodo = set(range(n))
for i in xrange(n):
(dist, closest) = min([(dists[i],i) for i in stilltodo])
stilltodo.remove(closest)
for k in stilltodo:
dists[k] = min(dists[k], dist + distance(boxes[k],
boxes[closest]))
return min([dists[i] + (w - 1 - boxes[i][1][0]) for i in xrange(n)])

if __name__ == __main__:
from GCJ import GCJ
GCJ(reader, solver, /Users/luke/gcj/2014/2/c/, c).run()





On Mon, Jun 2, 2014 at 3:30 PM, Matt Weaver mwea...@mailbolt.com wrote:

 I really enjoyed the problem set for round 2.  I still haven't figured out
 the solution for problem C though, Don't Break the Nile.  Can anyone give
 me the short version while we wait for the analysis? I can see how it could
 be modeled as a maximum flow problem, but it would be way too large to be
 solvable.  I assume from the large constraints it should be possible to
 process row-by-row up the river, but any method I can think of breaks down
 on maze-like rivers with dead ends, etc. where it seems like you would need
 to backtrack.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/google-code/538C8A99.4060400%40mailbolt.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-P-ed%2B-ADKAUwRGZAaD0V1tEpWt-ku6zuopUx%2Bz2AUw4g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Activity going down

2014-05-15 Thread Luke Pebody
This.

Sent from my iPad

 On 15 May 2014, at 09:47, Paul Smith p...@pollyandpaul.co.uk wrote:
 
 Good luck getting to Round 3!
 
 About the 'messier' problems.  I just wanted to say that I believe CodeJam 
 does have a very quirky style when it comes to creating problems, and I love 
 it.  I haven't ever entered TopCoder things because in comparison they seem 
 so dry and boring.  Maybe I am too harsh on TopCoder, but all I Wanted to say 
 was that Google's problem setting style is a real boon - I love it!
 
 Paul
 
 Paul Smith
 
 p...@pollyandpaul.co.uk
 
 
 On Wed, May 14, 2014 at 11:31 PM, Stanislav Zholnin 
 stanislav.zhol...@gmail.com wrote:
 All massive rounds are gone and activity in this forum goes to sleep till 
 next year...  I am still to participate in Round 2, but mainly for 
 statistics :) - It would take a lot of luck to get through to Round 3.
 
 On the positive side - I finally started doing rounds at Topcoder and 
 Codeforces, and in the middle of transition from Python to C++. So next year 
 I should be much better prepared.
 
 On a side note, I also noticed some change to the style of problems (I saw 
 already such discussions on forums). I can't figure out exactly what is 
 different - I just have word messier, but there were messy problems 
 before. I am wondering if this is actually some noticeable change in Codejam 
 Team (need to check authors from this and previous years, after all 
 editorials are up). And competition I felt was more fierce this year then 
 the last, though I think that it is the same story every year, as Codejam 
 still gains momentum.
 
 I also think that in some way 25 people on-site finals are ridiculously 
 small (even Russian Code Cup has 50 people, though it is smaller and their 
 sponsor is apparently smaller then Google). But even if it gets to 100 
 people I am still unlikely to ever participate - so I don't care.
 
 Still, at the very top of any sports chance also becomes very significant 
 factor - meaning that when you have 100 people competing at very-very high 
 level actual 25 best will depend more on luck, then on skill. So this might 
 be argument for increasing on-site finals count.
 
 Also I'd like to thank organizers. Especially for inclusiveness of all 
 languages - world outside of Codejam is much tougher on languages like 
 Python. Hope you are not going to kill as with Round 2 problems.
 
 --
 You received this message because you are subscribed to the Google Groups 
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/google-code/414598c4-e325-4736-bbb2-efb4e51d6638%40googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/google-code/CAJej63J987MqeM%2Bvjjn_AzgNPuyVPoJ-Q-LKiO7ESEeyzsA8yQ%40mail.gmail.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/42703D07-4F43-4CB9-8A49-CE334A3C474D%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Round 1B Problem A Large - 1 Wrong Try

2014-05-10 Thread Luke Pebody
Interestingly, the average minimizes the sum of the squared distance to a
list of integers.


On Sun, May 4, 2014 at 4:50 PM, Cyprien Mangin mangin.cypr...@gmail.comwrote:

 At some point in the problem you need to find an integer X that minimizes
 the sum of the distance to a list of integers.
 A lot of people chose to use the average of the list, whereas the right
 answer is the median (or any value between the medians if there are two).

 In the small testcases, N = 2, which means that any value between the two
 values of the list will do (the average for example), but in the large
 testcases, N can be larger than 2, and the problems start for this kind of
 solution.


 On Sun, May 4, 2014 at 5:48 PM, LeppyR64 jlep...@gmail.com wrote:

 I didn't participate in this round since I qualified through Round 1A.

 In analysis I noticed that a large amount of people near the bubble for
 the top 1000 who got a wrong answer for A Large.  I'm a little confused
 that I fail to see the pitfall after successfully solving the small input.

 We can't download the solutions that fail, so if there's anyone who
 submitted this problem and wanted to comment I would be interested in
 hearing what the pitfall was.

 Cheers,
 Leppy

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/88959724-c3a2-4391-ad33-3d881664c740%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/CAG7-aDKTvWYns_mM36UD4Cx%2Br%2BtZUBmhBsE1SW7aWY8EeEoQ%2Bw%40mail.gmail.comhttps://groups.google.com/d/msgid/google-code/CAG7-aDKTvWYns_mM36UD4Cx%2Br%2BtZUBmhBsE1SW7aWY8EeEoQ%2Bw%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-NjzT8a%3Dbeew2Z44OTNY6PVU%2BX0GhP5%3DFW5reLpiizw2w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] How To solve Large Data set Problems in C/C++ ?

2014-04-21 Thread Luke Pebody
I do not agree with the sentiments expressed in this email. In general, for
early rounds, there is a significantly easier brute force algorithm that
will solve small cases but not large ones. You need a significantly more
complicated algorithm to solve the large cases than the small ones. In
general.


On Mon, Apr 21, 2014 at 6:55 PM, AYAN ayanso...@gmail.com wrote:

 Solving large data set problems just requires variables(data types) with
 larger rangesex. Using double instead of float variable.
 All of these depend on the constraints provided for the variables in the
 problem...
 Except for the data types everything else is generally same.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/e6728395-8aa0-47f9-9002-9150604add4c%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAECKw-Ok8ofrVw47m48U7HBKofH1ozKoXkuXWs3cYE8Cwo9xWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Round 1 Preparation

2014-04-16 Thread Luke Pebody
I feel that there are very few google code jam questions where knowing a 
specific algorithm will help. I mean I always have implementations of Euclid's 
Algorithm, the Disjoint Sets data structure, the Push-Relabel algorithm, large 
integer arithmetic, largest bipartite matching, etc. But at the early stages, I 
find the questions tend to encourage mathematical investigation, trying small 
cases, making inductive jumps of reasoning, and such like.

Sent from my iPad

 On 16 Apr 2014, at 12:11, Shubhashis Roy iamdi...@gmail.com wrote:
 
 what are the must algorithms that i should know for the GOOGLE code-jam round 
 1 ?
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/google-code/02d7a470-140c-4fb8-a416-ea6990c3cd8f%40googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/99D56682-EEA7-46E7-9723-82182F3D4CDB%40pebody.org.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Minesweeper problem

2014-04-14 Thread Luke Pebody
If r,c are =3, and m=rc-k, then it is solvable unless k=2,3,5 or 7.

Call a square a 0-square if it has no neighbouring mines. Then a setup is 
winnable with 1 click if there is only 1 non-mine, or all non-mines are 
adjacent to 0-squares.

I worked under the assumption that if there was a solution, there was one with 
the extra condition that for every 0-square, all cells below and to the left 
are 0-squares. Let's call such a solution neat. Note: for a 1-click-winnable 
position, you can locate all of the mines given the location of the 0-squares: 
the mines are in all of those squares not adjacent to a 0-square.

Now, given a neat solution, let there be z1, z2, ..., zR 0-cells in the r rows. 
Then since the solution is neat, 0 = z1 = z2 = ... = zR = C, and the 
0-cells on the i'th row are the leftmost zi cells.

Thus if yi = 0 if zi=0 and min(zi + 1, C) otherwise, there are y2, y3, ..., yR, 
yR 0-cell neighbours in the R rows. The requirement on these numbers is that 
they are non-decreasing, don't include a 1 and the last number is repeated.

Now I just find such a sequence adding to k, where m=rc-k, put mines in the 
rightmost C-yi cells, and click in the bottom left cell.

For even k in the range [4,2C], I use the sequence 0,...,0,k/2,k/2.
For odd k in the range [9,2C+3], I use the sequence 0,...,3,k/2,k/2.
For k of the form mc+z where m=2, 0=zc and z !=1, I use the sequence 
0,...,0,z,c,...,c.
For k of the form mc+1 where m=3, I use the sequence 0,...,0,2,c-1,c,...,c.

This covers all cases except k=2,3,5,7.

Sent from my iPad

 On 14 Apr 2014, at 15:43, Angel Java Lopez ajlopez2...@gmail.com wrote:
 
 Another approach, maybe simpler
 
 Let r rows, c columns. When r == 1, or c == 1, the solvable positions are 
 already known.
 
 Let r=2, c=2
 Let m the number of mines
 
 If m  (r-2)*(c-2) it is solvable only if r*x - m is even,  4
 
 If m = (r-2)*(c-2), then it is solvable (start with a (r-2)(c-2) rectangle 
 full of mines, with one corner over one of the original corners, and then 
 start to remove mines from the external border)
 
 Any counter-example?
 
 Angel Java Lopez
 @ajlopez
 
 
 
 On Mon, Apr 14, 2014 at 11:31 AM, Leopoldo Taravilse ltaravi...@gmail.com 
 wrote:
 1 1 1 is not a possible case, as m  R*C
 
 
 On Mon, Apr 14, 2014 at 11:28 AM, Emil Maskovsky emil.maskov...@gmail.com 
 wrote:
 Looks pretty complicated :)
 
 One problem I see right at the beginning:
 for 1 1 1 your solution returns c alhough it should return Impossible.
 
 The Minesweeper problem was the trickiest for me too, had 2 failed checks 
 until I got it right (my problem was that I considered things like 1 3 2 as 
 impossible, although it should be c**).
 
 
 Dne pondělí, 14. dubna 2014 15:58:49 UTC+2 Leopoldo Taravilse napsal(a):
  I also couldn't solve this problem (I calculated by brute force the small 
  case just for making sure I advance to the next round but I couldn't 
  solve C-large because my solution wasn't accepted for C-small).
 
 
 
 
  What I did was:
 
 
  if R = 1 and C = 1 return c
  else if R = 1 or C = 1 return something like c... (or the transpose 
  if C = 1)
  else if m = R*C-1 then c in [0][0] and * everywere else
 
 
  else if m = R*C - k with k in {2,3,5,7} return impossible
  else if m%2 = (R*C)%2 fill the last R-2 rows with * until I get m times 
  '*' and then from C-1 to to 0 fill with '*' in the first two rows until I 
  get m times '*'
 
 
  else if R = 2 or  C = 2 return impossible
  else fill the last R-3 rows until m * are reached then fill the first 3 
  rows until I get m *
 
 
  This is my code in case anyone wants to read it and tell me what's wrong 
  with it:
 
 
 
 
 
  char board[5][5];
 
 
  bool calc()
  {
  int m2 = m;
  if(r==1c==1)
  {
  board[0][0] = 'c';
 
 
  return true;
  }
  if(c==1)
  {
  forn(i,r)
  board[i][0] = '.';
  board[0][0] = 'c';
  int pos = r-1;
 
 
  while(m20)
  {
  board[pos][0] = '*';
  m2--;
  pos--;
  }
  return true;
  }
 
 
  if(r==1)
  {
  forn(i,c)
  board[0][i] = '.';
  board[0][0] = 'c';
  int pos = c-1;
  while(m20)
 
 
  {
  board[0][pos] = '*';
  m2--;
  pos--;
  }
  return true;
  }
  int sz = r*c;
 
 
  if(m == sz-1)
  {
  forn(i,r)
  forn(j,c)
  board[i][j] = '*';
  board[0][0] = 'c';
  return true;
 
 
  }
  if(m == sz-2 || m == sz-3 || m == sz-5 || m == sz-7)
  return false;
  if((sz-m)%2 == 0)
  {
  forn(i,r)
  forn(j,c)
 
 
  board[i][j] = '.';
  board[0][0] = 'c';
  int posx = r-1, posy = c-1;
  while(m20)
  {
  board[posx][posy] = '*';
 
 
  m2--;
  if(posx == 1  m  0)
  {
 

  1   2   3   4   >