[gcj] Why this code is wrong (practise session Q.1) - not accepted

2018-04-11 Thread Wing-chung Leung
Read the question again. You did something very different from what the 
question asked for.

You are to do the guesses instead of outputting those TOO_BIG things.

-- 
You received this message because you are subscribed to the Google Groups 
"Google 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/ad072a78-117c-4a41-976d-e2b0a0948944%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] The Qual Round is over!

2018-04-11 Thread Дмитрий Кузьминов
There could be a reasonable solution of the problem with testing Hidden after 
you have solved the Visible. What if the platform would allow the participant 
to download the whole visible dataset as soon as he has solved it? He has 
earned the points for his submission of Visible, why not to open the tests?
The separate submission of Visible/Hidden would also be a benefit, especially 
with this improvement.

On Tuesday, April 10, 2018 at 3:45:55 PM UTC-4, Bartholomew Furrow wrote:
> That's a good point about not being able to test your new solution on the 
> same input that you know you got right, Dmitriy. A few other thoughts:
> 
> 
> - I don't know whether the UI makes this clear -- note to team, hopefully 
> there's a really clear indication that you still have points from previous 
> submissions -- but you can't lose points you have earned on a visible 
> dataset, no matter what you submit later.
> 
> 
> - I agree that it isn't without penalty, but I don't think 4 penalty minutes 
> is a very significant cost. I also don't think there's anything wrong with 
> that cost being present.
> 
> 
> - When writing an analysis, it's often helpful to first consider a simpler 
> version of a problem before you consider a more complex version. I believe 
> that's what they're doing here.
> 
> 
> - Although there are a couple of things that make it less appealing -- lack 
> of ability to test on a Google-generated dataset, and the extra 4 penalty 
> minutes -- it's still totally reasonable to code up a solution that solves 
> the Visible and not the Invisible set. For example, what if you don't know 
> how to solve the invisible one? Or, as we've discussed here, what if you're 
> planning on submitting the Invisible set later if you get a chance?
> 
> 
> Cheers,
> Bartholomew
> 
> 
> On Tue, Apr 10, 2018 at 1:21 PM Дмитрий Кузьминов  
> wrote:
> Bartholomew: there is another concern. Let's imagine that I've solved the 
> Visible dataset, and I know for sure that this doesn't solve the Hidden one. 
> I submit the solution, I get the positive verdict, and I start the better 
> implementation. In the old platform I can always compare the results that the 
> old (less effective) solution produces with the results that the better 
> solution gives me, and that comes for free: I don't need to spend an attempt 
> with a penalty. Now it is not free. Moreover, I even don't know which attempt 
> will be taken to score my visible dataset (shall I submit my correct solution 
> for the second time?).
> 
> 
> 
> Today we've got a Qual Round analysis, and the analyst still assumes that old 
> rules are valid. Let's regard the "Saving The Universe Again": as usual we 
> have a clue that if we know that "Since there is at most one C instruction in 
> this test set, we can solve the two cases independently"! Who cares now of 
> the solutions that doesn't solve both datasets?
> 
> 
> 
> --
> 
> You received this message because you are subscribed to 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/3684c25d-ffce-4f4e-ae74-b82113e69d54%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/77865ab0-33a6-460a-a369-76079a3c2bbd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[gcj] Re: Why this code is wrong (practise session Q.1) - not accepted

2018-04-11 Thread Jonathan Ho
The problem statement: "We are thinking of an integer P within the range (A,B] 
— that is, A < P ≤ B. You have N tries to guess our number. After each guess 
that is not correct, we will tell you whether P is higher or lower than your 
guess." 


In this program, A (inclusive) and B (exclusive) are the endpoints of the range 
which you need to guess between. Your job is to guess the number P within N 
tries. To guess, print to standard output. The grader will then tell you 
whether you got the right answer or not.

Your code is wrong because you are finding whether n is bigger than b, smaller 
than or equals to a, or in between a and b. N is supposed to be the number of 
guesses. You are not making any guesses.


