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.


[gcj] Re: Mystery Square

2018-04-20 Thread aditsu
I managed to solve it, but I don't have a different analysis / approach. I can 
try to help if you have more specific questions.

-- 
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/4d65428b-f83a-4f47-943e-cc63701421cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2018-04-20 Thread aditsu
This is great, thanks a lot. Maybe you should also send an email announcement. 
I only know about this group (or whatever this is?) because someone posted a 
link in the irc channel (#gcj on freenode) which by the way you guys apparently 
abandoned.

-- 
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/2ad57004-5c2c-4295-a1ac-ed601fde0a63%40googlegroups.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 Bartholomew Furrow
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.


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

2018-04-20 Thread 'Pablo Heiber' via Google Code Jam
Hi again,

With all the excitement of the new features, I wrote downgrading instead of
downloading. Just to be extra clear, you can now download code from other
contestants. Downgrading code from others is not encouraged.

Thanks for understanding,
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/CANa5jcAYHcoDT1iHDtYtHzeL%3DSZX2KoXJf4cDaR9SkTDK4%3D%2Bqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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

2018-04-20 Thread 'Pablo Heiber' via Google Code Jam
Hi,

Thanks everyone for your patience. Practice mode is now accessible from the
contest page of all our 2018 past rounds
. Keep in mind that
practice will be disabled some time before each new round starts and
re-enabled shortly after it has finished. Also, remember that there is a
site-wide 10 attempts maximum

over any 10 minute window that also applies to practice attempts.

Additionally, if you see the scoreboard of any of those rounds, you'll see
that the nicknames have turned red. That's because they are clickable links
that will let you access each contestants' in-contest attempts and code.

Please contact us at code...@google.com if something is not working or you
need assistance. If you have other types of feedback, like UI suggestions
or feature requests, please use the* feedback form
*
.

Best,
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/CANa5jcAeA9xX9fr9Ojc%2BVA9xMnJg9FBTYo2ZgJfkL-PuHg5U-w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] How to test practice solution to problem in past contest?

2018-04-20 Thread Bartholomew Furrow
They're actually releasing practice mode instead, I believe some time in
the next six hours. I'm sure Pablo will post when it's up, or you can
periodically check on https://codejam.withgoogle.com/2018/challenges.

On Fri, Apr 20, 2018 at 11:12 AM MGH  wrote:

> On Monday, 16 April 2018 17:31:55 UTC+1, Pablo Heiber  wrote:
> > We are also running an open week-long practice session feature the
> problems from the 2 past rounds. You can use that opportunity to practice
> until a more established practice mode becomes available.
>
> Thanks Pablo for your reply. Please could you share a link?
>
> --
> 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/182d13f2-794f-4122-965a-14f5a4a5f9a9%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/CAHaiWHM_de46Hpj-NE68Ur3S5e%2BLjTaZQS6oobyoDi02i5kBMQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Practice mode coming soon!

2018-04-20 Thread Antonio Theophilo
i++

On Thu, Apr 19, 2018 at 7:43 PM, Luke Pebody  wrote:

> [+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/ms
>>> gid/google-code/CANa5jcDA19Sf%2BKjV%3DTzobBvnbVBsXN2SwEJbdgZ
>>> cqeL_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/ms
>> gid/google-code/CAHaiWHP5-9xaODvzyaenOZ%3DV_AbDVjdAs6dBrSA7t
>> i%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%3DnbrOSu0Lyw8OheSNtYmyN0jJxk9g
> pz%2BhKp8AQ%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/CAJkHsR9nujJU2QMtWekVZdvKR4MtxFeNBGbghvkg5mykt7t9yg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] How to test practice solution to problem in past contest?

2018-04-20 Thread MGH
On Monday, 16 April 2018 17:31:55 UTC+1, Pablo Heiber  wrote:
> We are also running an open week-long practice session feature the problems 
> from the 2 past rounds. You can use that opportunity to practice until a more 
> established practice mode becomes available.

Thanks Pablo for your reply. Please could you share a link?

-- 
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/182d13f2-794f-4122-965a-14f5a4a5f9a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Why is this wrong

