Re: [gcj] Are there any issues with python submission I should know about?

2018-04-06 Thread Alex
Similar issue here, with both Python 2 and 3.

Local output:

python3 testing_tool.py python2.7 A.py
Your code finishes with exit status 0.
Your code doesn't have stderr output.
Congratulations! All test cases passed :)

python3 testing_tool.py python3.6 A.py
Your code finishes with exit status 0.
Your code doesn't have stderr output.
Congratulations! All test cases passed :)

Remote output: Runtime error.

Reason: my code did not handle the WRONG_ANSWER message properly and
crashed on the next test. This code path was not covered by the local
testing tool.

HTH


On Sun, Apr 1, 2018 at 4:28 PM, Paul Smith  wrote:

> Are you running the right version of Python?
>
> On Sun, 1 Apr 2018 at 09:11, Xiongqi ZHANG  wrote:
>
>> Would you share your python solution? Maybe we can take a look.
>>
>> --
>> 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/3b224b01-3ff8-4beb-8b33-a3d14d25d628%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/ms
> gid/google-code/CAJej63K2E%2BF4x9QWwCs6zF47zK03rih1mYFAPX08Y
> O%3DK5JD3Ew%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/CAGh72vNJST6tVg_NbwiG66aZc8kZF1AV14ss-c5%2BPbfSYMd8cQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-04-06 Thread Yu Wang
I also was not able to successfully run my code. I've attached it below:



import sys

def main():
cases = int(sys.stdin.readline())
for case in range(cases):
a,b = [int(n) for n in sys.stdin.readline().split()]
response = ''
while response != 'CORRECT':
guess = (1+a+b)/2
sys.stdout.write(str(guess)+'\n')
sys.stdout.flush()
response = sys.stdin.readline().strip()
if response == 'TOO_SMALL':
a = guess
if response == 'TOO_BIG':
b = guess - 1
if response == 'WRONG_ANSWER':
break

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/a7405127-8ca7-475a-9075-580323e9f785%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-04-06 Thread Fabrice Didierjean
Le dimanche 1 avril 2018 10:10:46 UTC+2, Xiongqi ZHANG a écrit :
> Would you share your python solution? Maybe we can take a look.

Here mine, .. keep having "Runtime Error"

import sys


def guess_nb(a, b):
if a > b:
buff = a
a = b
b = buff
guessnb = int((b - a) / 2) + a
return int(guessnb)


print("Starting\n", flush=True,file=sys.stderr)
T = int(sys.stdin.readline())
while T > 0:

line = sys.stdin.readline()
A, B = line.rsplit()
A = int(A)
B = int(B)
N = int(sys.stdin.readline())
while N:
print(f"A={A} B={B} N={N}", flush=True, file=sys.stderr)
nb = guess_nb(A, B)
print(nb, flush=True)
print(nb, flush=True, file=sys.stderr)
rep = sys.stdin.readline().rstrip()
print("["+rep+"]", flush=True, file=sys.stderr)
if rep == "TOO_SMALL":
A = nb
N -= 1
elif rep == "TOO_BIG":
B = nb
N -= 1
elif rep == "CORRECT":
N=0
elif rep == "WRONG_ANSWER":
N = 0
else:
exit(2)
print("Error rep not found", flush=True, file=sys.stderr)
T -= 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/cc283c0a-cb40-4bcc-95f7-8446e0a930de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-04-06 Thread Neelam Shah
The same issue happened to me too. I am not sure why so?

On Sun, Apr 1, 2018, 3:42 AM Doron Veltzer  wrote:

> I solved all 4 programs on my machine's python (3) but they won't pass the
> online testing, is there some tab size or other syntax issue I am missing
> and should know about?
>
> Will there be a way to receive full testing between the demo and the
> qualification round?
>
> --
> 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/400b6902-5969-49ec-9ab2-e9b20a4fccaf%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/CADYapvfW-cB1nZsVh4k1TAS%3Dd%2BSumKssgUs_LnrYngHBOjwapw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-04-02 Thread Olaf Doschke
As simple as
def eprint(*args, **kwargs):
//print(*args, file=sys.stderr, **kwargs)