On Tuesday, April 10, 2018 at 12:32:22 PM UTC-7, piyush ohri wrote:
> #include 
> using namespace std;
> int main()
> {int t ;
>  cin>>t;
>  for(int i=0;i  {  int a,b,n,x;
>  cin>>a>>b;
>  cin>>n;
>  for(int j=0;j  {
>  cin>>x;
>  if(x>b) cout<<"TOO_BIG"<  else if(x<=a) cout<<"TOO_SMALL"<  else  cout<<"CORRECT"< 
>  }
>  }
> }

-- 
You received this message because you are subscribed to the Google Groups 
"Google 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/c9ba54b9-e01c-456a-b3f4-a1ccaa0f5f57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[gcj] Is the use of numpy matrices allowed or not?

2018-04-11 Thread Antonio Theophilo
Hello everybody

I've used Python 3 to solve the problems and is not clear if it is allowed or 
not to use basic standard libraries as numpy to solve them.

I've modelled my data for the Go Gopher! problem as a numpy matrix (just for 
indexing convenience) and got a "Runtime Error". After changing the data for a 
list of lists the code was accepted. As the problem involved a randomisation 
step, I still don't know if the use of this standard libraries as numpy and 
scipy is allowed or not.

Did anyone have this problem or know the answer for my question?

Regards
Antonio

-- 
You received this message because you are subscribed to the Google Groups 
"Google 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/4b5064fc-1a01-45b6-aa47-510b01ddbe7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[gcj] Fourth task in qualification round is not actually a programming/algorithmization problem

2018-04-11 Thread Vladyslav Lukiantsev
First three tasks include some optimizations, working with arrays, etc. 
Meanwhile, fourth task is the pure geometric problem, which takes a couple of 
lines of code which are just mirror for geometric formulas and nothing with 
optimization.
Is it normal for Google Code Jam to include such strange tasks in competition?

-- 
You received this message because you are subscribed to the Google Groups 
"Google 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/28c70039-5333-455b-8663-9dd203791b43%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[gcj] Continuation of the solutions submission after the round is over

2018-04-11 Thread Siarhei Siamashka
Hello,

One of the most entertaining features of Google Code Jam (at least for
me) used to be the possibility to still continue trying to solve the
problems and check if the solutions are correct in the training mode
even after the round is over. Of course, trying to avoid any spoilers
while doing this.

Now seems like the new solutions submission system entirely stops
working after the time has run out. That's a huge disappointment.

Is it going to remain this way during rounds 1A / 1B / 1C or some
improvements are planned?

-- 
Best regards,
Siarhei Siamashka aka 'ssvb'

-- 
You received this message because you are subscribed to the Google Groups 
"Google 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/20180409041711.53e9bb54%40i7.
For more options, visit https://groups.google.com/d/optout.


[gcj] Finding other people's solutions

2018-04-11 Thread Martín Fixman
I may be missing something obvious, but I can't find any way to download
other contestant's solutions from the scoreboard.

Was this feature removed?

-- 
You received this message because you are subscribed to the Google Groups 
"Google 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/CAJT7-KvmDPEuvgTe8S___i7F7gB1saBNXSeVor2nnkxXRcr0wg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Did you guys intentionally break the old practice problems

2018-04-11 Thread 'Ian Tullis' via Google Code Jam
Hi, David,

Thanks for reporting this -- we definitely didn't intend to remove this
functionality. I think this is the result of a bug impacting a subset of
users; I'll look into it right away. Sorry for the inconvenience.

- Ian

On Mon, Apr 9, 2018 at 4:21 PM, David Bradley  wrote:

> As recently as 3 weeks ago, we could download short and long inputs for
> the older problems (<=2017), and we could upload outputs and check the
> results.
>
> Now, it seems that all we have are the old problem statements.  The input
> files and output files checking are gone.
>
> Was this change intentional?  I was hoping to practice a bit before the 1A
> round.  However, without an easy way to judge if my program is correct, it
> seems that it is a bit of a waste.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google 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/73987f4f-e581-4b5d-ab4d-8d5a9edff85f%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/CAE0jQPOn_LS7iheCctjDUXpS9Yg89xC0T_TfNfzYbc8TeyVU%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[gcj] Did you guys intentionally break the old practice problems

2018-04-11 Thread David Bradley
As recently as 3 weeks ago, we could download short and long inputs for the 
older problems (<=2017), and we could upload outputs and check the results.

Now, it seems that all we have are the old problem statements.  The input files 
and output files checking are gone.

Was this change intentional?  I was hoping to practice a bit before the 1A 
round.  However, without an easy way to judge if my program is correct, it 
seems that it is a bit of a waste.

-- 
You received this message because you are subscribed to the Google Groups 
"Google 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/73987f4f-e581-4b5d-ab4d-8d5a9edff85f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[gcj] Saving the universe again - Why my code failed in the test set 2?

2018-04-11 Thread aagontuk
Hello, I have participated in the codejam for the first time. My solution for 
the problem passed for test set 1 but failed for test set 2. But from the 
analysis it seems correct to me. Why it failed? Here is my code - 
https://gist.github.com/aagontuk/e5f4e7f30b2481d96a418882f8a2fa7e

I don't know if this forum is appropriate for this kind of post, if it isn't I 
will remove this.

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/e11188da-d990-45ba-8128-d5b7defd827b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[gcj] Re: The Qual Round is over!

2018-04-11 Thread DEEPAK DOGRA
Is their any way to see java solutions of these 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/bd5723ec-4fc4-4813-8b55-0488213447c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] The 2018 Qual Round has started!