2018-04-20 Thread Neelam Shah
Hi,


is my code for kickstart round A correct for evendigits


T = int(input())
for i in  range(T):
s = input()
if "1" not in s and "3" not in s and "5" not in s and "7" not in s
and 9 not in "s":
print("Case #"+str(i+1)+": "+str(0))
elif len(s) == 1:
print("Case #" + str(i + 1) + ": " + str(1))
else:
neg = ""
pos = ""
a = 0

while(True):
if s[a] == '1' or s[a] == '3' or s[a] == '5' or s[a] ==
'7' or s[a] == '9':
neg = neg + str(int(s[a])-1)
pos = pos + str(int(s[a])+1)
a+=1
while(a < len(s)):
pos = pos + str(0)
neg = neg + str(8)
a+=1
break
else:
neg = neg+s[a]
pos = pos+s[a]
a+=1

neg = int(s) - int(neg)
pos = int(pos) - int(s)

m = min(neg,pos)
print("Case #" + str(i + 1) + ": " + str(m))



On Thu, Apr 12, 2018 at 5:29 PM, Yupeng Gu  wrote:

> Seems to me like you are checking from left to right whether there is a
> chance to swap in the main function?
>
> If yes, then the problem is that to get the maximum reduction of damage,
> we should reduce the energy of the shooting that has been charged most,
> therefore it should be from right to left instead.
>
> Another thing is that maybe before you swap all shooting and charging that
> could be swapped in a loop, the damage has already been reduced to a
> value<=threshold. Therefore I suggest you to check after each swap.
>
> On Thursday, April 12, 2018 at 10:19:21 AM UTC-7, Sahil Shetty wrote:
> > def change(rcodeC, i):
> >
> > holder = rcodeC[i + 1]
> > rcodeC[i + 1] = rcodeC[i]
> > rcodeC[i] = holder
> > return rcodeC
> >
> > def damage(rcodeD, dmg = 0, count = 0):
> >
> > for i in rcodeD:
> >
> > if i == 'S': dmg += 2 ** count
> > else: count += 1
> >
> > return dmg
> >
> >
> > def main(shield, rcode, hacks = 0, count = 0):
> >
> > while damage(rcode) > shield:
> >
> > for i in range(len(rcode) - 1):
> >
> > try:
> >
> > if rcode[i] == 'C' and rcode[i + 1] != 'C':
> >
> > hacks += 1
> > rcode = change(rcode, i)
> >
> > try:
> >
> > if all(e == 'C' for e in rcode[rcode.index('C'):
> -1]) == True and damage(rcode) > shield: return 'IMPOSSIBLE'
> >
> > except ValueError:
> >
> > if all(e == 'S' for e in rcode[rcode.index('S'):
> -1]) == True and damage(rcode) > shield: return 'IMPOSSIBLE'
> >
> > except IndexError: None
> >
> > return hacks
> >
> >
> > test = int(raw_input("Test data: "))
> > print '\n'
> > while test < 1 or test > 100: test = int(raw_input("Between 1 and 100:
> "))
> >
> > for i in range(test):
> >
> > shield = int(raw_input("Shield strength: "))
> > while shield < 1 or shield > (10 ** 9): shield =
> int(raw_input("Between 1 and 10^9: "))
> >
> > rcode = raw_input("Robot code: ")
> > while all(i == 'C' or i == 'S' for i in rcode) != True or len(rcode)
> > 30 or len(rcode) < 2: rcode = raw_input("Must be greater than 2 and less
> than 1; only 'C' and 'S': ")
> >
> >
> > print 'Case #' + str(i + 1) + ':', main(shield, list(rcode)),
> '\n\n\n'
>
> --
> 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/b53e0bdf-6910-406f-90e4-e1667a902a5a%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/CADYapveoUQV%3DhSs0iW2igssXcbASw47k6xXhdBz7VB8_4kzjYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[gcj] Re: Practice mode coming soon!

2018-04-20 Thread MGH
Great news, 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/9861e030-2695-4d4e-9021-364b06378d28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.