You'd still have all the calls. Something incorporated in CodeJam would be
more ideal, but then you would need to provide something for every
language, not just Python.
I just hope stderr doesn't ever become an important stream in the contest
problem, then this is a good enough solution in Python for me.

Bye, Olaf.

-- 
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/CAEBTyQRicL58RXhxvArpzT8p9O8umUMeKw6BuHE_Cwgw9GDpyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-04-02 Thread Felix Voituret
Or even it could be desactivated on large dataset by doing nothing when called. 

Envoyé de mon iPhone

Le 2 avr. 2018 à 13:24, Olaf Doschke  a écrit :

>> Why not introducing a « local_print() » function which print out in a 
>> separate context that user can see in the web platform. 
> 
> I would welcome that, too. The risc with that or an eprint to stderr is, that 
> running such code with the large input set could take too long, so be 
> cautious with such extensions. Ideally you only have this active in the 
> development/debug phase and don't commit it.
> 
> Bye, Olaf.
> 
> -- 
> 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/3280edd1-f4bb-4786-a109-7984a25b5d25%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/66EBB093-4681-464E-830B-CE1B89327F32%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-04-02 Thread Olaf Doschke
> Why not introducing a « local_print() » function which print out in a 
> separate context that user can see in the web platform. 

I would welcome that, too. The risc with that or an eprint to stderr is, that 
running such code with the large input set could take too long, so be cautious 
with such extensions. Ideally you only have this active in the 
development/debug phase and don't commit it.

Bye, Olaf.

-- 
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/3280edd1-f4bb-4786-a109-7984a25b5d25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-04-02 Thread Felix Voituret
Why not introducing a « local_print() » function which print out in a separate 
context that user can see in the web platform. French contest Battledev (based 
on TOSA contest) works that way and allows better debugging process.

Le 2 avr. 2018 à 08:45, Olaf Doschke  a écrit :

>> It's just that it was so frustrating running trivial code without feedback
> 
> I agree, when you normally could use print for displaying info and debug 
> messages, that's now automatically stdout feedback and the testing_tool is 
> not displaying the "dialog" between it and your code.
> 
> I added a logfile=open("numguessing.log", "w") and wherever I wanted a look 
> at input or output used logfile.write()
> 
> I found a better way to "mis"use stderr for such output using this:
> from __future__ import print_function
> import sys
> 
> def eprint(*args, **kwargs):
>print(*args, file=sys.stderr, **kwargs)
> 
> Taken from 
> https://stackoverflow.com/questions/5574702/how-to-print-to-stderr-in-python
> 
> Now you can print to stdout and eprint() to see such info and debug messages 
> while the code runs.
> 
> -- 
> 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/187b0945-e670-42c9-8c6f-db868ae2748f%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/EAEB1E6B-C02E-4F13-96BF-DD23CE3575B3%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-04-01 Thread Olaf Doschke
> It's just that it was so frustrating running trivial code without feedback

I agree, when you normally could use print for displaying info and debug 
messages, that's now automatically stdout feedback and the testing_tool is not 
displaying the "dialog" between it and your code.

I added a logfile=open("numguessing.log", "w") and wherever I wanted a look at 
input or output used logfile.write()

I found a better way to "mis"use stderr for such output using this:
from __future__ import print_function
import sys

def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)

Taken from 
https://stackoverflow.com/questions/5574702/how-to-print-to-stderr-in-python

Now you can print to stdout and eprint() to see such info and debug messages 
while the code runs.

-- 
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/187b0945-e670-42c9-8c6f-db868ae2748f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-04-01 Thread Bartholomew Furrow
Hi Doron,

It's a good idea to generate some testcases (Python is a great language for
that). In the case of that problem, I *think* there's a place in the tester
to put your own answers and have it test them. Hopefully that's an
indication that most interactive problems will have a testing program
that's easy to add cases to.