2018-04-11 Thread 'Pablo Heiber' via Google Code Jam
If you are programming in your own computer you can use the button to load
your source code instead of copy/pasting it.

On Sat, Apr 7, 2018 at 5:27 AM Sujit Sali  wrote:

> Hello,
>
> Can you tell me what is load file button is for?
>
>
>
>
> On Sat, Apr 7, 2018 at 4:34 AM, 'Ian Tullis' via Google Code Jam <
> google-code@googlegroups.com> wrote:
>
>> Hi Everyone,
>>
>> The Qualification Round  has
>> officially begun!
>>
>> We will temporarily be putting messages in this group on hold during the
>> qualification round and will resume as normal after 02:00 UTC on Sunday,
>> April 8, 2018.
>>
>> If you have any questions or experience any issues during the round,
>> check out our FAQ 
>> page for support. If you don’t find the answer you need there, please
>> contact us at code...@google.com.
>>
>> Good luck!
>>
>> - Ian, for 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/2e130ca1-4f21-4fde-847e-df67dd442291%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/CAEm%2Bb6-N1%3D3OOjVTaaXzRPHe6kAMnq-RNx-1ZrGagDjE%2BNgHvQ%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/CANa5jcBW%2BMoz1Z1Er7Qn63%3DeOPD-tid06c3dvQ93geS3uJ%3DiTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Keeping old rounds open for training?

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

We definitely aim to do this or something really similar in the near
future, but in-competition functionality have priority for obvious reasons.
We are planning to have a practice session in between R1A and R1B so you
can try the problems from QR and R1A, we'll publish exact dates and format
soon. You can expect it to be just a very long round with all visible test
cases so you can see your results and no scoreboard.

Best,
Pablo

On Wed, Apr 11, 2018 at 9:10 AM Bartholomew Furrow  wrote:

> Hmm, that does seem like a simple thing to do in the meantime. Of course,
> I don't know how far they are from being able to open up practice on old
> contests; if they're feeling like that's close enough, maybe they don't
> want to send out the input files just yet.
>
> On Wed, Apr 11, 2018 at 4:39 AM meir  wrote:
>
>> I would recommend publishing test files after the round.
>> For the interactive this is insufficient but if the testing code is
>> reasonably independent we could ask it be published as well after the 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/09d3e55f-2de1-4fe5-8975-9df54fe07632%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/CAHaiWHNkH23p3WFneDk%2BQ8zC%3D3qzMaa1us8BtZSZNBQnXecAgw%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/CANa5jcDG0KF75MFOS7LgyEmwxFSAVY%3DKDbe6kWkkRrK%3DaDWMMQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Show the points in in problems tab, not only after submit them