Of course, for this and presumably other interactive problems, it's reading
the response through stdin and writing the response to stdout, so you
*could* run the program and pretend to be the tester yourself!

Good luck!
Bartholomew

On Sun, Apr 1, 2018 at 3:00 PM Doron Veltzer  wrote:

>
> It's just that it was so frustrating running trivial code without
> feedback, I must've tried 20 variations of that code, tried returning on
> WRONG_ANSWER at some point for sure, didn't catch the float limits though
> :/. I guess I'll have to be ready for automatic test case generators, trial
> and error is too frustrating otherwise.
>
>10x for the replies.
>
> --
> 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/c10bdfbb-6eec-4cb6-a618-085402fe4bc5%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/CAHaiWHO5G9vNZrUV_9_RKbLa2GfaYYWpN%3D5pvXkHmzdzeQE_Vg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-04-01 Thread Doron Veltzer

It's just that it was so frustrating running trivial code without feedback, I 
must've tried 20 variations of that code, tried returning on WRONG_ANSWER at 
some point for sure, didn't catch the float limits though :/. I guess I'll have 
to be ready for automatic test case generators, trial and error is too 
frustrating otherwise.

   10x for the replies.

-- 
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/c10bdfbb-6eec-4cb6-a618-085402fe4bc5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-04-01 Thread Xiongqi ZHANG
well then a = 0, b = 1. This does the same thing
On Sun, Apr 1, 2018 at 1:18 PM Felix Voituret 
wrote:

> Well the case a = 3 is not supposed to happen as problem limit specify a =
> 0 (unless it has changed since Friday).
>
> Envoyé de mon iPhone
>
> > Le 1 avr. 2018 à 21:51, Xiongqi ZHANG  a écrit :
> >
> > Passing local test tool does not mean your solution will also pass the
> final test.
> >
> > Testing tool is simply used for checking input/output flow and format.
> The test case provided is almost certain to be trivial.
> >
> > In your case, you should stop reading from stdin when you saw
> 'WRONG_ANSWER' because the program that interact with yours will no longer
> providing any data.
> >
> > Besides, your binary search is incorrect.
> > Try case like
> > a = 3, b = 4, solution = 4
> > you can easily check that your solution will keep checking if 3 is
> correct answer, and being told that 3 is TOO_SMALL and never asking for 4
> (which is the correct answer)
> >
> > --
> > 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/d1d9acc5-aef5-4765-9634-270cc4290203%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/61F27436-E011-411D-97DD-08290A304839%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/CAGDEU-LdarffvCXD9qry0-fiLeRk1bTrYK4Z6Lm_ctDBsGbFmA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-04-01 Thread Felix Voituret
Well the case a = 3 is not supposed to happen as problem limit specify a = 0 
(unless it has changed since Friday).

Envoyé de mon iPhone

> Le 1 avr. 2018 à 21:51, Xiongqi ZHANG  a écrit :
> 
> Passing local test tool does not mean your solution will also pass the final 
> test.
> 
> Testing tool is simply used for checking input/output flow and format. The 
> test case provided is almost certain to be trivial.
> 
> In your case, you should stop reading from stdin when you saw 'WRONG_ANSWER' 
> because the program that interact with yours will no longer providing any 
> data.
> 
> Besides, your binary search is incorrect.
> Try case like
> a = 3, b = 4, solution = 4
> you can easily check that your solution will keep checking if 3 is correct 
> answer, and being told that 3 is TOO_SMALL and never asking for 4 (which is 
> the correct answer)
> 
> -- 
> 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/d1d9acc5-aef5-4765-9634-270cc4290203%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/61F27436-E011-411D-97DD-08290A304839%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-04-01 Thread Xiongqi ZHANG
Passing local test tool does not mean your solution will also pass the final 
test.

Testing tool is simply used for checking input/output flow and format. The test 
case provided is almost certain to be trivial.

In your case, you should stop reading from stdin when you saw 'WRONG_ANSWER' 
because the program that interact with yours will no longer providing any data.