2018-04-11 Thread Bartholomew Furrow
That's a good idea. There's a whole collection of strategic information
like that -- information you might use to figure out which problems to do,
and in what order -- that's only on the scoreboard now. It's reasonable to
have all that information in one place, except that the problem
descriptions are a crucial part of that information too. I liked it all on
the same screen, but UI design is hard, and I personally find the new
design much nicer-*looking* than the old one.

On Wed, Apr 11, 2018 at 5:03 PM Marco Sousa  wrote:

> Show points in in problems tab, not only after submitting them.
>
> Like in another test, exam, etc. When you should know how many points as
> any problem.
>
> You should add 5pt/10pt to the users evaluate what to do first.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google 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/e1c77d0d-ffc9-4cb0-b89b-0a5501080159%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/CAHaiWHNvN5JFP%3D8cQURkXuxOzY7wZECmh%2BZebmLUhU35Jt%2BFeg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Would it be too much to ask for the addition of Crystal compiler support?

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

To answer your actual question: yes it is a significant amount of work to
install this compiler (or any other). Unfortunately is not as easy as just
installing the right packages on your computer. We'll add languages and
libraries for the current languages in time, prioritizing what was used
more in the past, in the same way we prioritized our initial 10 languages.

Best,
Pablo

On Wed, Apr 11, 2018 at 4:01 PM Siarhei Siamashka <
siarhei.siamas...@gmail.com> wrote:

> Hello,
>
> In Google Code Jam 2018 we are unable to run code locally and freely
> use the compilers and programming languages of our choice anymore.
> Instead we have to to pick one of the programming languages from the
> following list: Bash, C, C++, C# (mono), Go, Haskell (ghc), Java 8,
> Javascript (nodejs), Python 2, Python 3, PHP, and Ruby.
>
> I'm happy that Ruby is still supported, because this is the programming
> language which I'm using whenever I need to quickly prototype something.
>
> However the current situation is far from perfect. For example, let's
> take a look at the "Trouble Sort" problem from the Qualification round:
>
> https://codejam.withgoogle.com/2018/challenges/00cb/dashboard/79cb
>
> In the Limits section for the large input test, we can see that "Time
> limit (for the entire test set): 20 seconds". In the previous years
> we usually had up to 8 minutes (!) for this part of the test. But now
> the time limit is only 20 seconds. I used the following Ruby program
> to generate a large input data set according to the specified
> constraints:
>
>
> puts 100
> 100.times do
>   puts 10
>   puts 10.times.map { rand(10) }.join(" ")
> end
>
>
> This script generated around ~100MB of data and when I tried to
> feed it to my solution for this problem implemented in Ruby, it
> took 13 seconds to process this data on my computer. Now I have no
> idea whether the GCJ server is slower or faster than my computer,
> but 13 seconds is dangerously close to the 20 seconds limit. And
> the GCJ FAQ says:
>
>"The same limits apply to all languages. Note that although we
> attempt to make most problems solvable in the stated time limits
> using most languages, it is not guaranteed that any problem can be
> solved in any language; relaxing the limits to accommodate one
> language might enable a suboptimal solution in another, etc. Part of
> the contest is knowing which tool to use for which job, just as in
> everyday software engineering."
>
> Okay, the "knowing which tool to use for which job" part is perfectly
> reasonable. So I would like to pick https://crystal-lang.org/ as my tool
> for the job. Crystal is a statically typed language with a high
> performance LLVM based compiler, which borrows the Ruby syntax.
> In fact, my solution for the "Trouble Sort" problem can be very easily
> adapted to a common subset of Ruby and Crystal (it happens to be a
> valid Ruby and Crystal program at the same time!):
>
>
> def trouble_sort!(arr)
>   e = arr.each.with_index.select {|(x, i)| i.even?}.map {|x|
> x[0]}.to_a.sort
>   o = arr.each.with_index.select {|(x, i)| i.odd?}.map {|x|
> x[0]}.to_a.sort
>   arr.size.times {|i| arr[i] = i.even? ? e[i / 2] : o[i / 2] }
> end
>
> def validate_trouble_sort(arr)
>   1.upto(arr.size - 1) { |i| return i - 1 if arr[i - 1] > arr[i] }
>   return "OK"
> end
>
> t = gets.to_s.to_i
> 1.upto(t) do |casenum|
>   n = gets.to_s.to_i
>   arr = gets.to_s.split.map {|x| x.to_i }
>   trouble_sort!(arr)
>   puts "Case ##{casenum}: #{validate_trouble_sort(arr)}\n"
> end
>
>
> $ crystal build --release trouble-sort.cr
> $ time ./trouble-sort < large.in > large.out
>
> real0m2.108s
> user0m2.230s
> sys 0m0.050s
>
> It's already 5 or 6 times faster than Ruby code at least for this
> particular program. Needless to say that this is not the best case
> for Ruby vs. Crystal performance comparison because a lot of time is
> spent in the sort function from the standard library. If we instead
> look at a brute force code with a lot of number crunching in a tight
> loop without any library function calls, then the performance may differ
> up to a 100x factor (just like with C++ or any other natively compiled
> programming language).
>
> And of course it's a lot more convenient and fast to switch
> between Ruby and Crystal than switching between Ruby and C++.
>
> So my question is: would it be difficult to add a Crystal compiler
> to the list of supported languages? It would be very useful for the
> participants, who are currently using Ruby as their primary programming
> language in Google Code Jam.
>
> During the qualification round I still managed to somehow get a
> perfect score with 100% Ruby code for all my solutions this time.
> But I really don't want to be forced to use C++ where performance
> matters.
>
> By the way, the FAQ says that a "-pthread" option 