Besides, your binary search is incorrect.
Try case like
a = 3, b = 4, solution = 4
you can easily check that your solution will keep checking if 3 is correct 
answer, and being told that 3 is TOO_SMALL and never asking for 4 (which is the 
correct answer)

-- 
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/d1d9acc5-aef5-4765-9634-270cc4290203%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-04-01 Thread Bartholomew Furrow
Doron,

You're handling the "wrong answer" case wrong. You code keeps running,
which might end up being a runtime error or a time-limit. Try 'return'
instead of 'break'.

Your binary search won't solve this problem. Try putting a number of small
cases in and see what happens. If that isn't easy to do, try working out
some *really* small cases by hand.

Also, try some large cases. I don't know whether int(input()) will work,
though I suspect it will.

Good luck!
Bartholomew

On Sun, Apr 1, 2018 at 11:44 AM Doron Veltzer 
wrote:

> On Sunday, April 1, 2018 at 5:29:08 PM UTC+3, Paul Smith wrote:
> > Are you running the right version of Python?
> >
> >
> > On Sun, 1 Apr 2018 at 09:11, Xiongqi ZHANG  wrote:
> > Would you share your python solution? Maybe we can take a look.
> >
> >
> >
> > --
> >
> > 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/3b224b01-3ff8-4beb-8b33-a3d14d25d628%40googlegroups.com
> .
> >
> > For more options, visit https://groups.google.com/d/optout.
>
> ran 3.6.3 before but I changed it to 3.5.3. (though I'm quite certain I
> used nothing that should be affected by the version change)
>
> This is the output of running `python testing_tool.py python A.py`
> python testing_tool.py python A.py
> Your code finishes with exit status 0.
> Your code doesn't have stderr output.
> Congratulations! All test cases passed :)
>
> Not sure which version of the code to send, but something along these lines
>
>  import sys
>
>
> t = int(input())
> for _ in range(t):
>   a, b = [int(s) for s in input().split(" ")]
>   n = int(input())
>   for _ in range(n):
> p = int((a + b) / 2)
> print(p)
> sys.stdout.flush()
> s = input()
> if s == "TOO_BIG":
>   b = p
> elif s == "TOO_SMALL":
>   a = p
> elif s == "WRONG_ANSWER":
>   break
> elif s == "CORRECT":
>   break
> else:
>   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 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/8d03a265-7b62-40b3-a070-43129e9e3834%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/CAHaiWHMtEi7jeLBzzH9%3DXGO5Wvg%2BGjvikex7tDGC1iMZfniGaw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-04-01 Thread Doron Veltzer
On Sunday, April 1, 2018 at 5:29:08 PM UTC+3, Paul Smith wrote:
> Are you running the right version of Python?
> 
> 
> On Sun, 1 Apr 2018 at 09:11, Xiongqi ZHANG  wrote:
> Would you share your python solution? Maybe we can take a look.
> 
> 
> 
> --
> 
> 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/3b224b01-3ff8-4beb-8b33-a3d14d25d628%40googlegroups.com.
> 
> For more options, visit https://groups.google.com/d/optout.

ran 3.6.3 before but I changed it to 3.5.3. (though I'm quite certain I used 
nothing that should be affected by the version change)

This is the output of running `python testing_tool.py python A.py`
python testing_tool.py python A.py 
Your code finishes with exit status 0.
Your code doesn't have stderr output.
Congratulations! All test cases passed :)

Not sure which version of the code to send, but something along these lines

 import sys


t = int(input())
for _ in range(t):
  a, b = [int(s) for s in input().split(" ")]
  n = int(input())
  for _ in range(n):
p = int((a + b) / 2)
print(p)
sys.stdout.flush()
s = input()
if s == "TOO_BIG":
  b = p
elif s == "TOO_SMALL":
  a = p
elif s == "WRONG_ANSWER":
  break
elif s == "CORRECT": 
  break
else:
  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 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/8d03a265-7b62-40b3-a070-43129e9e3834%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-04-01 Thread Paul Smith
Are you running the right version of Python?
On Sun, 1 Apr 2018 at 09:11, Xiongqi ZHANG  wrote:

> Would you share your python solution? Maybe we can take a look.
>
> --
> 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/3b224b01-3ff8-4beb-8b33-a3d14d25d628%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/CAJej63K2E%2BF4x9QWwCs6zF47zK03rih1mYFAPX08YO%3DK5JD3Ew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-04-01 Thread Xiongqi ZHANG
Would you share your python solution? Maybe we can take a look.

-- 
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/3b224b01-3ff8-4beb-8b33-a3d14d25d628%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-04-01 Thread Doron Veltzer
I also submitted one of them in c and it passed, its something to do with
python (3)

On Sun, Apr 1, 2018 at 10:07 AM, Doron Veltzer 
wrote:

> Runtime error
>
> On Sun, Apr 1, 2018 at 4:45 AM, Bartholomew Furrow 
> wrote:
>
>> Doron,
>>
>> What kind of error are you getting from the judge? If it's simply "wrong
>> answer", then chances are that there's something you have wrong about your
>> solution.
>>
>> Bartholomew
>>
>> On Sat, Mar 31, 2018 at 4:43 PM Doron Veltzer 
>> wrote:
>>
>>> I solved all 4 programs on my machine's python (3) but they won't pass
>>> the online testing, is there some tab size or other syntax issue I am
>>> missing and should know about?
>>>
>>> Will there be a way to receive full testing between the demo and the
>>> qualification round?
>>>
>>> --
>>> 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/400b6902-5969-49ec-9ab2-e9b20a4fccaf%40googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Google Code Jam" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/google-code/9fuoLfgW9i8/unsubscribe.
>> To unsubscribe from this group and all its topics, 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/CAHaiWHNpf9Gqo8uz0S-gVdWPN8ch%2Bm6Wh7KzakyZo
>> Kx4iusayA%40mail.gmail.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Sincerely,
> Veltzer Doron
>



-- 
Sincerely,
Veltzer Doron

-- 
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/CALojKZdDph-hQ8eAQHSVx1gihOQ1TECxc-nVhXznyLG7vKELiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-04-01 Thread Doron Veltzer
Runtime error

On Sun, Apr 1, 2018 at 4:45 AM, Bartholomew Furrow  wrote:

> Doron,
>
> What kind of error are you getting from the judge? If it's simply "wrong
> answer", then chances are that there's something you have wrong about your
> solution.
>
> Bartholomew
>
> On Sat, Mar 31, 2018 at 4:43 PM Doron Veltzer 
> wrote:
>
>> I solved all 4 programs on my machine's python (3) but they won't pass
>> the online testing, is there some tab size or other syntax issue I am
>> missing and should know about?
>>
>> Will there be a way to receive full testing between the demo and the
>> qualification round?
>>
>> --
>> 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/400b6902-5969-49ec-9ab2-e9b20a4fccaf%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google Code Jam" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/google-code/9fuoLfgW9i8/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAHaiWHNpf9Gqo8uz0S-gVdWPN8ch%2Bm6Wh7KzakyZoKx4iusayA%
> 40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Sincerely,
Veltzer Doron

-- 
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/CALojKZeBgtVoFPnFz0cXKsCgqmOqgZUQ2LVrDeHU0UykdOS5Ew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Are there any issues with python submission I should know about?

2018-03-31 Thread Bartholomew Furrow
Doron,

What kind of error are you getting from the judge? If it's simply "wrong
answer", then chances are that there's something you have wrong about your
solution.

Bartholomew

On Sat, Mar 31, 2018 at 4:43 PM Doron Veltzer 
wrote:

> I solved all 4 programs on my machine's python (3) but they won't pass the
> online testing, is there some tab size or other syntax issue I am missing
> and should know about?
>
> Will there be a way to receive full testing between the demo and the
> qualification round?
>
> --
> 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/400b6902-5969-49ec-9ab2-e9b20a4fccaf%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/CAHaiWHNpf9Gqo8uz0S-gVdWPN8ch%2Bm6Wh7KzakyZoKx4iusayA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.