[gcj] Show the points in in problems tab, not only after submit them

2018-04-11 Thread Marco Sousa
Show points in in problems tab, not only after submitting them.

Like in another test, exam, etc. When you should know how many points as any 
problem.

You should add 5pt/10pt to the users evaluate what to do first.

-- 
You received this message because you are subscribed to the Google Groups 
"Google 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/e1c77d0d-ffc9-4cb0-b89b-0a5501080159%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[gcj] Would it be too much to ask for the addition of Crystal compiler support?

2018-04-11 Thread Siarhei Siamashka
Hello,

In Google Code Jam 2018 we are unable to run code locally and freely
use the compilers and programming languages of our choice anymore.
Instead we have to to pick one of the programming languages from the
following list: Bash, C, C++, C# (mono), Go, Haskell (ghc), Java 8,
Javascript (nodejs), Python 2, Python 3, PHP, and Ruby.

I'm happy that Ruby is still supported, because this is the programming
language which I'm using whenever I need to quickly prototype something.

However the current situation is far from perfect. For example, let's
take a look at the "Trouble Sort" problem from the Qualification round:

https://codejam.withgoogle.com/2018/challenges/00cb/dashboard/79cb

In the Limits section for the large input test, we can see that "Time
limit (for the entire test set): 20 seconds". In the previous years
we usually had up to 8 minutes (!) for this part of the test. But now
the time limit is only 20 seconds. I used the following Ruby program
to generate a large input data set according to the specified
constraints:


puts 100
100.times do
  puts 10
  puts 10.times.map { rand(10) }.join(" ")
end


This script generated around ~100MB of data and when I tried to
feed it to my solution for this problem implemented in Ruby, it
took 13 seconds to process this data on my computer. Now I have no
idea whether the GCJ server is slower or faster than my computer,
but 13 seconds is dangerously close to the 20 seconds limit. And
the GCJ FAQ says:

   "The same limits apply to all languages. Note that although we
attempt to make most problems solvable in the stated time limits
using most languages, it is not guaranteed that any problem can be
solved in any language; relaxing the limits to accommodate one
language might enable a suboptimal solution in another, etc. Part of
the contest is knowing which tool to use for which job, just as in
everyday software engineering."

Okay, the "knowing which tool to use for which job" part is perfectly
reasonable. So I would like to pick https://crystal-lang.org/ as my tool
for the job. Crystal is a statically typed language with a high
performance LLVM based compiler, which borrows the Ruby syntax.
In fact, my solution for the "Trouble Sort" problem can be very easily
adapted to a common subset of Ruby and Crystal (it happens to be a
valid Ruby and Crystal program at the same time!):


def trouble_sort!(arr)
  e = arr.each.with_index.select {|(x, i)| i.even?}.map {|x| x[0]}.to_a.sort
  o = arr.each.with_index.select {|(x, i)| i.odd?}.map {|x| x[0]}.to_a.sort
  arr.size.times {|i| arr[i] = i.even? ? e[i / 2] : o[i / 2] }
end

def validate_trouble_sort(arr)
  1.upto(arr.size - 1) { |i| return i - 1 if arr[i - 1] > arr[i] }
  return "OK"
end

t = gets.to_s.to_i
1.upto(t) do |casenum|
  n = gets.to_s.to_i
  arr = gets.to_s.split.map {|x| x.to_i }
  trouble_sort!(arr)
  puts "Case ##{casenum}: #{validate_trouble_sort(arr)}\n"
end


$ crystal build --release trouble-sort.cr
$ time ./trouble-sort < large.in > large.out

real0m2.108s
user0m2.230s
sys 0m0.050s

It's already 5 or 6 times faster than Ruby code at least for this
particular program. Needless to say that this is not the best case
for Ruby vs. Crystal performance comparison because a lot of time is
spent in the sort function from the standard library. If we instead
look at a brute force code with a lot of number crunching in a tight
loop without any library function calls, then the performance may differ
up to a 100x factor (just like with C++ or any other natively compiled
programming language).

And of course it's a lot more convenient and fast to switch
between Ruby and Crystal than switching between Ruby and C++.

So my question is: would it be difficult to add a Crystal compiler
to the list of supported languages? It would be very useful for the
participants, who are currently using Ruby as their primary programming
language in Google Code Jam.

During the qualification round I still managed to somehow get a
perfect score with 100% Ruby code for all my solutions this time.
But I really don't want to be forced to use C++ where performance
matters.

By the way, the FAQ says that a "-pthread" option is used for
C/C++ compilers. Does it mean that it is allowed and beneficial
to use multithreaded code or maybe even OpenMP in C/C++ solutions?

-- 
Best regards,
Siarhei Siamashka aka 'ssvb'

-- 
You received this message because you are subscribed to the Google Groups 
"Google 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/2018040903.116bd3f6%40i7.
For more options, visit 

Re: [gcj] The Qual Round is over!

2018-04-11 Thread Yu Wang
Yeah for these large datasets I find it best to write your own test cases
and see how your algorithm run against them. Even
np.random.randint(0,1e9,1e5) or something of the sort works well to see how
fast (or slow) your algorithm runs.

On Sun, Apr 8, 2018, 16:41 Felix Voituret  wrote:

> Time Limit Exceed i think ?
>
> Envoyé de mon iPhone
>
> Le 8 avr. 2018 à 22:38, Leandro Coutinho  a
> écrit :
>
> Thank you Bartholomew !
>
> What is TLE?
> *Temporal lobe epilepsy? :D*
>
> Em Dom, 8 de abr de 2018 17:27, Bartholomew Furrow 
> escreveu:
>
>> I have a few thoughts, and I want to emphasize once again that although I
>> used to be on the Code Jam team, I no longer am.
>>
>> First: I don't think Hidden sets are really run after the contest. At the
>> end of the Qualification Round, all scores were visible immediately. We
>> used to judge Large inputs as they were submitted and just not show the
>> results until the end, and I'm assuming that's true with the new platform.
>>
>> Second: "Hidden/large should be about performance" is a reasonable
>> philosophy, but it isn't a philosophy that Code Jam has held to
>> historically. You can find lots of problems where there's a simple
>> algorithm that would be correct on the Small, and incorrect (not just slow)
>> on the Large. With that said, all data sets are designed to test the
>> program as much as possible, so if your code was broken by the Invisible
>> input in a way that it *could* have been broken on the Visible input,
>> that's certainly something they'll be trying to avoid.
>>
>> Third, about whether we should know whether our submissions timed out or
>> not on Hidden sets: It's certainly true that that's a difference, though as
>> Felix points out it isn't like you could *do* anything about it before
>> unless you acted very fast. You just knew you didn't have the points, which
>> typically doesn't matter all *that* much.
>>
>> You might be interested to hear that when we first designed the
>> small/large input set system, we viewed the ability to see TLEs as a
>> down-side of the new system, when for Large inputs you weren't supposed to
>> know whether you got it. It's interesting to see it come around the other
>> way!
>>
>> I *would* like to see the running time for my Visible submissions, since
>> right now I don't have a sense for how quickly anything runs on the server,
>> other than that making a 15x15 square on the Interactive problem for 100
>> inputs takes more than 10 seconds.
>>
>> Cheers,
>> Bartholomew
>>
>> On Sun, Apr 8, 2018 at 2:08 PM Leandro Coutinho 
>> wrote:
>>
>>> Hmm good point.
>>>
>>> So CodeJam is worst now.
>>>
>>> Worst is not the best word. The previous system was really good.
>>>
>>> Em Dom, 8 de abr de 2018 17:04, Xiongqi ZHANG 
>>> escreveu:
>>>
 The hidden test is run after the contents ends. How is it possible to
 tell you that your program will finish or not if it was not actually run?
 On Sun, Apr 8, 2018 at 12:56 PM Leandro Coutinho <
 lescoutinh...@gmail.com> wrote:

> Good point.
>
> They should let us know if the program finished on time. They can do
> this without saying that it is correct or not.
>
> The other problem is about correctness. Hidden/large should be about
> performance ...
>
> Em Dom, 8 de abr de 2018 16:43, Felix Voituret <
> felix.voitu...@gmail.com> escreveu:
>
>> Well the real difference here is that you do not know if the time
>> limit was respected for the hidden dataset (previously large). So you
>> really has to ensure required points from visible one that you can 
>> control
>> unless you estimate correctly time complexity regarding dataset limits.
>>
>> Envoyé de mon iPhone
>>
>> > Le 8 avr. 2018 à 20:29, newbie007  a
>> écrit :
>> >
>> > Usually in the qualification round the first two problems are
>> simple and with no tricks.
>> >
>> > I got A and B correct for the small data sets, so I assumed it was
>> fine.
>> >
>> > But then wrong for A large and time exceed for B large. Oo
>> >
>> > Probably I was too careless, but I think CodeJam missed the
>> qualification round purpose this year.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups "Google 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/1c05cf0e-d772-4b96-879c-b61535bd9145%40googlegroups.com
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You 

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

2018-04-11 Thread bula
I just patched some simple site with multiple user search and country filter 
https://codejam.herokuapp.com/ there are lot of things that can be improved and 
added i.e. currently penalty times for tasks are not completely correct, 
penalty submissions are not displayed etc. Naturally it is offline data so for 
example if someone changes handle it wont be updated :/

On Saturday, April 7, 2018 at 3:44:57 PM UTC+2, 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?

-- 
You received this message because you are subscribed to the Google Groups 
"Google 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/4ccb3dbf-81f8-4ab3-b162-6ab298f0cf99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Keeping old rounds open for training?

2018-04-11 Thread Bartholomew Furrow
Hmm, that does seem like a simple thing to do in the meantime. Of course, I
don't know how far they are from being able to open up practice on old
contests; if they're feeling like that's close enough, maybe they don't
want to send out the input files just yet.

On Wed, Apr 11, 2018 at 4:39 AM meir  wrote:

> I would recommend publishing test files after the round.
> For the interactive this is insufficient but if the testing code is
> reasonably independent we could ask it be published as well after the 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/09d3e55f-2de1-4fe5-8975-9df54fe07632%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/CAHaiWHNkH23p3WFneDk%2BQ8zC%3D3qzMaa1us8BtZSZNBQnXecAgw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[gcj] Keeping old rounds open for training?

2018-04-11 Thread meir
I would recommend publishing test files after the round.
For the interactive this is insufficient but if the testing code is reasonably 
independent we could ask it be published as well after the 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/09d3e55f-2de1-4fe5-8975-9df54fe07632%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.