Re: [code jam] possible reasons for WA

2022-02-07 Thread Paul Smith
If you have a wrong answer, it's up to you to try to work out what's going
wrong, supplying your own test inputs.

WA usually means you passed the sample given in the question.  So, practise
finding the edge cases in your code.

1) Do you cope with the full range of inputs?  The sample input might use
small numbers that fit in an int where the real data set could go larger
2) Have you noticed an edge case that the sample input doesn't cover?
Devise your own test input that tests that case and see where things go.
3) Have you assumed that, for example, of two given inputs that A will
always be smaller than B?  Will your code cope if A is in fact larger?
4) Have you a solution that works for all positive numbers but does
something weird around 0 or negative numbers?

Which problem is ir precisely that you're getting WA for?

Paul Smith

p...@pollyandpaul.co.uk


On Mon, 31 Jan 2022 at 16:14, swetha coding <
swethacompetetivecod...@gmail.com> wrote:

> Hi,
>
>   I have started attempting the qualification round in Code Jam 2021.I am
> getting an error message WA when i submit the solution. What are the
> possible scenarios when the judge returns WA? Is it possible to get the
> test case for which failure happened?
> -swetha
>
> --
> -- You received this message because you are subscribed to the Google
> Groups Code Jam group. To post to this group, send email to
> google-code@googlegroups.com. To unsubscribe from this group, send email
> to google-code+unsubscr...@googlegroups.com. For more options, visit this
> group at https://groups.google.com/d/forum/google-code?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/22e78bff-4067-4a14-9950-3b8b403e44b5n%40googlegroups.com
> <https://groups.google.com/d/msgid/google-code/22e78bff-4067-4a14-9950-3b8b403e44b5n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

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


Re: [code jam] Samples: passed, runtime error

2021-04-06 Thread Paul Smith
If you posted your code here we could maybe help find the runtime error

Perhaps the sample used small numbers, and the first test set used larger
numbers, and you used a data type that was too small?

On Tue, 6 Apr 2021 at 21:25, 'Pablo Heiber' via Google Code Jam <
google-code@googlegroups.com> wrote:

> Hi Nic,
>
> What you are looking at probably means that your test passed the samples
> but got a runtime error when running on real data on Test Set 1.  For
> non-interactive problems, your code is ran against the samples, then the
> Test Set 1 data, then Test Set 2, data, etc. We never return two different
> errors for the same set of the data, if you have a runtime error after you
> finish outputting things, you will just get a runtime error overall. Your
> program needs to finish correctly (without runtime errors and within the
> resource limits) for us to even judge your output.
>
> Best,
> Pablo
>
> On Tue, Apr 6, 2021 at 1:16 PM Nic Moetsch  wrote:
>
>> Hello all,
>>
>> I just finished the Code Jam qualification round.
>> I didn't manage to get the Reversesort Engeneering question correct,
>> everytime I submitted, it returned *Samples: passed* however also a *runtime
>> error*.
>>
>> This combination feedback really threw me off and since the Google team
>> doesn't help with debugging, they didn't really answer my question via
>> email. It'd be great if someone could try to explain to me what this
>> combination of feedbacks means.
>>
>> My guess is that the code always failed on the last test case i.e.
>> SamplesPassed = True after all samples were read and it failed on the last
>> iteration, however since the first test set only consisted of lists size 2
>> to 7 I'd be suprised if the only edge case happened in the last test case.
>>
>> I used Python 3.7 if that makes a difference.
>>
>> Thanks a lot in advance
>> Nic
>>
>> --
>> -- You received this message because you are subscribed to the Google
>> Groups Code Jam group. To post to this group, send email to
>> google-code@googlegroups.com. To unsubscribe from this group, send email
>> to google-code+unsubscr...@googlegroups.com. For more options, visit
>> this group at https://groups.google.com/d/forum/google-code?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/dc58378f-1ad1-4919-991c-fe438ad71cedn%40googlegroups.com
>> <https://groups.google.com/d/msgid/google-code/dc58378f-1ad1-4919-991c-fe438ad71cedn%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> -- You received this message because you are subscribed to the Google
> Groups Code Jam group. To post to this group, send email to
> google-code@googlegroups.com. To unsubscribe from this group, send email
> to google-code+unsubscr...@googlegroups.com. For more options, visit this
> group at https://groups.google.com/d/forum/google-code?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CANa5jcDmYbh66bT8-5BiPfGYCMhX8Q5bJEGPX8uEERzTveY-pA%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-code/CANa5jcDmYbh66bT8-5BiPfGYCMhX8Q5bJEGPX8uEERzTveY-pA%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
-- 
Paul Smith

p...@pollyandpaul.co.uk

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


Re: [gcj] Qualification round problem - Nested depth

2020-04-08 Thread Paul Smith
What about 23?

You should get ((2(3)))

Paul Smith

p...@pollyandpaul.co.uk


On Wed, 8 Apr 2020 at 16:52, Avinash Bhardwaj 
wrote:

> Case #1: ((2))
>
>
> On Wednesday, April 8, 2020 at 10:36:20 AM UTC+2, Paul Smith wrote:
>>
>> What is your output for 2?
>>
>> It should be ((2)) but I think you’ll get ((2)) with your program?
>>
>> On Wed, 8 Apr 2020 at 05:30, Avinash Bhardwaj 
>> wrote:
>>
>>> lification Round 2020 - Code Jam 2020
>>>
>>>
>>> timeline
>>> 3
>>>
>>> question_answer
>>> Nesting Depth (5pts, 11pts)
>>>
>>> Practice Submissions
>>> Attempt 1
>>> Sample Failed: WA
>>> Apr 5 2020, 09:03
>>> remove_red_eye
>>> Competitive Submissions
>>> Attempt 2
>>> Sample Failed: WA
>>> 19:43:51
>>> remove_red_eye
>>> Attempt 1
>>> Sample Failed: WA
>>> 19:41:01
>>> remove_red_eye
>>> Last updated: Apr 8 2020, 09:36
>>>
>>> PROBLEM
>>> ANALYSIS
>>> Problem
>>> tl;dr: Given a string of digits S, insert a minimum number of opening
>>> and closing parentheses into it such that the resulting string is balanced
>>> and each digit d is inside exactly d pairs of matching parentheses.
>>>
>>> Let the nesting of two parentheses within a string be the substring that
>>> occurs strictly between them. An opening parenthesis and a closing
>>> parenthesis that is further to its right are said to match if their nesting
>>> is empty, or if every parenthesis in their nesting matches with another
>>> parenthesis in their nesting. The nesting depth of a position p is the
>>> number of pairs of matching parentheses m such that p is included in the
>>> nesting of m.
>>>
>>> For example, in the following strings, all digits match their nesting
>>> depth: 0((2)1), (((3))1(2)), 4, ((2))((2))(1). The first three
>>> strings have minimum length among those that have the same digits in the
>>> same order, but the last one does not since ((22)1) also has the digits 221
>>> and is shorter.
>>>
>>> Given a string of digits S, find another string S', comprised of
>>> parentheses and digits, such that:
>>> all parentheses in S' match some other parenthesis,
>>> removing any and all parentheses from S' results in S,
>>> each digit in S' is equal to its nesting depth, and
>>> S' is of minimum length.
>>>
>>> Input
>>> The first line of the input gives the number of test cases, T. T lines
>>> follow. Each line represents a test case and contains only the string S.
>>>
>>> Output
>>> For each test case, output one line containing Case #x: y, where x is
>>> the test case number (starting from 1) and y is the string S' defined above.
>>>
>>> Limits
>>> Time limit: 20 seconds per test set.
>>> Memory limit: 1GB.
>>> 1 ≤ T ≤ 100.
>>> 1 ≤ length of S ≤ 100.
>>>
>>> Test set 1 (Visible Verdict)
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Code Jam" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to googl...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-code/ad9651e4-1f96-437e-a18f-69c2b5a36159%40googlegroups.com
>>> .
>>>
>> --
>> Paul Smith
>>
>> pa...@pollyandpaul.co.uk
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/88cda498-fb87-4447-9be9-f28df1a2e75a%40googlegroups.com
> <https://groups.google.com/d/msgid/google-code/88cda498-fb87-4447-9be9-f28df1a2e75a%40googlegroups.com?utm_medium=email_source=footer>
> .
>

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


Re: [gcj] [Python3] how to Read input file or how to get score ??

2020-04-08 Thread Paul Smith
You have run your own test data.  This is not scored - you can see your own
test output by clicking on the test case.

You have to switch off test data and submit to count it as a real
submission against the judge.

Paul Smith

p...@pollyandpaul.co.uk


On Tue, 7 Apr 2020 at 16:54, Mohamed Lamine  wrote:

> Hello guys;
> please I can't understand how to read input file or how to test your code
> ?! exactly how to get a score ?
> I can't understand what's wrong in my code? I get "completed" but no
> score!
>
> *This is my code: *
> import numpy as np
>
> def calc_rc(x):
> for i in range(0,len(x)):
> for j in range(i+1,len(x)):
> if (x[i]==x[j]):
> return 1
> return 0
>
> with open("input.txt","w") as file:
> file.write("3\n4\n1 2 3 4\n2 1 4 3\n3 4 1 2\n4 3 2 1\n4\n2 2 2 2\n2 3
> 2 3\n2 2 2 3\n2 2 2 2\n3\n2 1 3\n1 3 2\n1 2 3\n")
>
> with open("input.txt","r+") as file:
> T = int(file.readline())
> j = 1
> while(j <= T):
> N = int(file.readline())
> z = np.zeros((N,N))
> i=0
> while(i < N):
> b = str(file.readline()).replace("\n","").split(" ")
> for k in range(len(b)):
> b[k]=int(b[k])
> z[i] = b
> i+=1
> r=0
> c=0
> k = np.trace(z)
> for l in range(N):
> if (calc_rc(z[l])):
> r+=1
> if(calc_rc(z[:,l])):
> c+=1
> print("Case #{} : {:.0f} {} {}".format(j,k,r,c))
> j+=1
>
> [image: Annotation 2020-04-07 094203.jpg]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/f97d4889-1407-4826-964f-dbcf5419cafd%40googlegroups.com
> <https://groups.google.com/d/msgid/google-code/f97d4889-1407-4826-964f-dbcf5419cafd%40googlegroups.com?utm_medium=email_source=footer>
> .
>

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


Re: [gcj] Qualification round problem - Nested depth

2020-04-08 Thread Paul Smith
What is your output for 2?

It should be ((2)) but I think you’ll get ((2)) with your program?

On Wed, 8 Apr 2020 at 05:30, Avinash Bhardwaj 
wrote:

> lification Round 2020 - Code Jam 2020
>
>
> timeline
> 3
>
> question_answer
> Nesting Depth (5pts, 11pts)
>
> Practice Submissions
> Attempt 1
> Sample Failed: WA
> Apr 5 2020, 09:03
> remove_red_eye
> Competitive Submissions
> Attempt 2
> Sample Failed: WA
> 19:43:51
> remove_red_eye
> Attempt 1
> Sample Failed: WA
> 19:41:01
> remove_red_eye
> Last updated: Apr 8 2020, 09:36
>
> PROBLEM
> ANALYSIS
> Problem
> tl;dr: Given a string of digits S, insert a minimum number of opening and
> closing parentheses into it such that the resulting string is balanced and
> each digit d is inside exactly d pairs of matching parentheses.
>
> Let the nesting of two parentheses within a string be the substring that
> occurs strictly between them. An opening parenthesis and a closing
> parenthesis that is further to its right are said to match if their nesting
> is empty, or if every parenthesis in their nesting matches with another
> parenthesis in their nesting. The nesting depth of a position p is the
> number of pairs of matching parentheses m such that p is included in the
> nesting of m.
>
> For example, in the following strings, all digits match their nesting
> depth: 0((2)1), (((3))1(2)), 4, ((2))((2))(1). The first three
> strings have minimum length among those that have the same digits in the
> same order, but the last one does not since ((22)1) also has the digits 221
> and is shorter.
>
> Given a string of digits S, find another string S', comprised of
> parentheses and digits, such that:
> all parentheses in S' match some other parenthesis,
> removing any and all parentheses from S' results in S,
> each digit in S' is equal to its nesting depth, and
> S' is of minimum length.
>
> Input
> The first line of the input gives the number of test cases, T. T lines
> follow. Each line represents a test case and contains only the string S.
>
> Output
> For each test case, output one line containing Case #x: y, where x is the
> test case number (starting from 1) and y is the string S' defined above.
>
> Limits
> Time limit: 20 seconds per test set.
> Memory limit: 1GB.
> 1 ≤ T ≤ 100.
> 1 ≤ length of S ≤ 100.
>
> Test set 1 (Visible Verdict)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/ad9651e4-1f96-437e-a18f-69c2b5a36159%40googlegroups.com
> .
>
-- 
Paul Smith

p...@pollyandpaul.co.uk

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


Re: [gcj] Confused with analysis for Indicium

2020-04-08 Thread Paul Smith
7 7 7 7 7 6 5?

On Wed, 8 Apr 2020 at 05:30, Camelcakes  wrote:

> Hey, so I was reading through the analysis for test set 2 of Indicium. I
> understand the solution for when you can get the diagonal in the form
> A..BC where each variable is not necessarily different. However, in the
> analysis, it states that every sum has a possible diagonal of this form
> ("One of the main insights needed is that all possible sums are achievable
> using a diagonal with almost all values the same"). This doesn't seem right
> to me since for N = 7 and K = 46, the only possible diagonal is 6 6 6 7 7 7
> 7 which is not of the form AAA..BC. Have I misunderstood the analysis or
> the question?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/8337d81b-f95b-4c99-93c6-ea4c1ff586bb%40googlegroups.com
> <https://groups.google.com/d/msgid/google-code/8337d81b-f95b-4c99-93c6-ea4c1ff586bb%40googlegroups.com?utm_medium=email_source=footer>
> .
>
-- 
Paul Smith

p...@pollyandpaul.co.uk

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


Re: [gcj] Runtime Error(RE) in codeJam 2020 Vestigium problem

2020-04-07 Thread Paul Smith
I think for Java solutions the class must be called Solution.
Paul Smith

p...@pollyandpaul.co.uk


On Tue, 7 Apr 2020 at 01:59, kamujula srikar 
wrote:

> Guys , I am getting an runtime error when I try to submit the java code so
> could you please me in solving this.But, When I try to execute on codechef
> java ide works fine .Please help me.
> Thanls inadvance here's the code:
>
> /* package codechef; // don't place package name! */
>
> import java.util.*;
> import java.lang.*;
> import java.io.*;
>
> /* Name of the class has to be "Main" only if the class is public. */
> class Codechef
> {
> public static void main (String[] args) throws java.lang.Exception
> {
>  int t=0;
>  Scanner s=new Scanner(System.in);
>  if(s.hasNext())
>  t=s.nextInt();
>  while(t>0 && t<=100)
>  {
>int r=0;
>int rsum=0;
>int csum=0;
>int[][] arr;
>int trace=0;
>boolean barf=true;
>if(s.hasNext())
>r=s.nextInt();
>if(r>=2 && r<=100)
>{
>  arr=new int[r][r];
>  for(int i=0;i  {
>  for(int j=0;j  {
>  arr[i][j]=s.nextInt();
>  }
>  }
>
>  for(int checker=0;checker  {
>  for(int check=0;check  {
>  if(arr[checker][check]>r && arr[checker][check]<=0)
> {
> barf=false;
> }
>  }
>  }
>  if(barf)
>  {
>  for(int k=0;k  {
> for(int m=0;m {
> if(k==m)
> {
> trace+=arr[k][m];
> }
> }
>  }
>  for(int row=0;row  {
>  outer:
>  for(int col=0;col  {
>  for(int cntr=col+1;cntr  {
>  if(arr[row][col]==arr[row][cntr])
>  {
>  rsum++;
> break outer;
>  }
>  }
>  }
>  }
>  for(int row1=0;row1  {
>  inner:
>  for(int col1=0;col1  {
>  for(int cntr1=col1+1;cntr1  {
>  if(arr[col1][row1]==arr[cntr1][row1])
>  {
> csum++;
> break inner;
>  }
>  }
>  }
>  }
>   System.out.println(trace + " " + rsum + " " +csum);
>  }
>}
>t--;
>  }
>  }
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/7b7bc0fa-ec27-4eed-8a41-3b00fd81b887%40googlegroups.com
> <https://groups.google.com/d/msgid/google-code/7b7bc0fa-ec27-4eed-8a41-3b00fd81b887%40googlegroups.com?utm_medium=email_source=footer>
> .
>

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


Re: [gcj] reg parenting partnering returns codejam 2020 code - hidden test cases fail - but all known cases pass

2020-04-07 Thread Paul Smith
Do you accept that C and end a job on one minute and start another job on
the same minute?
1
3
1 100
1 50
50 100

?
Paul Smith

p...@pollyandpaul.co.uk


On Tue, 7 Apr 2020 at 01:55, Chandrika Srinivasan 
wrote:

> Please find the parenting partnering returns code for codejam 2020. It
> fails and shows WA for hidden test cases. But all the known cases are
> passing. Would someone help me in identify what went wrong here ?
>
> Thanks in Advance!
>
> import java.lang.*;
> import java.util.*;
>
> class Activity {
> private int startMin;
> private int endMin;
>
> public Activity(int startMin, int endMin) {
> this.startMin = startMin;
> this.endMin = endMin;
>
> //System.out.println(startMin + " " + endMin);
> }
>
> public boolean isValid(Activity activity) {
>// System.out.println(endMin + " " + activity.getStartMin());
> /*if(((endMin <= activity.getStartMin()) || (startMin >=
> activity.getEndMin())) && !((startMin == activity.getStartMin()) && (endMin
> == activity.getEndMin( {
> //System.out.println(endMin + " " + activity.getStartMin());
> return true;
> } */
>
> if((endMin <= activity.getStartMin() || activity.getEndMin() <=
> startMin) && !((startMin == activity.getStartMin()) && (endMin ==
> activity.getEndMin( {
>
> return true;
> }
>
> return false;
> }
>
> public int getStartMin() {
>
> return startMin;
> }
>
> public int getEndMin() {
> return endMin;
> }
> }
>
> public class Solution {
>
> public static void main(String args[]) {
>
> Scanner in = new Scanner(System.in);
>
> int n = in.nextInt();
>
> for(int i = 0; i < n; i++) {
>
> StringBuilder actvStrb = new StringBuilder();
>
> int nActv = in.nextInt();
> ArrayList cActivities = new ArrayList();
> ArrayList jActivities = new ArrayList();
>
> for(int j = 0; j < nActv; j++) {
>
> Activity activity = new Activity(in.nextInt(),
> in.nextInt());
>
> boolean impossible = false;
>
> if((activity.getStartMin() >= 0) &&
> (activity.getStartMin() < activity.getEndMin()) && (activity.getEndMin() <=
> 24* 60)) {
>
> boolean cJob = true;
> boolean jJob = true;
> for(int c = 0; c < Math.max(cActivities.size(),
> jActivities.size()); c++) {
>
> if((c < cActivities.size()) &&
> !cActivities.get(c).isValid(activity)) {
> cJob = false;
> }
>
> if((c < jActivities.size()) &&
> !jActivities.get(c).isValid(activity)) {
> jJob = false;
> }
>
> if(!cJob && !jJob) {
> break;
> }
> }
>
> if(cJob) {
>
> actvStrb.append("C") ;
> cActivities.add(activity);
> } else if(jJob) {
> actvStrb.append("J");
> jActivities.add(activity);
>
> } else {
>   impossible = true;
> }
> } else {
> impossible = true;
> }
>
> if(impossible) {
> //System.out.println(actvStrb.toString());
> actvStrb.delete(0, actvStrb.length());
> actvStrb.append("IMPOSSIBLE");
>
> j++;
> while(j < nActv) {
> in.nextInt();
> in.nextInt();
> j++;
> }
>
> break;
> }
> }
>
> if(nActv > 0) {
> System.out.println("Case #" + (i+1) + ": " +
> actvStrb.toString());
> }
> }
> }
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this disc

Re: [gcj] Qualification round - Indicium

2020-04-07 Thread Paul Smith
I don't know how Hall's Marriage Theorem relates to the problem, but here
is an example of what the theorem means.

We have 2 groups, and we're trying to match them

Group A tells us what in group B they would be satisfied with
Group B tells us what in group A they would be satisfied with

Lets say Group A are the positions in a row, and group B are the numbers
that could go into the row.

So lets say A1 is happy with only 1, and A2 is happy only with 2.  Is there
a complete matching?  Yes, and it's obvious what it is.

Lets say A1 is happy with only 1
A2 is happy with either 1 or 2
A3 is happy with either 1 or 3.

Halls marriage theorem asks you to count elements of different sets.  First
look at order 1 sets.  Are there enough 1 to satisfy those that only want a
1.  Yes, we have 1 such case, and we have a 1 to put there.
Nobody is asking for only 2, or only 3.
Now we go to sets of order 2.  Looking at all the requirements, how many
are covered by the set {1, 2}.  A1 needs a 1, A2 needs a 1 or 2, so these
both count.  A3 needs a 1 or 3, this doesn't count (yet) because 3 isn't in
the {1,2} set we are considering.
So we have 2 set or requirements that are subsets of {1,2}, and that set
has 2 elements, so we are still happy here.
Now we try {1,2}, and find again 2 subsets, then we try {2,3} and find 0
subsets.
Finally we try {1,2,3}, all 3 requirements are subsets of this, and we have
3 elements, so this is OK.

OK, lets try 4 positions, with 4 requirements:

A1 wants {1,2}
A2 wants {2,3,4}
A3 wants {3}
A4 wants {1,4}

Requirement set - how many subsets - how many elements - happy?
{1} - 0 - 1 - Yes
{2} - 0 - 1 - Yes
{3} - 1 - 1 - Yes
{4} - 0 - 1 - Yes

{1,2} - 1 - 2 - Yes
{1,3} - 1 - 2 - Yes
{1,4} - 0 - 2 - Yes
{2,3} - 1 - 2 - Yes
{2,4} - 0 - 2 - Yes
{3,4} - 1 - 2 - Yes

{1,2,3} - 2 - 3 - Yes
{1,2,4} - 2 - 3 - Yes
{1,3,4} - 2 - 3 - Yes
{2,3,4} - 2 - 3 - Yes

{1,2,3,4} - 4 - 4 - Yes

So this is happy and a matching can be found.

An example of an unhappy matching:

A1 wants {1, 2, 3}
A2 wants {4, 5}
A3 wants {1, 2, 3}
A4 wants {1, 2}
A5 wants {1, 2, 3}

The algorithm is happy through order 1 and 2, but at order 3 it finds that
there are 4 requirement sets that are subsets of {1,2,3}, but only 3
elements to go around, so no matching can be found.

Paul Smith

p...@pollyandpaul.co.uk


On Tue, 7 Apr 2020 at 01:54, Amogh Kamath  wrote:

> I understand (partially, as you'll see) the solution provided in analysis
> section of the problem. During the contest, I understood that traces of the
> form " ... AABC for some A, B, C (not necessarily all different)" will
> bear a solution. But I wasn't sure if greedily selecting the elements will
> yield the latin square. I tried to read Hall's Marriage Theorem
> <https://en.wikipedia.org/wiki/Hall%27s_marriage_theorem>, but it went
> straight over my head.
>
> Could someone explain, in simple terms, what Hall's Marriage Theorem is
> and when and where I can use it?
> I'm not looking for proofs at the moment, I'm just trying to understand
> what the theorem states.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/68641323-c0ce-4754-911c-4c75fa9e1791%40googlegroups.com
> <https://groups.google.com/d/msgid/google-code/68641323-c0ce-4754-911c-4c75fa9e1791%40googlegroups.com?utm_medium=email_source=footer>
> .
>

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


Re: [gcj] Qualification Round 2020 Parenting Partnering Returns problem,Why my code is giving WA

2020-04-07 Thread Paul Smith
I don't think this copes if you have a task that ends on one minute and
another task which starts on the same minute.

So try
2
3
1 100
1 50
50 100
3
1 100
50 100
1 50

These are effectively the same test case, 1 task 1-100 and the other 1-50
and 50-100, but specified in different orders.
Paul Smith

p...@pollyandpaul.co.uk


On Tue, 7 Apr 2020 at 01:53, Ankit Rauthan  wrote:

> Hi friends,so I try to submit my solution to this problem(It was brute
> force and now i know how to solve it efficiently). But I want to know for
> which test cases my solution was giving WA.
> I run it on many inputs,it is giving me correct answer.As google does not
> gives you Test Set even after the competition over,i want to know why it
> fails.Was my logic wrong,What was the edge case that i was not able to
> solve.Please find my solution below any help will be greatly appreciated.
>
> import java.util.HashSet;
> import java.util.Scanner;
> import java.util.Set;
>
> public class Solution
> {
> public static void main(String[] args)
> {
> Scanner scanner = new Scanner(System.in);
> int testCases = scanner.nextInt();
> n:for(int i=0; i< testCases; i++)
> {
> int tasks = scanner.nextInt();
> String ans = "";
> String[] tasksList = new String[tasks];
> Set cMinutes = new HashSet<>();
> Set jMinutes = new HashSet<>();
> Set startingAndEndingC = new HashSet<>();
> Set startingAndEndingJ = new HashSet<>();
> for(int j=0; j< tasks; j++)
> {
> int startingTime = scanner.nextInt();
> int endingTime   = scanner.nextInt();
> String s = startingTime+"-"+endingTime;
> tasksList[j] = s;
> }
> for(int j=0; j {
> String[] task = tasksList[j].split("-");
> int startingTime = Integer.parseInt(task[0]);
> int endingTime  =   Integer.parseInt(task[1]);
> if(check(startingTime,endingTime,cMinutes,startingAndEndingC))
> {
> ans += "C";
> }
> else if(check(startingTime,endingTime,jMinutes,startingAndEndingJ))
> {
> ans += "J";
> }
> else
> {
> int test = i+1;
> System.out.println("Case #"+test+": IMPOSSIBLE");
> continue n;
> }
> }
> int test = i+1;
> System.out.println("Case #"+test+": "+ans);
> }
> }
> public static boolean check(int startingTime,int endTime,Set
> hashSet,Set startingAndEnding)
> {
> for(int i=startingTime; i<= endTime; i++)
> {
> if(hashSet.contains(i))
> {
> return false;
> }
> }
> if(startingAndEnding.contains(startingTime) &&
> startingAndEnding.contains(endTime))
> {
> return false;
> }
> startingAndEnding.add(startingTime);
> startingAndEnding.add(endTime);
> for(int i=startingTime+1; i {
> hashSet.add(i);
> }
> return true;
> //String taskTime = startingTime+"-"+endTime;
> //checkingTask.add(taskTime);
> //return true;
> }
>
> }
>
>
> Best Regards
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/fbb7780a-1b78-4429-b8a5-dec044fed232%40googlegroups.com
> <https://groups.google.com/d/msgid/google-code/fbb7780a-1b78-4429-b8a5-dec044fed232%40googlegroups.com?utm_medium=email_source=footer>
> .
>

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


Re: [gcj] Round H 2019 - Kick Start 2019

2020-03-04 Thread Paul Smith
Shouldn't the new have square brackets?

Paul Smith

p...@pollyandpaul.co.uk


On Mon, 2 Mar 2020 at 17:06, Bartholomew Furrow  wrote:

> The problem seems to relate to the long long int*. You haven't called
> delete[] on it, but that doesn't fix the problem, and I'm actually not sure
> how to. I can't even reproduce the runtime error on my machine.
>
> Here's the input that gives a runtime error, in case that's helpful to
> someone:
> 3
> 3
> 5 1 2
> 6
> 1 3 3 2 2 15
> 1
> 10
>
> Note that that's just the sample input, with an extra case. The extra case
> on its own does *not* cause a runtime error.
>
> Generally speaking, you don't want to make arrays like that in programming
> problems like Kick Start's. You want to use a vector instead. If you don't
> mind, I'd like to give some other suggestions about how you could write
> this code to be more readable and debuggable.
> - 0-index almost always (test case # is a reasonable exception)
> - Don't use "i" for the test case number, because you might want to use it
> later, or refer to it accidentally. I habitually use "qw" instead just so
> there's no chance I'll use it by accident.
> - Declare variables as they're used, rather than in a big block at the top.
> - Unless efficiency is a very important factor, use vector instead of
> int*.
>
> Here's your code, with those changes, which passes the first test set.
> It's O(N^2), though, so it needs a new algorithm to pass the second test
> set. Good luck!
>
> Bartholomew
>
>
> #include 
> #include 
> using namespace std;
>
> int main(){
> int T;
> cin>>T;
> for(int qw=1; qw<=T; qw++){
> int N;
> cin>>N;
> vector arr;
> int h = 1;
> int prev = 0;
> cout<<"Case #"< for(int j=0;j int nextReferences;
> cin >> nextReferences;
> arr.push_back(nextReferences);
> int cnt=0;
>
> for(int k=0;k<=j;k++){
> if(arr[k]>=h){
> cnt++;
> }
> }
> if(cnt==h){
> cout< h++;
> prev=cnt;
> }
> else{
> cout< }
> }
> cout< }
> }
>
>
>
>
> On Mon, Mar 2, 2020 at 9:07 AM Rajshree Gupta 
> wrote:
>
>> I am getting RE test case skipped error. It is working properly with the
>> test case mention in problem. My code is:
>> #include
>> using namespace std;
>>
>> int main(){
>> int T,i;
>> long long int N,j,k,cnt,prev,h;
>> cin>>T;
>> for(i=1;i<=T;i++){
>> cin>>N;
>> long long int *arr = new long long int(N+1);
>> h = 1;
>> cout<<"Case #"<> for(j=1;j<=N;j++){
>> cin>>arr[j];
>> cnt=0;
>>
>> for(k=1;k<=j;k++){
>> if(arr[k]>=h){
>> cnt++;
>> }
>> }
>> if(cnt==h){
>> cout<> h++;
>> prev=cnt;
>> }
>> else{
>> cout<> }
>> }
>> cout<> }
>> }
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/35d4f626-1694-48cf-b653-acead215%40googlegroups.com
>> <https://groups.google.com/d/msgid/google-code/35d4f626-1694-48cf-b653-acead215%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CAHaiWHOhsHxK2G7hVBTFaFOHeYU_OSGNB1%3D%3D-prpXXYy%3DE8WAQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-code/CAHaiWHOhsHxK2G7hVBTFaFOHeYU_OSGNB1%3D%3D-prpXXYy%3DE8WAQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

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


Re: [gcj] Qualification Round 2018 Trouble Sort

2019-03-19 Thread Paul Smith
But they are still strings, so they will compare like strings.

Try the test case "1 02 3"

Numerically this is already in order so should receive "OK", but
lexicographically it isn't, so your code outputs 0.

Your code is fine on "1 2 3"

So, like Luke already said, you need to convert the things in ls to
integers.

On Tue, 19 Mar 2019 at 14:55 Ho Wei Hong  wrote:

> it's in python
> i threw the whole string into 2 list, ls1 and ls2
> ls1 holds all even indices(0,2,4,...) of string
> ls2 holds all odd indices of string
> sorted them
> I used the "shoelace" method to compare to the indices before that
>
>
> On Tuesday, March 19, 2019 at 5:03:42 AM UTC+8, Luke Pebody wrote:
> > I don't actually know what language this is. They all look the same to
> me now. But I think the things in your sequence ls are strings and you need
> to convert them to integers.
> >
> >
> > On Mon, 18 Mar 2019, 8:00 pm Ho Wei Hong  >
> >
> >
> >
> >
> >
> > Hi all,
> >
> >
> >
> > I am having some problems with my code. I think I have the answer but
> somehow the grader mark me wrongly. I can't think of any cases that I might
> have miss out. I be glad if somebody can enlighten me. I placed the link of
> problem here for easy access
> >
> >
> >
> >
> https://codingcompetitions.withgoogle.com/codejam/round/00cb/79cb
> >
> >
> >
> >
> >
> > def main():
> >
> > for i in range(int(input())):
> >
> > n = int(input())
> >
> > ls = input().split(" ")
> >
> > c = sol(ls,n)
> >
> > print("Case #{}: {}".format(i+1, c))
> >
> >
> >
> > def sol(ls,n):
> >
> > ls1=[]
> >
> > ls2=[]
> >
> > i=0
> >
> > while i >
> > if i%2==0:
> >
> > ls1.append(ls[i])
> >
> > else:
> >
> > ls2.append(ls[i])
> >
> > i+=1
> >
> > ls1.sort()
> >
> > ls2.sort()
> >
> > #print(ls1,'\n',ls2)
> >
> > b=0
> >
> > e1,e2=0,0
> >
> > for i in range(n//2):
> >
> > if ls1[i]>ls2[i]:
> >
> > #print(ls1[i],ls2[i])
> >
> > e1 = 2*i
> >
> > b+=1
> >
> > break
> >
> > for i in range((n-1)//2):
> >
> > if ls2[i]>ls1[i+1]:
> >
> > e2 = 2*(i+1)-1
> >
> > b+=1
> >
> > break
> >
> > if b==2:
> >
> > return min(e1,e2)
> >
> > elif b==1: return max(e1,e2)
> >
> > else: return 'OK'
> >
> >
> >
> > main()
> >
> >
> >
> > --
> >
> > You received this message because you are subscribed to the Google
> Groups "Google Code Jam" group.
> >
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to google-code...@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/720d21f7-06c6-44d9-b676-eaf76231a502%40googlegroups.com
> .
> >
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/0069c127-fe2c-4734-afd9-a0453ca23674%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/CAJej63Lf6_xhRw6UGPyzHeRYXVNPTk%3DOVR0tpDEm%3DBVqHmo6JQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Explanation to a past contest problem

2019-03-06 Thread Paul Smith
For every pair of names, one of the names has to go into group A, and the
other into group B.  Your task is to decide whether this is possible.

In the sample, there are 2 test cases.
The first test case has only 1 pair.
The pair is Dead_Bowie and Fake_Thomas_Jefferson.

Can this pair be split into group A and group B?  Yes.  Put Dead_Bowine in
group A, put Fake_Thomas_Jefferson in group B, and you're done.  The answer
is Yes.

The second test case contains 3 pairs.
The first pair is Dead_Bowie and Fake_Thomas_Jefferson.  Let's decide to
put Dead_Bowie in Group A, and Fake_Thomas_Jefferson in Group B.
The second pair is Fake_Thomas_Jefferon and Fury_Leika.  We already put
Fake_Thomas_Jefferson into Group B, so we must put Fury_Leika in Group A.
The third pair is Fury_Leika and Dead_Bowie.  We already put Fury_Leika
into Group A, and Dead_Bowie also into Group A.  Therefore it is not
possible to split the 3 people into 2 groups maintaining all these splits,
so the answer is No.

On Wed, 6 Mar 2019 at 15:53 Harshad  wrote:

> On Wednesday, March 6, 2019 at 8:46:12 PM UTC+5:30, Luke Pebody wrote:
> > You are supposed to work out if you can take the collection of all of
> the names given and split them into two groups Group A and Group B so that
> each of the pairs listed has one name in Group A and one name in Group B.
> >
> >
> >
> > On Wed, 6 Mar 2019, 3:12 pm Harshad  > Hello,
> >
> > I didn't understand what this problem statement wants us to do, and I'd
> really like it if someone helps me out.
> >
> >
> >
> > Link: https://code.google.com/codejam/contest/2933486/dashboard
> >
> > Details: The input is a pair of troublesome members. What do the
> multiple pairs with the same name mean? How will I judge if two groups can
> be separated or not? Requesting help ASAP.
> >
> > Thanks.
> >
> >
> >
> > --
> >
> > You received this message because you are subscribed to the Google
> Groups "Google Code Jam" group.
> >
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to google-code...@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/7dbf9cf8-3df6-4c46-9121-1c55a92a7111%40googlegroups.com
> .
> >
> > For more options, visit https://groups.google.com/d/optout.
>
> Okay, so is it like one name should not occur in both the groups out of
> all listed pairs, and assume the left column to be group A and right column
> to be group B in the pair of names for multiple inputs. Is that what you're
> saying?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/a9f67ca0-68e9-46db-8050-2b639520a2b4%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/CAJej63L6mgXTRML9zQ_UoB1vc6xVV7UVtZGHg7jGytNx8yWWpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Regarding Problem B of Round G, Kickstart 2017

2018-07-18 Thread Paul Smith
Is overflow happening?

To use smaller numbers as an example, if A was 5, B was 95, C was 10 and D
was 90, and the largest number we could store was 100, then

min(A,B) = min(5, 95) = 5
min(C,D) = min(10, 90) = 10
min(A,B) + min(C,D) = 5 + 10 = 15.

but
min (A+C, A+D, B+C, B+D) = min (15, 95, 105, 185) which overflows.

I have no idea if the constraints of the problem allow this.

On Tue, 17 Jul 2018 at 22:57  wrote:

> I was trying to solve the Card Game problem of Round G, Kickstart 2017.
> While solving the small dataset, I used two codes, and got two different
> answers. However, the logic behind both the codes is same.
>
> Code 1:
> long long int f(map> v, int N)
> {
>   if(v.size() <= 1)
> return 0;
>   int i = 0, j;
>   long long int R_1, B_1, R_2, B_2, A, B, C, D, output = -1;
>   while(i < N)
>   {
> j = i+1;
> while(j < N)
> {
>   if((v.find(i+1) != v.end()) && (v.find(j+1) != v.end()))
>   {
> R_1 = v[i+1].at(0);
> B_1 = v[i+1].at(1);
> R_2 = v[j+1].at(0);
> B_2 = v[j+1].at(1);
> map> u_1(v.begin(), v.end());
> u_1.erase(i+1);
> A = R_1^B_2 + f(u_1,N);
> map> u_2(v.begin(), v.end());
> u_2.erase(j+1);
> B = R_1^B_2 + f(u_2,N);
>  map> u_3(v.begin(), v.end());
> u_3.erase(i+1);
> C = R_2^B_1 + f(u_3,N);
> map> u_4(v.begin(), v.end());
> u_4.erase(j+1);
> D = R_2^B_1 + f(u_4,N);
>
> long long int F = min(min(min(A,B),C),D);
> if(output == -1)
> {
>   output = F;
> }
> if(output > F)
> {
>   output = F;
> }
>   }
>   j++;
> }
> i++;
>   }
>   return output;
> }
>
> Output from Code 1:
>
> Case #1: 2774879
>
> Code 2:
>
> long long int f(map> v, int N)
> {
>   if(v.size() <= 1)
> return 0;
>   int i = 0, j;
>   long long int R_1, B_1, R_2, B_2, A, B, C, D, output = -1;
>   while(i < N)
>   {
> j = i+1;
> while(j < N)
> {
>   if((v.find(i+1) != v.end()) && (v.find(j+1) != v.end()))
>   {
> R_1 = v[i+1].at(0);
> B_1 = v[i+1].at(1);
> R_2 = v[j+1].at(0);
> B_2 = v[j+1].at(1);
> map> u_1(v.begin(), v.end());
> u_1.erase(i+1);
> A = f(u_1,N);
> map> u_2(v.begin(), v.end());
> u_2.erase(j+1);
> B = f(u_2,N);
>
> long long int F = min(R_1^B_2, R_2^B_1) + min(A,B);
> if(output == -1)
> {
>   output = F;
> }
> if(output > F)
> {
>   output = F;
> }
>   }
>   j++;
> }
> i++;
>   }
>   return output;
> }
>
> Output from Code 2:
>
> Case #1: 260399187
>
> I am quite confused at the two different outputs.
>
> After all, what's the difference between,
>
> min(a,b) + min(c,d) and min(a+c,a+d,b+c,b+d)?
>
> I am completely blank. Any help from your side will be highly appreciated.
>
> Waiting for a response.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/b78cbe8a-b6ac-4c6e-934f-af431a219f71%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/CAJej63JaSQUNZgpYVCrRiwqLyOWoNDgoV9b1MJaJe4e9BqUMOw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Sort problems on Google Code Jam based on difficulty/easiness.

2018-04-27 Thread Paul Smith
Sorry, I mean the total number of people who attempted any problem in that
problem set.  I think the scoreboard doesn't show you records of people who
logged in, looked at the problem, then logged out and went back to sleep,
but it will record people who uploaded even a single small input.  So if
you know that a competition round had 5000 active participants, and 3000
submitted a correct small input, that problem scores 60% for difficulty,
and if another round had 2 active participants, 1 of which
submitted a good input, that scores 50% for difficulty.

You might need to apply some kind of adjustment for rounds though.  A Round
3 problem that 22 out of 25 participants solved is still not going to be
easy!

On Fri, 27 Apr 2018 at 09:26 Paul Smith <p...@pollyandpaul.co.uk> wrote:

> Try dividing by the number of people who solved anything at all that year.
>
> On Thu, 26 Apr 2018 at 22:23 Anil M <anil.manch...@gmail.com> wrote:
>
>> I am solving problem on codejam over the years with no definite pattern.
>> I wondered all the problems are scattered and not easy to find the easiest
>> problem. So I crawled all the problems and got the stats for each problem
>> and put them in a database. Now I want to order them based on easiness. I
>> choose to order them based on number of people solved the small input in
>> descending order, this worked pretty well, all easy problems at top, but
>> with one issue, In the years 2008,2009 number of people who attempted the
>> problems is less, so a problem in 2008 solved by 3000 people could be
>> easier than a problem in 2017 solved by 1 people. Alternative approach
>> I thought was asking coders to order, say to put a up and down button on
>> each problem, if they press up button means they think it is easier than it
>> appears in the list of problems, down button means otherwise.  What do you
>> think is the best strategy to order all the problems based on
>> easiness/difficulty, so I can always solve easiest problem I didn't solve
>> yet? (You can find all problems at www.manchik.co.uk/list to get an idea
>> what I'm trying to do)
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/243f5d0d-b3b8-4a10-bba1-3a48bcf8e6b9%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/CAJej63L0LTYKNm%3D_BfCWRVT78G7hfVK227EaHf5FeO3AWZwT%2BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Sort problems on Google Code Jam based on difficulty/easiness.

2018-04-27 Thread Paul Smith
Try dividing by the number of people who solved anything at all that year.

On Thu, 26 Apr 2018 at 22:23 Anil M  wrote:

> I am solving problem on codejam over the years with no definite pattern.
> I wondered all the problems are scattered and not easy to find the easiest
> problem. So I crawled all the problems and got the stats for each problem
> and put them in a database. Now I want to order them based on easiness. I
> choose to order them based on number of people solved the small input in
> descending order, this worked pretty well, all easy problems at top, but
> with one issue, In the years 2008,2009 number of people who attempted the
> problems is less, so a problem in 2008 solved by 3000 people could be
> easier than a problem in 2017 solved by 1 people. Alternative approach
> I thought was asking coders to order, say to put a up and down button on
> each problem, if they press up button means they think it is easier than it
> appears in the list of problems, down button means otherwise.  What do you
> think is the best strategy to order all the problems based on
> easiness/difficulty, so I can always solve easiest problem I didn't solve
> yet? (You can find all problems at www.manchik.co.uk/list to get an idea
> what I'm trying to do)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/243f5d0d-b3b8-4a10-bba1-3a48bcf8e6b9%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/CAJej63%2BsT0qznVT8Ve20-2yA8W8X_wsRC2%3D_cTd5yEJ_pimhcQ%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 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] Question about problem D in Qualification Round 2017

2017-06-09 Thread Paul Smith
x+o is not legal under rule 1. The + and the o share a row, and neither is
an x.

(The rule is equivalent to in each row, there can only be one + or one o,
all other non-empty squares must contain an x
On Fri, 9 Jun 2017 at 23:47, Zihan Yang  wrote:

> (My previous post did not appear for unknown reasons, so I have to re-post
> it here)
> Hi, I'm trying to solve this year's Code Jam problems, and problem D in
> Qualification Round has confused me a little.
>
> The original problem description says
> 1. Whenever any two models share a row or column, at least one of the two
> must be a +.
> 2. Whenever any two models share a diagonal of the grid, at least one of
> the two must be an x.
>
> The content analysis equals it to the following rules
> 1. The + models are bishops. Two bishops may not occupy the same diagonal.
> 2. The x models are rooks. Two rooks may not occupy the same row or column.
> 3. The o pieces are queens. Two queens may not occupy the same row,
> column, or diagonal. Moreover, a queen and a bishop may not occupy the same
> diagonal; a queen and a rook may not occupy the same row or column.
>
> However, I don't quite understand the rule 3 in content analysis, it says
> "a queen and a rook may not occupy the same row or column.", but the
> original rule 1 in problem description does not have such constraint.
>
> Consider the layout below
> ...
> x+o
> ...
> It would illegal if rule 3 is applied, but legal in the original rule 1..
>
> I guess I missed something? Any clue would be appreciated.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/6508e0c3-e016-43f7-b3c7-ed1cf932dd51%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/CAJej63%2BHSc3Q2My3%3DrH6M5WfcvhXEMo7M%2BQdjQVNmJ%2B2hqXnpA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Parenting Partnering: Analysis

2017-05-02 Thread Paul Smith
In sample case 3, J must have the baby for 0 to 1, and C must have the baby
from 1439 to 1440.  I think you've misread the input perhaps?

On Tue, 2 May 2017 at 09:16 Paul Smith <p...@pollyandpaul.co.uk> wrote:

> You do this pattern every day, so if C has the baby from 0 to 719, and
> hands over to J for 720-1439, J has to hand back to C to start the next
> day.  If you think about it, the number of exchanges must always be even,
> otherwise the next day starts with a different parent.
>
> On Tue, 2 May 2017 at 00:00 newbie007 <lescoutinh...@gmail.com> wrote:
>
>> is 0 midnight?
>> is 1440 midnight?
>>
>> why if C (0-720) and J(720-1440) is not only ONE exchange?
>>
>>  I didn't understand sample case 3:
>> 2 2
>> 0 1
>> 1439 1440
>> 1438 1439
>> 1 2
>>
>> time taking care of the baby:
>> James..: 0-1,  720-1438, 1439-1440
>> Cameron: 1-720, 1438-1439
>>
>> I counted 4 exchanges! :/
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/29642b75-2d92-4739-93bf-3ebfad7197f3%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/CAJej63Kxk0ZCy2%3D1NeMxg5K7nRKRx1dkZCdcK9%2BaO%3D44Y%2BMrJA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Parenting Partnering: Analysis

2017-05-02 Thread Paul Smith
You do this pattern every day, so if C has the baby from 0 to 719, and
hands over to J for 720-1439, J has to hand back to C to start the next
day.  If you think about it, the number of exchanges must always be even,
otherwise the next day starts with a different parent.

On Tue, 2 May 2017 at 00:00 newbie007  wrote:

> is 0 midnight?
> is 1440 midnight?
>
> why if C (0-720) and J(720-1440) is not only ONE exchange?
>
>  I didn't understand sample case 3:
> 2 2
> 0 1
> 1439 1440
> 1438 1439
> 1 2
>
> time taking care of the baby:
> James..: 0-1,  720-1438, 1439-1440
> Cameron: 1-720, 1438-1439
>
> I counted 4 exchanges! :/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/29642b75-2d92-4739-93bf-3ebfad7197f3%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/CAJej63LJ%3D7%2BVxMGiv%3DadeZhmK0gLnxGGMbXE%3DAe2Sa0SqnTQ1A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: What stumped people in Stable Neigh-bors

2017-04-26 Thread Paul Smith
I cleverly realised that RGR was equivalent to any R in the corresponding
small case, but stupidly replaced an R with an RGR, counting that as 3 Rs
and 1 G (I'd double counted the R I was replacing and an R I was replacing
it with.)

No matter, I was right up against the time limit at this point, so getting
it correct would have put me around 1100th instead of 1650th.  Still not
quite good enough.  Bring it on 1C!

On Wed, 26 Apr 2017 at 15:44 John Christofolakos <
johnchristofola...@gmail.com> wrote:

> YVYVY is another large input edge case. It's valid only if you have some
> other unicorns to put after the final Y.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/6fcb6f8e-bcb7-4d18-8f85-70e3de6f6503%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/CAJej63%2Bezj1xAwo4OgGwgSE9KmdPS6iz7qq8kw9BiyjJ8F1e9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Problem D Fashion Show

2017-04-12 Thread Paul Smith
No. Whenever two symbols are in the same row, one of them must be a +. The
column has nothing to do with it.

The middle row has 3 such pairs -
the x and the + are in the same row (this is ok because one of them is a +)
The + and the o are in the same row (this is ok because one of them is a +)
The x and o are in the same row (this is not ok, neither of these is a +)

An equivalent statement is that in any row at most one symbol is allowed to
not be a +
On Wed, 12 Apr 2017 at 23:29, Leandro Coutinho 
wrote:

> Ok. But I think the sentence is wrong (or at least very misleading).
>
> Maybe it should be:
>
> The middle row has a pair of models (x and o) that does not include a + *in
> their columns*.
>
> On Wed, Apr 12, 2017 at 7:04 PM, Luke Pebody  wrote:
>
> Yes, but of any two models on a row or column, one must be a +. Since
> there are two on that row that are not a +, that condition is not satisfied
>
> On 12 Apr 2017 10:58 p.m., "newbie007"  wrote:
>
> https://code.google.com/codejam/contest/3264486/dashboard#s=p3
> [quote]
> ...
> x+o
> .+.
>
> The middle row has a pair of models (x and o) that does not include a +.
> [/quote]
>
> I didn't understand this part.
> The middle row HAS a +
>
> :(
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/f23951a1-9968-49a6-b3fe-b2400a61a863%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CAECKw-O1DFOzK1vOc8LspypehADd4HcLjaDoK2nBta4fhhowgQ%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CAN6UTawOxbApK3meBWqhVWuiuNoCbX_6tHRO9sXbPzxfDNcDTg%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/CAJej63%2B4KaQy_SH7OTRM9i4h8DcckCmFiQauq81fa_cBwLpBGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Qualification Round Question - Bathroom Stalls

2017-04-12 Thread Paul Smith
Very well communicated.  The problem is I think your step 4.

Iteration-1: oo
==
S1 : (L=0,R=3,min(LR)=0,max(LR)=3)
S2 : (L=1,R=2,min(LR)=1,max(LR)=2)
S3 : (L=2,R=1,min(LR)=1,max(LR)=2)
S4 : (L=3,R=0,min(LR)=0,max(LR)=3)

According to the deterministic selection rules:

1. max(min(LR)) = 1;
2. Stall-Set(max(min(LR)) = (S2, S3);
3. I have more than one so I continue;

*** HERE ***

At this point, S2 and S3 are equally good, so the remainder of the
algorithm is choosing between S2 and S3 only.  S1 and S4 are 'thrown away'

4. max(max(LR)) = 2;
5. Stall-Set(max(max(LR)) = (S1, S4);  < No, S1 and S4 were disregarded
at step 3, this is still S2, S3
6. I have more than one so I choose the leftmost;

The leftmost selection of S2 and S3 is S2.

On Wed, 12 Apr 2017 at 16:32 Adebowale Odunlami  wrote:

> I have some problems with the question C of the qualification round of the
> contest.
> I did not find the deterministic selection rules to be consistent with the
> example
> given especially case 1. I felt that I either did not understand the
> question very
> well or there was something wrong. I wrote the code according to my
> understanding
> but I could not attempt the question because of the inconsistency.
>
> Please kindly assist me to review my implementation which is expressed in
> the steps below
> and point out where mistake(s) could be.
> I have used Java with streams.
>
> Case 1.
>
> N = 4; K = 2
>
> Iteration-1: oo
> ==
> S1 : (L=0,R=3,min(LR)=0,max(LR)=3)
> S2 : (L=1,R=2,min(LR)=1,max(LR)=2)
> S3 : (L=2,R=1,min(LR)=1,max(LR)=2)
> S4 : (L=3,R=0,min(LR)=0,max(LR)=3)
>
> According to the deterministic selection rules:
>
> 1. max(min(LR)) = 1;
> 2. Stall-Set(max(min(LR)) = (S2, S3);
> 3. I have more than one so I continue;
> 4. max(max(LR)) = 2;
> 5. Stall-Set(max(max(LR)) = (S1, S4);
> 6. I have more than one so I choose the leftmost;
> 7. Selection is S1;
>
>
> Iteration-2: oo...o
> ==
> S2 : (L=0,R=2,min(LR)=0,max(LR)=2)
> S3 : (L=1,R=1,min(LR)=1,max(LR)=1)
> S4 : (L=2,R=0,min(LR)=0,max(LR)=2)
>
> According to the deterministic selection rules:
>
> 1. max(min(LR)) = 1;
> 2. Stall-Set(max(min(LR)) = (S3);
> 3. I have only one so I choose it;
> 4. Selection is S3;
>
>
> Finally I have: oo.o.o
> and max(LR)=1 : min(LR)=1.
> So, my answer is Case #1: 1 1
>
>
> But the answer in the example is : Case #1: 1 0
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/0b34f5ed-e95b-4166-8fd2-41a5304293ca%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/CAJej63K0KJ%3D0V4NCANbAfsmLXnbgC3UqA3ooEJ0%2BibDRpj4NJw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Problem C Bathroom Stalls - Verification of output

2017-04-12 Thread Paul Smith
500 255.
First step, the 500 turns into a 250 and a 249 (k=1)
Second step, the 250 turns into a 125 and 124, and the 249 turns into 2
more 124s (k=3)
Third step, the 125 turns into 2 62s, the 3 124s turn into 3 62s and 3 61s
(k=7)
Fourth step, the 5 62s turn into 5 31s and 5 30s, the 3 61s turn into 6 30s
(k=15)
Fifth step, the 5 31s turn into 10 15s, the 11 30s turn into 11 15s and 11
14s (k=31)
Sixth step, the 21 15s turn into 42 7s, the 11 14s turn into 11 7s and 11
6s (k=63)
Seventh step, the 53 7s turn into 106 3s and the 11 6s turn into 11 3s and
11 2s (k=127)
Eight step, the 117 3s turn into 234 1s and the 11 2s turn into 11 1s (and
11 0s) (k=255)
Ninth step, the remaining 245 1s are filled.

So, no, it it not the case that with half the stalls filled all remaining
gaps are 1 across, in this case the 255th person is placed into a 2 stall
wide gap.  (I believe this means 500 254 should also yield 1 0, only 500
256 would yield 0 0)

On Wed, 12 Apr 2017 at 16:32 Filip Bačić  wrote:

> I am trying to figure out why my solution wasn't right.
> I couldn't even solve Small Input 1 and now I took someones solution from
> the scoreboard who solved it and when I compared my output with that one
> (on C-small-1-attempt0.in) I found out that on 100 cases my output is
> different on 5 of them:
>
> Case #  N K   My solution  Correct solution
> 10500   2550 0  1 0
> 16999   5080 0  1 0
> 34500   2540 0  1 0
> 68999   5110 0  1 0
> 91  1000   5110 0  1 0
>
> Problem is that I still do not understand these results :)
> And for example for case 500 254 then we both get 0 0 as solution.
> My reasoning was that whenever K > N/2 then answer is 0 0 because after
> half of stalls are taken then there can only be left empty stall between
> two which are taken.
> Could you please explain me how my reasoning is wrong? It bothers me
> really. :)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/ba3dec8d-5d83-4f1f-9b76-5e9e6822cb10%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/CAJej63%2B5qz4GLOWDKFF3E1USYaPwgN-FxO6AcBrGUUytN9ouBA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Analysis is up for Qualification Round. Take a look!

2017-04-12 Thread Paul Smith
"Whenever two models share a row or column, at least one of the two must be
a +."
Therefore, it is not possible to have two x's share a row, nor share a
column, that would violate this rule (neither of them are + if both are x).
It is also not possible for two o's to share a row or column, as this would
violate the same rule (neither of them are + if both are o).
It is still not possible for an o and an x to share a row or column,
because neither of these are +

If two xs cannot share a row or column, and cannot share a row or column
with an o, I think you can see why these feel like rooks.

On Wed, 12 Apr 2017 at 16:32 Alexander Lukyanov  wrote:

I must be missing something, but I don't understand how in the problem D
the rules are restated from

Whenever any two models share a row or column, at least one of the two
must be a +.
Whenever any two models share a diagonal of the grid, at least one of
the two must be an x.

to:

The + models are bishops. Two bishops may not occupy the same diagonal.
The x models are rooks. Two rooks may not occupy the same row or column.
The o pieces are queens. Two queens may not occupy the same row,
column, or diagonal. Moreover, a queen and a bishop may not occupy the same
diagonal; a queen and a rook may not occupy the same row or column.

--
You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-code/2e67a7fb-95f9-4d85-9bd5-c48b5bebb758%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/CAJej63%2BSubk9Z3PKr_kmxyzL6RGW%3DjcB8DituR8neFrdbBJtbA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] for new participant

2017-04-07 Thread Paul Smith
Your final exam is 27 hours long?

On Fri, 7 Apr 2017 at 13:43 Abasifreke James  wrote:

> Hahaha.. Me too! :D
>
> But I'll make some time. #priorities!
>
> On Fri, Apr 7, 2017 at 4:53 AM, MAHMUD NADIM 
> wrote:
>
> I am new in this competition.And my final exam schedule is tomorrow at the
> same time of this program.How can I change my schedule?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/0d27d40c-bb6e-4fc4-b4b0-19af71d2ef5a%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/CACzfDXG%3D5%2B1knB%3Dgp0BVO9bRRoDEb%3DkPufOL-8_-94hp07FZAA%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/CAJej63JeiKaER6dc1hy17QF1Kp0uGStfF-GpZMXXS4zRUZ4qgA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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

2017-04-05 Thread Paul Smith
I think it's very unlikely that 2 competitors will finish uploading correct
solutions to the same problems on the same second, and that the order of
those competitors is somehow relevant to any qualification or awarding of
prize.

On Wed, 5 Apr 2017 at 15:43 Sanjay Arvind 
wrote:

> How does GCJ handle ties?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/2b6bc952-20df-4865-94bb-e0b4954c7b82%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [gcj] Re: Can we resubmit solutions?

2017-03-22 Thread Paul Smith
Assuming nothing has changed in recent years, the penalty only affects your
tiebreak score.  If you solved all inputs, you'd usually have a score of
100.  But who won?  The person who hit 100 points first.

IIRC the penalty for a wrong small submission is 4 minutes, meaning if you
solved everything in 93 minutes, but you made a mistake and had 1 wrong
small submission, you'd be counted as solving everything in 97 minutes -
meaning someone submitting everything correctly at 94, 95, or 96 minutes
would beat you, but someone submitting at 98 would lose.

On Wed, 22 Mar 2017 at 14:37 Sanjay Arvind 
wrote:

> On Monday, 20 March 2017 19:49:02 UTC+5:30, Sanjay Arvind  wrote:
> > Can we resubmit solutions in code jam? Is there any penalty for it/
>
> Thank .
> Can u tell me more about the penalty?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/8e26377d-69b9-41d1-b950-5a735cfcf7d9%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/CAJej63KQYRarceTH-bkJxPhpd%3DojO5Pn0Wt24iuYZyCXXC4OtA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Confused about sample case in Problem D: Fractiles

2016-04-13 Thread Paul Smith
1 4 7 isn't a wrong solution of K=3 C=2 S=3.  Why do you say it's wrong?

On Wed, 13 Apr 2016 at 16:34 Kapil Garg <kapilgarg1...@gmail.com> wrote:

>
> On Apr 13, 2016 7:56 PM, "Paul Smith" <p...@pollyandpaul.co.uk> wrote:
> >
> > Yes, but you could solve it when S=2 with 2, 6, and you could not solve
> it with 3, 7.
> >
> > Are you asking if you could solve it with 2, 6, 7 when S=3?  Then yes,
> of course, adding tile 7 does nothing to change the fact that 2, 6 was
> already a perfectly good solution.
>
> The case can be solved with tiles 1, 4 and 7. Then why its a wrong
> solution ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CABAYvYqi4pG%2BeWnkBgTXNEpJGP2KxUQ3Qvqfbhj6h2fts9Y7Fw%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-code/CABAYvYqi4pG%2BeWnkBgTXNEpJGP2KxUQ3Qvqfbhj6h2fts9Y7Fw%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: [gcj] Re: Confused about sample case in Problem D: Fractiles

2016-04-13 Thread Paul Smith
Yes, but you could solve it when S=2 with 2, 6, and you could not solve it
with 3, 7.

Are you asking if you could solve it with 2, 6, 7 when S=3?  Then yes, of
course, adding tile 7 does nothing to change the fact that 2, 6 was already
a perfectly good solution.

On Wed, 13 Apr 2016 at 14:17 Mohit Soni  wrote:

> On Tuesday, April 12, 2016 at 7:27:38 PM UTC+5:30, Xiongqi ZHANG wrote:
> > > I read it but I think I am missing something to get right...
> > > I just want to know that in Problem D: Fractiles (
> https://code.google.com/codejam/contest/6254486/dashboard#s=p3) at In
> sample case #5, how valid solution are tiles #2 and #6.I mean it could be
> #3 #7 also if we go for maximum occurrence...
> > > It would be a great help if some can make it clear...
> > > Thanks..
> >
> > Checking #2 can verify pos#1 and pos#2
> > Checking #6 can verify pos#2 and pos#3
> >
> > So it is a valid solution
> >
> > Checking #3 can verify pos#1 and pos#3
> > Checking #7 can verify pos#3 and pos#1
> >
> > so pos#2 is not checked, so it is not valid solution.
>
> Is it compulsory ti check pos#2...as S = 3, we can clean 3 tile at a time
> right ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/5cddee18-d2cc-4846-871d-c87f9fe3e5aa%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/CAJej63KyJjBgE_isn2-X3ABC8rpBoH2qr0kRW5EuexeqZATAaA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Reg writing the code

2016-04-08 Thread Paul Smith
A lot of people won't read fro a file and write to a file, they will read
from stdin, write to stdout, and run their program like this:

program < a.in > a.out

taking advantage of stream redirection.

On Fri, 8 Apr 2016 at 19:04 'Pablo Heiber' via Google Code Jam <
google-code@googlegroups.com> wrote:

> Hi,
>
> Every problem has an input file with some test cases and you need to
> produce an output file for it. You can decide the best way to do that: one
> program, several programs, using R, editing the contents manually, or a
> combination.
>
> See this: https://code.google.com/codejam/faq.html#5-3
>
> Having a single program that reads the input and produces the output is a
> popular choice in many languages (including Java), like mentioned in our
> tutorial: https://code.google.com/codejam/tutorials.html. However, you
> can choose to do it in the way you think it is best for you for each
> problem.
>
> Best,
> Pablo, on behalf of the Google Code Jam team
>
> On Fri, Apr 8, 2016 at 10:59 AM, Anusha Swaminathan 
> wrote:
>
>> Is it necessary to read and write into a file for all the programs?
>> Because when I download solutions of previous competitions, I find this
>> being done for many problems. Pls clarify if it is necessary. I will prefer
>> coding in Java.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/d0319957-740f-4e29-9c16-f9328c316807%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/CANa5jcDy1XcGsGEpAYFc1ves7e061rXOQC8Vbz0vViUWrujahg%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/CAJej63Lt74MbG1X_Y4JKBBN5Z_Vmnnw9WELU5iMxMcUu%2B9qU8A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Qualification Round

2016-04-04 Thread Paul Smith
The rank isn't normally used in the qualification round, just the raw
score.  Often it has been along the lines of "completely solve one
question" to advance to the next round, but do read the requirements
carefully when the round begins to check that's really the case.

On Mon, 4 Apr 2016 at 04:47 'Pablo Heiber' via Google Code Jam <
google-code@googlegroups.com> wrote:

> Hi,
>
> It varies each year. When the contest start, you will be able to see the
> minimum score required to advance in your dashboard, right next to the
> title.
>
> Best,
> Pablo
>
> On Sun, Apr 3, 2016 at 8:17 PM, Mahady Pial  wrote:
>
>> What should be my minimum rank in the Qualification Round of Code Jam
>> 2016 to go to the next round ?
>> Thanks in Advance :)
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/0c02f8f8-b7a6-4050-a202-11276f662bd8%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/CANa5jcC_O4d9wYq3Lwrjq_Xd%2B2tpwz5UZwnqUF43gv88Fgm7Lw%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/CAJej63L2rcw82fVHJtFTqHNGvSXgR%2BNLrVqu2-18LoAQGhcRwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] How dose Google check the source code?

2016-03-15 Thread Paul Smith
You run the code on your own machine.

You upload the code to show you used a publicly available language and
didn't cheat.

On Tue, 15 Mar 2016 at 20:46 Mohd Sabra  wrote:

> I am wondering how dose google check the source code. If i used standard
> libraries, different version compliers, ect... Do i need to mention it
> somewhere what I am using or what?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/56bd9e71-4f5d-44e8-8722-19ae3723fe10%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/CAJej63%2Bc%2B3ACkcmXGABYCPJAD8hHc7WPCPUuRfEoPtr92KzLYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: STORE CREDIT PROBLEM

2016-01-19 Thread Paul Smith
Or at the very least your input and output files.  Source code is best
though.

On Tue, 19 Jan 2016 at 02:19 Xiongqi ZHANG  wrote:

> > my solution seems about right but i don´t understand why they say it is
> incorrect. maybe i´m uploading the file the wrong way?
> >
> > To solve the problem i used C and created a file as the answer and then
> uploaded that file.
>
> There must be something wrong with your code and I can't help if you don't
> provide me your source code.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/f8a71b7c-141c-4336-af5e-d92a68be297b%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/CAJej63%2B%2BYHm4BO7kBaP2y4OUgWWM_9BSeLQZjE4h_di%2BY9mBOw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Time Limit Exceed Error

2015-10-22 Thread Paul Smith
>From the moment you download the input, you have 4 minutes to upload the
output (for small cases) or 8 minutes to upload the output (for large
cases).  If your program has a longer running time than that, you will
timeout.

On Thu, 22 Oct 2015 at 09:07 Ramesh Singh 
wrote:

> Hello Hacker,
>  I have a doubt regarding the APAC Test. Since we have to first download
> the input file and generate the output file from our program on our local
> machine and then upload the output file, is there any time limit exceed
> error kind of thing defined for this test. In normal competitive exams, the
> program we write is uploaded to the server and then if it exceeds the time
> limit specified, the program fails. I wanted to know if there anything like
> that in APAC Test (I have this doubt because the program we write
> completely runs on our machine). If there is nothing like this, then the
> programs that have O(f(n)) would also like to succeed. Then how the online
> judge decide whether the program is efficient or not? Thank You
>
> Ramesh Singh
> IIT Hyderabad
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/03921e1b-092a-419b-b780-81e3033a76e9%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/CAJej63%2B5LTF4rbOahPy7BaLBSPOYcvr08nNW75LfPvx0A9%3DruQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] what i have to do in the google code jam ?

2015-09-01 Thread Paul Smith
You can make a console or windowed program, that's up to you. Usually a
console program would be better because there's nothing in the program you
would need a window for.

What you must do is read an input file, calculate an output, and write that
output out.

On Tue, 1 Sep 2015 at 06:15 Dario Calzoli  wrote:

> What your question
> Em 31/08/2015 12:08 PM, "mouheb boucherb" 
> escreveu:
>
>> hi dear friend i recently licten about the google code jam
>> and i realy want to participate but when i saw th problem i can't
>> understand what i have to do . are we asked to make a console programme or
>> a window programm i use c# and vb.net for programming
>> please help me
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/99edff6c-b2e4-4dc7-9c91-9c533c772523%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/CAFqXiEwCWF%3DFoSEtsL9g%3D_BsndAROjihD7kn5zm2%3Dxn-Wd9W%3DQ%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/CAJej63JWfRzVSRKtmXAC5M3bmSy7m1fUJXOYhzF74m%3DpUL%3D4qQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] How to submit code during practice

2015-06-15 Thread Paul Smith
When you run this code, what is the contents of A-small.out?

On Sun, 14 Jun 2015 at 20:07 Wolfgang Faust wolfgang...@gmail.com wrote:

 During practice, you don't submit your code at all. In a real contest
 there will be a separate button to upload the code.
 On Jun 14, 2015 3:03 PM, Acino monica.mca.du.2...@gmail.com wrote:

 Hi,
 I have just started with google code jam.
 I wrote some code to solve this:
 https://code.google.com/codejam/contest/351101/dashboard#s=p0

 When I am making submission for small, I get:
 Submission for input A-small Rejected: Your output should start with
 'Case #1: '.
 You can learn more about rejections like this in our FAQ.

 Below is my code:

 #includebits/stdc++.h
 using namespace std;

 int main(){
 FILE *fin = freopen(A-small-practice.in, r, stdin);
 assert( fin!=NULL );
 FILE *fout = freopen(A-small.out, w, stdout);
 int c,n,t;
 cint;
 for(int i=0; it; i++)
 {
 cincn;
 int arr[n];
 for(int j=0; jn; j++)
 {
 cinarr[j];
 }
 int temp, found=0;
 for(int a=0; an; a++)
 {
 temp=c-arr[a];
 for(int b=0; bn; b++)
 {

 if(a==b)
 continue;
 else{
 if(arr[b]==temp)
 {
 found=1;
 coutCase #i+1: a+1 b+1endl;
 break;
 }

 }
 }
 if(found)
 break;
 }
 }

 }

 Any help?
 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/1c2fe890-0617-4ace-acf7-67f934e088f3%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/CAJvjBNZ%3DxHx9ZJveH0Pgq7UttDJ78oG24vVz2QwvR0NcCAfU%3DQ%40mail.gmail.com
 https://groups.google.com/d/msgid/google-code/CAJvjBNZ%3DxHx9ZJveH0Pgq7UttDJ78oG24vVz2QwvR0NcCAfU%3DQ%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


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


Re: [gcj] Round 1A Problem C Logging: The size of eps

2015-04-19 Thread Paul Smith
Is the answer to Logging to find the number of triangles made by triples of
other trees that each tree is strictly inside?  Sounds very inefficient.
Would love to hear some insight on this whilst I wait for the official
analysis :)

Paul Smith

p...@pollyandpaul.co.uk

On Sun, Apr 19, 2015 at 11:17 AM, john.smith john.sm...@arrows.demon.co.uk
wrote:

 I was largely defeated by this problem. I hacked an awful convex-hull
 algorithm, and brute-forced a solution to the small test case. I was
 interested to look at some of the solutions by the best.

 Many of the successful solutions calculate angles between trees using
 floating point arithmetic expressions based on atan(dx,dy), and compare the
 angles with expressions like
  while ( ...  a[r] - a[i]  M_PI - eps)

 How should eps be set to be large enough to account for all rounding
 errors, and small enough to distinguish distinct angles?

 Suppose we have two angles A and B with tan(A) = ax/ay  and tab(B) = bx/by.
 Then when A and B are close, A-B is close to tan(A-B) = (ax/ay-bx/by) /
 (1+ax.bx/ay.by).
 Simplify to give tan(A-B) = (ax.by-bx.ay)/(ax.bx+ay.by)

 In the current question -2N  ax,bx,ay,by  2N where N=100 so by
 careful choice of ax,ay,bx,by we find the smallest non-zero value of
 tan(A-B) is about 1/(8.N^2).  So if you set eps to 1e-13, then you should
 be OK.

 Burunduk1 (rank 1) chose eps = 1e-15, so is safe.

 Other values used by those ranked in the top 10 include 1e-12, 1e-10
 (twice), and 1e-8. All appear to be defeated by a test case of the form
 4
 0 0
 99 100
 -98 -99
 -100 100

 A little luck is useful. I've certainly had it in the past. But in case
 the GCJ team start using even more test-cases exploring dark corners, be
 very careful how you set your eps.


 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/b9f4d273-cef3-4119-8267-a6625265288a%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/CAJej63Ju7pyf2s0RraBBy2H_2JdJG%2BFLmfyV2TUC4p4sTndS_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: A strange claim in the analysis of Problem D (qualification round)

2015-04-17 Thread Paul Smith
No Ben, It's this space:

#X#
XXX

Paul Smith

p...@pollyandpaul.co.uk

On Wed, Apr 15, 2015 at 11:44 AM, Benjamin Chang benjamin12...@gmail.com
wrote:

 On Wednesday, April 15, 2015 at 2:41:51 AM UTC-7, bigOnion wrote:
  The analysis says that whenever you are left with a connected blank
 space (not necessarily rectangular) whose size is divisible by X - then you
 can fill it up with X-ominoes:
 
   If a connected blank area of size M is a multiple of X, it can be
 guaranteed that there is a way to place M/X X-ominoes to fill in the blank
 area. 
 
  It also repeats later.
 
  It seems that what is actually used in the proof is the claim in the
 other direction: if you can force a blank space to be of size not divisible
 by X then you win (no way to fill the blank space).
 
  The claim as stated doesn't seem quite right actually. Consider the case
 of a connected blank space of size 4 whose shape is of one blank space with
 three other blank spaces around it (adjacent to it). Then obviously there
 is no way to fill this space with 2 2-ominoes.
  The claim in the analysis is not quite right. Maybe it can be right with
 more restrictions and in a specific content, but not the way it is
 currently claimed.

 The shape you described is just a 2x2 square if I am understanding
 correctly. This can be filled with 2 2-ominoes.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/4cec7fea-ee48-4bd3-9682-54e84688661f%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/CAJej63LayG-jVrh8ynQqPWvbm4RShEOSNNsdUY_QhKEPDmWf5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Please explain how this competition goes

2015-03-11 Thread Paul Smith
No, you get to read the problem statement, code the solution in any freely
available language that you can run on your computer, and when you're
ready, download the input data, run your program to get the output, and
upload that.

Paul Smith

p...@pollyandpaul.co.uk

On Tue, Mar 10, 2015 at 7:46 PM, Riad Saab rss...@gmail.com wrote:

 This is my first time in any competition on the internet. I have a basic
 understanding of code, I learned most of Java Script in 2 days. Is there
 any specific language that this competition is based on?

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/d4c53596-fcd8-41a2-adcc-0fd51cc39e7d%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/CAJej63L3VmmR92JVxiS3X0tL_Cpx0-8RVdpGsauWOK%3DdPZnPhw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Minesweeper - is the sample output correct?

2014-12-03 Thread Paul Smith
(4,4) isn't a 0, it's a 1, because of the mine in (3,5)

Paul Smith

p...@pollyandpaul.co.uk

On Wed, Dec 3, 2014 at 3:29 PM, Alex F alexf3...@gmail.com wrote:

 I am trying to understand the minesweeper task:
 https://code.google.com/codejam/contest/5214486/dashboard

 For this case:

   12345

 1 ..*..
 2 ..*..
 3 .*..*
 4 .*...
 5 .*...

 it prints minimal number of clicks 8. Probably I don't understand the
 task, but I see 6 clicks. I follow the notation (y, x) (row, column).

 1. (4, 4)

  12245

 1 ..*..
 2 ..*..
 3 .*42*
 4 .*301
 5 .*200

 2. (1, 5)

  12245

 1 ..*20
 2 ..*31
 3 .*42*
 4 .*301
 5 .*200

 3. (1, 1)

  12245

 1 02*20
 2 13*31
 3 .*42*
 4 .*301
 5 .*200

 4,5,6, 3 clicks on remaining 3 cells, each one reveals one cell.

 So, 6 clicks and not 8. Am I right or I am missing something?




 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/a58f6669-5520-4e33-b16b-3618ed0a1932%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/CAJej63JwckiaXVikg86inGMsor8c4y7W6DKuT7FBwJq25GdvBw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] unable to understand the sample

2014-10-13 Thread Paul Smith
Which sample?

Paul Smith

p...@pollyandpaul.co.uk

On Mon, Oct 13, 2014 at 9:29 AM, prashantkmr06 prashantkm...@gmail.com
wrote:

 hello everyone, i m new to code jam and i have go through the practice
 test where i m unable to understand the sample, i got puzzled in input
 output segment.
 can anyone help me!!!

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/65da99e8-2587-4cd0-b70b-ddc703c97fb9%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/CAJej63JLG51xnZoKXScPMrUYWnTdYDHvNY6o%2BRt3Je9ZO8doqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Activity going down

2014-05-15 Thread Paul Smith
Good luck getting to Round 3!

About the 'messier' problems.  I just wanted to say that I believe CodeJam
does have a very quirky style when it comes to creating problems, and I
love it.  I haven't ever entered TopCoder things because in comparison they
seem so dry and boring.  Maybe I am too harsh on TopCoder, but all I Wanted
to say was that Google's problem setting style is a real boon - I love it!

Paul

Paul Smith

p...@pollyandpaul.co.uk


On Wed, May 14, 2014 at 11:31 PM, Stanislav Zholnin 
stanislav.zhol...@gmail.com wrote:

 All massive rounds are gone and activity in this forum goes to sleep till
 next year...  I am still to participate in Round 2, but mainly for
 statistics :) - It would take a lot of luck to get through to Round 3.

 On the positive side - I finally started doing rounds at Topcoder and
 Codeforces, and in the middle of transition from Python to C++. So next
 year I should be much better prepared.

 On a side note, I also noticed some change to the style of problems (I saw
 already such discussions on forums). I can't figure out exactly what is
 different - I just have word messier, but there were messy problems
 before. I am wondering if this is actually some noticeable change in
 Codejam Team (need to check authors from this and previous years, after all
 editorials are up). And competition I felt was more fierce this year then
 the last, though I think that it is the same story every year, as Codejam
 still gains momentum.

 I also think that in some way 25 people on-site finals are ridiculously
 small (even Russian Code Cup has 50 people, though it is smaller and their
 sponsor is apparently smaller then Google). But even if it gets to 100
 people I am still unlikely to ever participate - so I don't care.

 Still, at the very top of any sports chance also becomes very significant
 factor - meaning that when you have 100 people competing at very-very high
 level actual 25 best will depend more on luck, then on skill. So this might
 be argument for increasing on-site finals count.

 Also I'd like to thank organizers. Especially for inclusiveness of all
 languages - world outside of Codejam is much tougher on languages like
 Python. Hope you are not going to kill as with Round 2 problems.

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


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


Re: [gcj] problem c

2014-05-11 Thread Paul Smith
Agree.

2 8 12 looks like this:

XX..
XX..

How do you think you could make this 9?

Paul Smith

p...@pollyandpaul.co.uk


On Sun, May 11, 2014 at 2:10 PM, vivek dhiman vivek4dhi...@gmail.comwrote:

 if N=2 or M=2 then answer will be K. Because there cannot be any
 enclosed point.



 On Sun, May 11, 2014 at 2:36 PM, SHUBHAM GARG gargshubham...@gmail.comwrote:

 for 2 8 12
 ans accepted is 12 but it should be 9

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




 --
 Regards
 Vivek Dhiman

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

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


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


[gcj] Round 1C 2014 Problem B, Reordering Train Cars

2014-05-11 Thread Paul Smith
Hello, I just want to scream because this morning I competed in round 1C,
and after about 2hrs I submitted a beautiful solution for this problem,
with the correct algorithm but with one small bug missing one case that
makes a set of trains impossible to arrange.

(The 'edge' case is simply 2 ab ba.  It's possible to make both the as
continuous, or the bs continuous, but not both at the same time.  My code
gave this solution a 1 instead of a 0.  :( )

Without that bug I would have made 35 points before the 2 hr mark, good for
about 650th place (and my holy grail of round 2)

Sadly, I instead score 0 points and I'm out for this year.  I think you can
tell how much I enjoy this competition from my frustration at such a stupid
mistake!  I of course totally blame the Eurovision Song Contest being
broadcast the night before...

Congratulations to everyone who made it through, commiseration to those who
didn't, and hope to compete with you all again next year!

Thank you for reading my vent!

Paul Smith

p...@pollyandpaul.co.uk

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


Re: [gcj] Qualification Round Contest Analysis

2014-04-29 Thread Paul Smith
The educational aspect of the competition is incredibly important of
course!  However, I think there's a big distinction here.  Google are
running a competition which has intrinsic educational value.  That does not
make it their responsibility to extract that educational value for you.  As
long as some contest analysis is posted at some point then I'm happy.  If
the analysis of all rounds was posted after completion of the whole
competition that would be fine in my book.  What they do is already a
million times better than this, and there's really no expectation for them
to perform better on this front.  The people who want the analysis posted
immediately at the close of the round are just being unrealistic.

CodeJam is the only programming competition I get involved with.  I do it
because I love the innovative problems, I'm very happy competing only once
a year, and I love the model whereby I run the solutions on my own machine
and only upload the output.  I am never going to qualify for the on-site
finals, and I'm really unlikely to ever win a T-shirt.  Unless they
introduce a t-shirt for qualifying for 10 consecutive years or something -
that'd be sweet!

I feel that I learn something every year I compete, yet as more and more
people compete I find myself slipping further and further down the
standings.  I think that's great!  Having so many people competing is
really good!

So, to sum up, I love everything about CodeJam, so I'm kind of offended on
their behalf when your words insult the competition.

Keep up the good work Bartholomew (et al), it's amazing and I'll be back
every year you run it :)

Paul Smith

p...@pollyandpaul.co.uk


On Tue, Apr 29, 2014 at 3:21 PM, Vexorian vexor...@gmail.com wrote:

 On Saturday, April 26, 2014 2:05:36 PM UTC-4, Aaron Chan wrote:
  It's top 1000 T-shirts. Regardless, it's just about the same as the
 TopCoder open, which also only the top 24 people gets on site invites.

 Yeah, and it is also a big waste of time from a competitive aspect.

 Tournaments used to have far more on site finalists. GCJ had *500* onsite
 semifinalists.  The thing is that the incredibly low 24-25, is a great way
 to ensure that the finalists are basically the same homogeneous group
 always.

 Unless you are one of the top 50 or so. The only way you can really
 justify participation in these things is if  you are actually learning
 something. Do notice that the context was a message that said that posting
 analysis doesn't matter in GCJ because it is a competition and not a
 course. I took offense to that because the educational aspect of these
 things has always been far more important  to me than the competitive part.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/a289282a-1b9e-48c9-9117-a9e9fbd19eda%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/CAJej63%2BTLCaP6chj4acHrC8yBR%2B3NMZjNwLcKRRFmPgveCzHAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Minesweeper - can we get the correct output now?

2014-04-18 Thread Paul Smith
http://www.go-hero.net/jam/14/solutions/0/3/Javascript shows 14
contenstants used Javascript for that problem.

Paul Smith

p...@pollyandpaul.co.uk


On Fri, Apr 18, 2014 at 7:08 PM, Vincent Le Quang vincent.lequ...@gmail.com
 wrote:

 Now that the qualif rounds are over, does anyone have the correct output
 for minesweeper with small-input?
 I just kept getting my output rejected, but I couldn't figure out why. It
 was driving me nutz. I eventually gave up but I just want to know if my
 output is correct.

 Either the output, or did someone submit the solution in one of the
 following languages: JavaScript, ActionScript or PHP. I'm just looking for
 a way to compile it easily without having to install a new IDE. I used
 JavaScript.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/61a1fea6-677b-44d4-b656-6f5e54269360%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/CAJej63KPSU%3DMOWALWQYXrpz7kDcD02kFtW_USrTbMP4gkQ%3DLiQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Minesweeper Master judge

2014-04-14 Thread Paul Smith
The extreme openness here is really unexpected and appreciated!

Paul Smith

p...@pollyandpaul.co.uk


On Mon, Apr 14, 2014 at 11:11 PM, Bartholomew Furrow fur...@gmail.comwrote:

 Hi All,

 I'm sending this email because there was a minor irregularity in the
 Qualification Round, and it's important to us that we're open about such
 things. *Unless you personally received a separate email from me about
 this subject, this doesn't affect you directly.*

 For most Code Jam problems, there's essentially one correct output per
 input. On Minesweeper Master there were many, so we wrote what we call a
 custom judge. Unfortunately there was a bug in the judge's code that
 caused it to accept solutions that it shouldn't have.

 After careful consideration, we decided to fix the judge during the
 contest. At the end of the contest, it turned out that if we were to
 rejudge all the submitted solutions using the corrected judge, only one
 contestant would have changed from advancing to not advancing.

 As a consequence, we've decided to leave the scoreboard alone. We wanted
 to avoid a case where contestants were told they'd earned points, but
 actually hadn't; and this bug had the minimum impact with only that one
 extra contestant being advanced. If you're interested in whether your
 solution *would* have been impacted, you can go to the contest 
 dashboardhttps://code.google.com/codejam/contest/2974486/dashboard,
 grab your last submission from the Submissions section, and submit your
 solution in practice mode to find out.

 Best,
 Bartholomew, 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/CAHaiWHNjm-4Rcx%3DFoRykspkgiNV%3DbtsPDvDxadDL%3Diz0ZAA7DA%40mail.gmail.comhttps://groups.google.com/d/msgid/google-code/CAHaiWHNjm-4Rcx%3DFoRykspkgiNV%3DbtsPDvDxadDL%3Diz0ZAA7DA%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


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


Re: [gcj] Re: Clarification regarding the round

2014-04-13 Thread Paul Smith
Note that it works exactly the same way in rounds 1A, 1B, and 1C, and in
those rounds it does matter exactly where you come in the scoreboard.

Paul Smith

p...@pollyandpaul.co.uk


On Sat, Apr 12, 2014 at 7:08 AM, Bhawik Jain bhawikonl...@gmail.com wrote:

 On Saturday, 12 April 2014 10:15:03 UTC+5:30, Stanislav Zholnin  wrote:
  пятница, 11 апреля 2014 г., 21:36:14 UTC-5 пользователь Bhawik Jain
 написал:
 
   I have attempted a qualification round problem, and my rank is based
 on the time I attempted it after the availability of the question. I
 attempted it a few minutes ago (about 3 hours after the start of contest).
 If we qualify to next round, can this time and rank have an impact on the
 next rounds? Or it is for this round only  and new rounds will have a new
 start?
 
 
 
  No, it will not have any impact on the next round. as long as you get 25
 points

 Thank you so much..

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/9adcbd8e-a94b-49ef-9093-149537d07545%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/CAJej63JgKqivS0Y6ck_%2BcbxRtTBZMSQi_XXX%2Bg2a6KJ%3DY-2EAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Code of conduct

2014-03-27 Thread Paul Smith
Yes, I think if you could be specific about what you expect to see in the
terms and conditions then that would help.
https://code.google.com/codejam/terms.html

Paul Smith

p...@pollyandpaul.co.uk


On Thu, Mar 27, 2014 at 2:44 PM, Stanislav Zholnin 
stanislav.zhol...@gmail.com wrote:

 Honestly, I didn't understand this discussion.

 There is set of rules which you abide to when you sign up for CodeJam.
 What else do you need? What kind of things are covered by Code of Conduct
 but not covered by CodeJam rules?

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/b0ebe318-e2dc-43e2-820c-4ecf71e832dd%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/CAJej63KJZJFAeuHLPgFuRmvdu6gnkP-GcpN32QPX3wAJgMv-UQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Pls Help : Always Getting Rejected on submitting my output file, Test cases always 1 less

2014-03-15 Thread Paul Smith
OK, well if what you submit is being rejected, but what Lara submits is
fine, perhaps you should tell us how you submit your answers?  Maybe that's
going wrong?

Paul Smith

p...@pollyandpaul.co.uk


On Sat, Mar 15, 2014 at 4:25 AM, Anubhav Sethi anubhavseth...@gmail.comwrote:

 Good to know that Lara, but it still doesnt resolve my issue,  ( or u
 expect me to contact you everytime i make a solution :) )

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/ecae9466-0760-4131-9bdb-929ed97e90a8%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/CAJej63Lmfj94iXQ9n5KcqaQXWrrFZMv7A2snYfVBYLHfYxvMHA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Pls Help : Always Getting Rejected on submitting my output file, Test cases always 1 less

2014-03-13 Thread Paul Smith
Do you have strange line endings or something?

Paul Smith

p...@pollyandpaul.co.uk


On Thu, Mar 13, 2014 at 9:54 PM, Andres Lara M a.lara0...@gmail.com wrote:

 I submited your solution as txt file, exaclty how you post it and the
 answer was CORRECT

 Good luck!

 lara




 2014-03-13 12:10 GMT-06:00 Anubhav Sethi anubhavseth...@gmail.com:

 Every time i submit my output file i get error as
 Submission for input A-small Rejected: Your output file contains 99 test
 cases instead of the expected 100.
 You can learn more about rejections like this in our FAQ.

 When my file has 100 test cases .

 My Output file, for (Round B China New Grad Test 2014, Problem A. Sudoku
 Checker)

 Case #1: Yes
 Case #2: No
 Case #3: No
 Case #4: No
 Case #5: Yes
 Case #6: No
 Case #7: No
 Case #8: Yes
 Case #9: Yes
 Case #10: Yes
 Case #11: No
 Case #12: Yes
 Case #13: Yes
 Case #14: Yes
 Case #15: Yes
 Case #16: Yes
 Case #17: Yes
 Case #18: Yes
 Case #19: Yes
 Case #20: Yes
 Case #21: No
 Case #22: No
 Case #23: Yes
 Case #24: Yes
 Case #25: No
 Case #26: Yes
 Case #27: Yes
 Case #28: Yes
 Case #29: Yes
 Case #30: No
 Case #31: Yes
 Case #32: Yes
 Case #33: Yes
 Case #34: Yes
 Case #35: No
 Case #36: No
 Case #37: No
 Case #38: Yes
 Case #39: Yes
 Case #40: Yes
 Case #41: Yes
 Case #42: Yes
 Case #43: No
 Case #44: Yes
 Case #45: No
 Case #46: No
 Case #47: No
 Case #48: No
 Case #49: No
 Case #50: Yes
 Case #51: No
 Case #52: Yes
 Case #53: Yes
 Case #54: Yes
 Case #55: Yes
 Case #56: No
 Case #57: Yes
 Case #58: Yes
 Case #59: Yes
 Case #60: Yes
 Case #61: Yes
 Case #62: Yes
 Case #63: Yes
 Case #64: Yes
 Case #65: No
 Case #66: Yes
 Case #67: Yes
 Case #68: No
 Case #69: Yes
 Case #70: Yes
 Case #71: Yes
 Case #72: No
 Case #73: Yes
 Case #74: Yes
 Case #75: Yes
 Case #76: No
 Case #77: No
 Case #78: Yes
 Case #79: Yes
 Case #80: Yes
 Case #81: Yes
 Case #82: Yes
 Case #83: No
 Case #84: No
 Case #85: Yes
 Case #86: Yes
 Case #87: Yes
 Case #88: No
 Case #89: Yes
 Case #90: Yes
 Case #91: Yes
 Case #92: Yes
 Case #93: Yes
 Case #94: Yes
 Case #95: No
 Case #96: No
 Case #97: Yes
 Case #98: Yes
 Case #99: No
 Case #100: Yes

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/1a8ef01b-3696-41b6-b240-a0da03bb0527%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/CAL%3DJjNSTNcyvqL72uSKi6Egy%3D-m0qbFVnMMnb%3D2%3DZV8X6xM%3DrQ%40mail.gmail.comhttps://groups.google.com/d/msgid/google-code/CAL%3DJjNSTNcyvqL72uSKi6Egy%3D-m0qbFVnMMnb%3D2%3DZV8X6xM%3DrQ%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

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


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


Re: [gcj] Better samples please

2013-05-06 Thread Paul Smith
I actually enjoy the challenge of figuring out which corner case I missed.

Paul Smith

p...@pollyandpaul.co.uk


On Mon, May 6, 2013 at 7:24 AM, Bill Bruns bruns.b...@gmail.com wrote:

 I sympathize with Sumit, but must agree with Andres.  If this were a class
 then the instructors should help us learn to get the corner cases. But,
 this is a contest, not a school course.


 On Sat, May 4, 2013 at 11:25 PM, sumit sharma sksum...@gmail.com wrote:

 Atleast the response can be a list of testcases that failed.
 Then we can debug at out end.
 In my case Question1 had 6 incorrect test cases of 100. Very low
 probability that i will pick the incorrect test case to debug


 On Sun, May 5, 2013 at 4:56 AM, Andres Felipe Ruiz 
 andresfelip...@gmail.com wrote:

 This is one of the objectives of Programming Contest. Contestants should
 be able to identify all corner cases. As far as I am concerned, It just the
 way it should be.


 On Sat, May 4, 2013 at 3:39 PM, Lei Huang g201...@gmail.com wrote:

 Small tests could submit multiple times and give you the input files. I
 think it is generous enough for contestants.

 Lei Huang
 Master Student of Computer Science
 UCLA


 On Sat, May 4, 2013 at 1:35 PM, porker2008 zhangxion...@gmail.comwrote:

 I don't see why this case is special.

 It is a very general case.

 Parker

 On Sunday, May 5, 2013 4:33:39 AM UTC+8, newbie007 wrote:
  If the sample had the case below I would be able to solve it. sad
 ... :'(
  InputOutput: 2
 
 
  11 2
  26 28
 
 
 
 
 
 
 
 
  On Sat, May 4, 2013 at 3:58 PM, Luke Pebody luke@gmail.com
 wrote:
 
 
  In my humble opinion, Code Jam covers edge cases in their samples
 much much more than Topcoder. In Topcoder, I might have been careless and
 not notice the infinite loop my solution went into in tonight's problem 1
 if A = 1.
 
 
 
 
  Whether this is better or worse is a separate debate, but
 definitely I find more coverage in Code Jam than Topcoder.
 
 
 
 
 
 
 
 
 
 
  On Sat, May 4, 2013 at 7:51 PM, Niraj Kumar niraj...@gmail.com
 wrote:
 
 
 
  there may be many edge cases which is not covered in sample, but we
 need to take care it.
 
 
 
 
 
 
 
 
 
  Regards,
 
  Niraj Kumar
 
 
 
  B.Tech. CSE
 
 
 
  Class of 2012
  ISM, Dhanbad
  8274952350
 
 
 
 
 
  On Sun, May 5, 2013 at 12:11 AM, Leandro Coutinho 
 lescou...@gmail.com wrote:
 
 
 
 
  The small dataset should test if the coder didn't hard coded the
 solution.
  The large dataset should test if the algorithm is efficient enough.
 
 
  So if the solution is not hard coded and could solve the sample, it
 should be able to solve the small dataset at least.
 
 
 
 
  It's very frustrating when the output is correct for the sample but
 fails for the small dataset.
  And it's also harder to debug ...
 
 
 
 
  --
 
  You received this message because you are subscribed to 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.
 
  For more options, visit https://groups.google.com/groups/opt_out.
 
 
 
 
 
 
 
 
 
 
 
 
 
  --
 
  You received this message because you are subscribed to 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.
 
  For more options, visit https://groups.google.com/groups/opt_out.
 
 
 
 
 
 
 
 
 
 
 
  --
 
  You received this message because you are subscribed to 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.
 
  For more options, visit https://groups.google.com/groups/opt_out.

 --
 You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-code/-/1vg4v-2sTOwJ.
 For more options, visit https://groups.google.com/groups/opt_out.



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






 --
 asdf

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

Re: [gcj] Any specific way to prepare for 1A...

2013-04-18 Thread Paul Smith
All the previous round 1 problems are available for practice.

Paul Smith

p...@pollyandpaul.co.uk


On Thu, Apr 18, 2013 at 4:47 AM, Jayaganesh Kalyanasundaram 
jayaganesh1...@gmail.com wrote:

 Hi all...I've passed the qualification round and would like to understand
 if there are any materials or tough question or so for the benefit of Round
 1A...
 Thanks for the sameAlso if any round 1 winners(previous years) pls
 share your experience and ur preparations and execution...
 Jayaganesh Kalyanasundaram

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




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




Re: [gcj] questions about rounds and structure

2013-04-15 Thread Paul Smith
Rounds 1A, 1B, and 1C are designed to be of comparable difficulty.  Round 2
is harder.  To get to round 2 you only need to compete in one of 1A, 1B,
and 1C.

It's really like they took Round 1, and ran it 3 times to give fair
coverage to each time zone.

Paul Smith

p...@pollyandpaul.co.uk


On Mon, Apr 15, 2013 at 10:36 PM, Wolfgang Faust wolfgang...@gmail.comwrote:

 In order to advance to round 2, you must place in one of rounds 1A,B, or
 C. Once you qualify for round 2, you can no longer participate in the of
 the 1 rounds. See the quick start guide for info.
  On Apr 15, 2013 5:28 PM, zach polansky zacharypolan...@gmail.com
 wrote:

 Can I ask, how many people last year got past each stage.
 Also, why is it called rounds 1A, 1B, 1C, 2 and 3 instead of 1, 2, 3, 4,
 and 5
 do rounds 1A, 1B and 1C have some sort of connection or something?
 -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/msg/google-code/-/CzsQeKYrLA4J.
 For more options, visit https://groups.google.com/groups/opt_out.


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




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




Re: [gcj] Why is this output wrong ?

2013-03-28 Thread Paul Smith
My calculator says 791.  And by my calculator I mean Windows calculator.

Paul Smith

p...@pollyandpaul.co.uk


On Tue, Mar 26, 2013 at 10:56 PM, Ayman Mohamed 
mahone.alexande...@gmail.com wrote:

 Could you tell me you answer when n=28 ?


 On Tue, Mar 26, 2013 at 11:21 PM, Paul Smith p...@pollyandpaul.co.ukwrote:

 My guess is that you have an overflow.  Your answers for n = 2, 4, and 5
 are correct but my calculator says that when n=7 the answer is
 107903.848... = 903, but you've got 182.

 Look closely at what data types you are trying to store your answers in.

 Paul Smith

 p...@pollyandpaul.co.uk


 On Tue, Mar 26, 2013 at 9:02 PM, Ayman Mohamed 
 mahone.alexande...@gmail.com wrote:




 On Tue, Mar 26, 2013 at 11:02 PM, Ayman Mohamed 
 mahone.alexande...@gmail.com wrote:

 Here is the input file


 On Tue, Mar 26, 2013 at 11:00 PM, Paul Smith 
 p...@pollyandpaul.co.ukwrote:

 You need to post the input you ran, and probably your source code too
 before anyone will be able to help.

 Paul Smith

 p...@pollyandpaul.co.uk


 On Tue, Mar 26, 2013 at 8:50 PM, Ayman 
 mahone.alexande...@gmail.comwrote:

 Hi, everyone.
 for the Numbers problem where it asks for the last three digits,
 this was my answer. They tell me that my answer is wrong but I don't know
 why, Can anyone help ?

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




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





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




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




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




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




Re: [gcj] Why is this output wrong ?

2013-03-26 Thread Paul Smith
You need to post the input you ran, and probably your source code too
before anyone will be able to help.

Paul Smith

p...@pollyandpaul.co.uk


On Tue, Mar 26, 2013 at 8:50 PM, Ayman mahone.alexande...@gmail.com wrote:

 Hi, everyone.
 for the Numbers problem where it asks for the last three digits, this
 was my answer. They tell me that my answer is wrong but I don't know why,
 Can anyone help ?

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




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




Re: [gcj] Why is this output wrong ?

2013-03-26 Thread Paul Smith
My guess is that you have an overflow.  Your answers for n = 2, 4, and 5
are correct but my calculator says that when n=7 the answer is
107903.848... = 903, but you've got 182.

Look closely at what data types you are trying to store your answers in.

Paul Smith

p...@pollyandpaul.co.uk


On Tue, Mar 26, 2013 at 9:02 PM, Ayman Mohamed mahone.alexande...@gmail.com
 wrote:




 On Tue, Mar 26, 2013 at 11:02 PM, Ayman Mohamed 
 mahone.alexande...@gmail.com wrote:

 Here is the input file


 On Tue, Mar 26, 2013 at 11:00 PM, Paul Smith p...@pollyandpaul.co.ukwrote:

 You need to post the input you ran, and probably your source code too
 before anyone will be able to help.

 Paul Smith

 p...@pollyandpaul.co.uk


 On Tue, Mar 26, 2013 at 8:50 PM, Ayman mahone.alexande...@gmail.comwrote:

 Hi, everyone.
 for the Numbers problem where it asks for the last three digits, this
 was my answer. They tell me that my answer is wrong but I don't know why,
 Can anyone help ?

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




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





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




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




Re: [gcj] Re: Output File for all QR problems

2013-03-21 Thread Paul Smith
Probably QR = qualifying round?  Do you mean the correct answers?  The
source code to all submitted answers is posted, if you want to know the
correct output for a given input, download the source of a program which
scored maximum points, download an input, and run it.

Paul Smith

p...@pollyandpaul.co.uk


On Thu, Mar 21, 2013 at 6:20 AM, Olaf Doschke olaf.dosc...@gmail.comwrote:

 QR to me is a type of barcode.
 What are you referring to with QR problems? Do you have 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/msg/google-code/-/1AYD-ECHU5YJ.

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




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




Re: [gcj] All your base

2013-03-15 Thread Paul Smith
Yes, this is the solution to the problem.  Once you realise this the
solution is quite easy to code.

It doesn't contradict the earlier post.  Zig could be 187 in base 10' but
that's never going to be its minimum.

On Friday, March 15, 2013, Aneesh Dogra wrote:

 But it wouldn't be necessary to go over any base other than the min base
 because of course the minimum base would give us the min value



-- 
Paul Smith

p...@pollyandpaul.co.uk

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




Re: [gcj] Environment for gcj.

2013-03-13 Thread Paul Smith
Which OS/IDE/Browser do you normally use for coding?

Paul Smith

p...@pollyandpaul.co.uk


On Wed, Mar 13, 2013 at 9:44 AM, Pranav Kulkarni pranavc...@gmail.comwrote:

 Hello all,

 Its my first time in online coding contest. I was worried about what
 environment should be, for such events.
 By environment, i mean which os? Which ide/editor? Which browser? And
 if any tutorials,books,etc should be made prepared.
 Thankyou for helping.

 --
 Thanks and Regards.

 Pranav Kulkarni,
 B. Tech., Department of Computer Science and Engineering,
 Walchand College of Engineering,
 Sangli - 416 415

 Wish you a Very Good Day! :)

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




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




Re: [gcj] Regarding output file for submission

2013-03-09 Thread Paul Smith
Not c, not cpp, not exe.

Your program operates on an input file, and makes some output.  You
probably output the case answers to stdout.  Redirect this output to a .txt
file, and submit that.

In the competition for real you also have to upload source, so then you
will need to upload the .c or .cpp file or whatever language you used.

Paul Smith

p...@pollyandpaul.co.uk


On Sat, Mar 9, 2013 at 10:20 PM, Mobarak nirjoy@gmail.com wrote:

 Hello, Its my first time participating in Codejam.  I solve a practice
 problem but i can't submit it. Actually I don't understand which output
 file(.c,.cpp, .exe ) i have to submit?

 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/msg/google-code/-/6WSZ0YEM_H4J.
 For more options, visit https://groups.google.com/groups/opt_out.




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




Re: [gcj] Interviewstreet requirement problem

2013-01-21 Thread Paul Smith
Truly you are a wise and powerful wizard.  Wish I could get in to your head
sometimes.

Paul

On Monday, January 21, 2013, Luke Pebody wrote:

 I had insight on my walk home from work.

 I think this is a DP problem, and you solve num(subset, K), which is the
 number of ways of labelling subset of vertices with numbers 1 up to K.

 The recurrence is num(subset, K) = sum num(subset1, K-1), the sum being
 over all subsets subset1 of subset such that if y is in subset1, x is in
 subset and x=y then x is in subset1.

 Time O(11*3^14) which should be fast enough.



 On 21 Jan 2013, at 07:37, Hussein El-Sayed hussein@gmail.com wrote:

 Paul,


 Thanks for your clear explanation i think it's very helpful, first i
 thought it could be solved using LP, but i couldn't transform it to an
 optimization problem as its not so. Then i made a directed graph trying to
 recursively build the solution, but i found it wrong after that. Also a
 brute force solution won't survive as you know. Now i will go through your
 explanation then solving it.

 Thanks,
 Hussein

 On Mon, Jan 21, 2013 at 12:27 AM, Paul Smith p...@pollyandpaul.co.ukwrote:

 Have you made any effort to solve it yourself?  How are you doing?  Where
 specifically are you stuck?

 Paul Smith

 p...@pollyandpaul.co.uk


 On Sun, Jan 20, 2013 at 8:30 PM, Hussein El-Sayed 
 hussein@gmail.comwrote:

 The whole problem, i need to know how can i solve this problem.


 On Sun, Jan 20, 2013 at 6:28 PM, paulmcq mcques...@gmail.com wrote:

 I would assume that means Report the answer modulo 1007 from someone for
 whom English is a second language.

 More importantly, are you objecting to the wording or to the content of
 the problem?


 On Saturday, January 19, 2013 10:38:06 AM UTC-6, Luke wrote:

 Module the answer by 1007 is a new usage to me.

 I don't like it.



 On 19 Jan 2013, at 16:31, Hussein El-Sayed husse...@gmail.com wrote:

 Its is name is Requirement .. you can view it from this 
 urlhttps://www.interviewstreet.com/challenges/dashboard/#problem/4f6db7f5a79f5
 .


 On Sat, Jan 19, 2013 at 6:20 PM, Amir Hossein Sharifzadeh 
 amirsha...@gmail.com wrote:

 Which problem?

 On Sat, Jan 19, 2013 at 8:57 AM, Hussein El-Sayed husse...@gmail.comwrote:

 Hello,

 Can you please help me solving this problem?

 Thanks,
 Hussein

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to googl...@googlegroups.com.
 To unsubscribe from this group, send email to google-code...@**
 googlegroups.com.

 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .




  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to googl...@googlegroups.com.
 To unsubscribe from this group, send email to google-code...@**
 googlegroups.com.

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

  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to 
 google-code@googlegroups.comjavascript:_e({}, 'cvml', 
 'google-code@googlegroups.com');
 .
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'google-code%2bunsubscr...@googlegroups.com');.
 For more options, visit https://groups.google.com/groups/opt_out.





-- 
Paul Smith

p...@pollyandpaul.co.uk

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gcj] Interviewstreet requirement problem

2013-01-20 Thread Paul Smith
I'm not much good at these things.

It feels like you want to aim toward a tree of requirements, aiming to end
up with the variable that is required to be the smallest as the root node.

So, make a directed graph where each requirement is an edge.  Any cycles
can be collapsed down to a single edge, as if a = b, b = c and c = a
then the only solution is a=b=c.

Then start with all variables set to 0 - this is always a valid solution
(any solution with all variables equal is valid).  You can freely increment
any variable that doesn't appear on the left of a requirement.  In the
given sample there are 2 such variables (4 and 5), so that's 100 solutions
with the first four variables each set to 0.

Now, if we increment to 0,0,0,1, the variable 4 must increment here too, as
it must not be less than variable 3.  That leaves us with a 'base' of
0,0,0,1,1,0, from which we can again freely increment 5 and 6, to get 90
more solutions.

Similarly, 0,0,0,2 gives 80 more, 0,0,0,3 gives 70 more, etc.

When we get to 0,0,1, we get a 'base' of 0,0,1,0,1,1 as we have the
requirements '4 isn't greater than 2' and '5 isn't greater than 2'.

When we finally get round to incrementing variable 0, we get a base of
1,1,1,1,1,1 as we have a chain of requirements that forces us to increment
every variable.

So I think the trick is to think of the N variables representing an N digit
number in base 10, and count upwards through the numbers, noting that
incrementing an 'earlier' digit may have implications on a later digit, as
in the above where incrementing digit 4 implied I had to also increment
digit 5.

I'm not quite sure how to generalise this into a program, but maybe it
gives someone the necessary leg-up :)

If you did have a cycle of requirements such that a =b, b =c and c = a,
you know a, b, and c must always be equal, so put those digits next to each
other and simplify by removing the redundant digits?

Like I said, I'm not much good at these things.

Paul Smith

p...@pollyandpaul.co.uk


On Sun, Jan 20, 2013 at 5:36 PM, Luke Pebody luke.peb...@gmail.com wrote:

 Wording. Content is interesting but I am not sure how to start on it.



 On 20 Jan 2013, at 16:28, paulmcq mcques...@gmail.com wrote:

 I would assume that means Report the answer modulo 1007 from someone for
 whom English is a second language.

 More importantly, are you objecting to the wording or to the content of
 the problem?

 On Saturday, January 19, 2013 10:38:06 AM UTC-6, Luke wrote:

 Module the answer by 1007 is a new usage to me.

 I don't like it.



 On 19 Jan 2013, at 16:31, Hussein El-Sayed husse...@gmail.com wrote:

 Its is name is Requirement .. you can view it from this 
 urlhttps://www.interviewstreet.com/challenges/dashboard/#problem/4f6db7f5a79f5
 .


 On Sat, Jan 19, 2013 at 6:20 PM, Amir Hossein Sharifzadeh 
 amirsha...@gmail.com wrote:

 Which problem?

 On Sat, Jan 19, 2013 at 8:57 AM, Hussein El-Sayed husse...@gmail.comwrote:

 Hello,

 Can you please help me solving this problem?

 Thanks,
 Hussein

 --
 You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
 To post to this group, send email to googl...@googlegroups.com.
 To unsubscribe from this group, send email to google-code...@**
 googlegroups.com.
 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .




  --
 You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
 To post to this group, send email to googl...@googlegroups.com.
 To unsubscribe from this group, send email to google-code...@**
 googlegroups.com.
 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .




  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to googl...@googlegroups.com.
 To unsubscribe from this group, send email to google-code...@**
 googlegroups.com.
 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .



  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-code/-/40y_zNXxDN4J.
 For more options, visit https://groups.google.com/groups/opt_out.



  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam

Re: [gcj] Interviewstreet requirement problem

2013-01-20 Thread Paul Smith
Have you made any effort to solve it yourself?  How are you doing?  Where
specifically are you stuck?

Paul Smith

p...@pollyandpaul.co.uk


On Sun, Jan 20, 2013 at 8:30 PM, Hussein El-Sayed hussein@gmail.comwrote:

 The whole problem, i need to know how can i solve this problem.


 On Sun, Jan 20, 2013 at 6:28 PM, paulmcq mcques...@gmail.com wrote:

 I would assume that means Report the answer modulo 1007 from someone
 for whom English is a second language.

 More importantly, are you objecting to the wording or to the content of
 the problem?


 On Saturday, January 19, 2013 10:38:06 AM UTC-6, Luke wrote:

 Module the answer by 1007 is a new usage to me.

 I don't like it.



 On 19 Jan 2013, at 16:31, Hussein El-Sayed husse...@gmail.com wrote:

 Its is name is Requirement .. you can view it from this 
 urlhttps://www.interviewstreet.com/challenges/dashboard/#problem/4f6db7f5a79f5
 .


 On Sat, Jan 19, 2013 at 6:20 PM, Amir Hossein Sharifzadeh 
 amirsha...@gmail.com wrote:

 Which problem?

 On Sat, Jan 19, 2013 at 8:57 AM, Hussein El-Sayed 
 husse...@gmail.comwrote:

 Hello,

 Can you please help me solving this problem?

 Thanks,
 Hussein

 --
 You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
 To post to this group, send email to googl...@googlegroups.com.
 To unsubscribe from this group, send email to google-code...@**
 googlegroups.com.

 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .




  --
 You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
 To post to this group, send email to googl...@googlegroups.com.
 To unsubscribe from this group, send email to google-code...@**
 googlegroups.com.

 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .




  --
 You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
 To post to this group, send email to googl...@googlegroups.com.
 To unsubscribe from this group, send email to google-code...@**
 googlegroups.com.

 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .



  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-code/-/40y_zNXxDN4J.

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




  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gcj] Adding case numbers with replace-regexp in emacs

2012-12-31 Thread Paul Smith
Sweet!  Happy New Year, o generous giver of knowledge :)

Paul Smith

p...@pollyandpaul.co.uk


On Mon, Dec 31, 2012 at 8:49 AM, Luke Pebody luke.peb...@gmail.com wrote:

 A little tip for everybody who's interested (probably nobody):

 Going to the top of a file in emacs and running the command

 replace-regexp RET ^ RET \,(format Case #%d:  (+ 1 \#))

 Will add Case numbers to the start of every line.

 Happy new year, y'all.

 Luke

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gcj] Re: Another doubt, apologies for my last post that has been too long and worthless

2012-08-25 Thread Paul Smith
But the comet has a max length of 6 characters, so the worst case is ZZ
= 26^6 which I think fits in a 32 bit int.  There's nothing clever needed
here, you can just program this in a very straightforward manner.
 Literally do what the problem tells you to do :)

Paul Smith

p...@pollyandpaul.co.uk


On Sat, Aug 25, 2012 at 12:05 PM, Joseph DeVincentis dev...@gmail.comwrote:

 You have the product, although you have only done it for one string so
 far. The problem tells you how to get the mod 47 value; this is in fact
 such a common operation in computing that your language has an operator to
 perform it.

 If your numbers are small, you just have to compare the mod 47 values and
 print the output. The problem you are going to encounter is when the comet
 has a name like YZX. That is where you need the help Carlos gave
 about how modular arithmetic applies to multiplication.

 On Sat, Aug 25, 2012 at 1:02 AM, Bonethug tejeshwa...@gmail.com wrote:

 @Carlos need a more detailed explanation, like where do we use the rings
 of congruence, how does it solve my problem here?


 On Saturday, August 25, 2012 12:50:35 AM UTC+5:30, Bonethug wrote:

 I am having a problem here, this is the question, this is how far i got,
 is there a better way to do this??


 It is a well-known fact that behind every good comet is a UFO. These
 UFOs often come to collect loyal supporters from here on Earth.
 Unfortunately, they only have room to pick up one group of followers on
 each trip. They do, however, let the groups know ahead of time which will
 be picked up for each comet by a clever scheme: they pick a name for the
 comet which, along with the name of the group, can be used to determine if
 it is a particular group's turn to go (who do you think names the comets?).
 The details of the matching scheme are given below; your job is to write a
 program which takes the names of a group and a comet and then determines
 whether the group should go with the UFO behind that comet.

 Both the name of the group and the name of the comet are converted into
 a number in the following manner: the final number is just the product of
 all the letters in the name, where A is 1 and Z is 26. For instance,
 the group USACO would be 21 * 19 * 1 * 3 * 15 = 17955. If the group's
 number mod 47 is the same as the comet's number mod 47, then you need to
 tell the group to get ready! (Remember that a mod b is the remainder left
 over after dividing a by b; 34 mod 10 is 4.)

 Write a program which reads in the name of the comet and the name of the
 group and figures out whether according to the above scheme the names are a
 match, printing GO if they match and STAY if not. The names of the
 groups and the comets will be a string of capital letters with no spaces or
 punctuation, up to 6 characters long.

 Examples:

 InputOutput

 COMETQ
 HVNGAT

 GO

 ABSTAR
 USACO

 STAY

 PROGRAM NAME: rideThis means that you fill in your header with:
 PROG: rideINPUT FORMAT Line 1:An upper case character string of length
 1..6 that is the name of the comet.Line 2:An upper case character
 string of length 1..6 that is the name of the group.

 *NOTE*: The input file has a newline at the end of each line but does
 not have a return. Sometimes, programmers code for the Windows paradigm
 of return followed by newline; don't do that! Use simple input routines
 like readln (for Pascal) and, for C/C++, fscanf and fidstring.
 SAMPLE INPUT (file ride.in)

 COMETQ
 HVNGAT

 OUTPUT FORMATA single line containing either the word GO or the word
 STAY. SAMPLE OUTPUT (file ride.out)

 GO

  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-code/-/m4ulgyKfgOEJ.

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




  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gcj] Purchasing animals is a tricky task.

2012-08-10 Thread Paul Smith
b = number of bulls bought
c = number of cows bought
g = number of batches of 20 goats bought

So you need to spend your $100? = c + 5b + g = 100
You need to have 100 animals? = c + b + 20g = 100
You need at least 1 of each animal? = c  0, b  0, g  0

Looks like a simplex problem to me?

Paul Smith

p...@pollyandpaul.co.uk


On Fri, Aug 10, 2012 at 7:44 AM, Bonethug tejeshwa...@gmail.com wrote:
 You have $100. You need to buy cows, bulls and goats which sell at the
 following rate.
 $1 = 1 Cow
 $5 = 1 Bull
 $1 = 20 Goats
 How will you purchase these animals so that you spend your $100 and you have
 100 animals which includes the cows, bulls and goats.
 A pretty tough question for more google code community, I need help,
 Thanks and Regards,
 Bonethug

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-code/-/Gg_LTqD8YdEJ.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gcj] 1C- Diamond Inheritence

2012-05-07 Thread Paul Smith
I think your algorithm will not always correctly join the paths.

Take a simple example

1-[2]
2-[3]
3-[]

You will increment a[1][2]
then a[2][3], then a[1][3]

But if the rows were the other way around:

1-[]
2-[1]
3-[2]

You will increment a[2][1]
Then a[3][2], but you won't increment a[3][1], even though a path
exists from 3 - 1.

Basically you are only extending the paths for vertices that are
encountered in the correct order in the input file.

Paul Smith

p...@pollyandpaul.co.uk


On Mon, May 7, 2012 at 8:04 PM, abcstdio souptik...@gmail.com wrote:
 My algorithm :

 1. Create a 2D array a[n][n] where a[i][j] = No. of paths poissible
 from i to j .
 2. Initialize all elements of a[][] to zero.
 3. For each vertex i from 1 to N
      (a) Read the list of vertices it is connected to. For each
 vertex V in the list increment a[i][V].
      (b) For all previous vertices j from 1 to i-1, if there is
 already a path from j to i, then there must be a path from j to V via
 i, so a[j][V]++.
           If a[j][V]1 then we have got the answer, so simply read
 the rest of the input and no need of any computations.

 It gave me Wrong Answer on the small input test. Please point out the
 errors.

 --
 You received this message because you are subscribed to the Google Groups 
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-code?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Any fast way to view others' solutions?

2012-04-30 Thread Paul Smith
Input with , output with 

I have no idea how the Dev-C++ IDE works, but I assume there's some
way of you running your compiled executable with command-line
parameters.

myprog.exe  a.in  a.out

will run myprog.exe with stdin reading from the file a.in, and stout
redirected to a.out.

Paul Smith

p...@pollyandpaul.co.uk


On Mon, Apr 30, 2012 at 10:58 PM, Makandriaco jime...@kaliman.net wrote:
 If I have Dev-C++, can I put that somewhere in the IDE and run the
 program from there? or do i need to do the command line?
  also, how do they redirect both the input and the output?

 On Apr 30, 3:22 pm, Paul Smith p...@pollyandpaul.co.uk wrote:
 Using console redirection.

 Compile the code, say to a.out, then run it with the command line:

 a.out  A-small-1.in

 or similar.

 Paul Smith

 p...@pollyandpaul.co.uk



 On Mon, Apr 30, 2012 at 10:14 PM, Makandriaco jime...@kaliman.net wrote:
  Hate to sound stupid, but I have little experience with Java or Python
  or C, so I am having some problems running the solutions. Maybe you
  can explain how do contestants pass the file to the code when there is
  no declaration of a file and the main only starts with a

  int main() {
  int T
  scanf(%d,T);

  getting the number of test cases

  On Apr 30, 2:52 pm, Chris Knott christopher.r.kn...@googlemail.com
  wrote:
  I have got solutions for ~100 of the problems on my website:
  chrk.atwebpages.com/

  On Friday, April 20, 2012 4:56:50 AM UTC+1, Jason Jin Xin wrote:

   I want to study others' code, but clicking one by one and unzip those
   zip files can be quite tedious.I was wondering if there are faster
   ways to do it
   thanx

  --
  You received this message because you are subscribed to the Google Groups 
  Google Code Jam group.
  To post to this group, send email to google-code@googlegroups.com.
  To unsubscribe from this group, send email to 
  google-code+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/google-code?hl=en.

 --
 You received this message because you are subscribed to the Google Groups 
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-code?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Round 1A 2009m, problem B, Crossing the Road, output file.

2012-04-28 Thread Paul Smith
Download a correct solution, run it on the same input, compare their output
with yours.

On Thursday, April 19, 2012, Makandriaco wrote:

 Can someone post or send me the correct output file for this problem?
 I have gone solving by hand the first few cases and they all are
 correct for my solution. But there are too many to do them all and I
 would like to see the case that got me the incorrect so I can trace
 the error.
 This is just for practice.
 Please?
 thanks

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to 
 google-code@googlegroups.comjavascript:;
 .
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com javascript:;.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.



-- 
Paul Smith

p...@pollyandpaul.co.uk

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Command line tool issues during qualification round

2012-04-16 Thread Paul Smith
I was loading using ARGF in Ruby - I didn't notice an encoding problem
but that doesn't mean it wasn't there.

Paul Smith

p...@pollyandpaul.co.uk



On Mon, Apr 16, 2012 at 12:40 PM, sumu...@gmail.com sumu...@gmail.com wrote:
 I also had the same experience.  D didn't work at all BTW.

 Furthermore, I got Windows line-endings when I downloaded the inputs
 through the command line tool, and Unix line-endings (which I was
 expecting) when downloading through the browser.  Did you also see
 this (it caused a minor issue with my solution to A but I fixed it
 within the 4 mins)?

 On Apr 15, 5:03 pm, Paul Smith p...@pollyandpaul.co.uk wrote:
 Exact same problem here - A uploaded fine, B and C both told me I
 hadn't downloaded that input.

 No problem, I was well within my 4 minutes so just clicked through
 from the webpage to upload like before.

 Paul Smith

 p...@pollyandpaul.co.uk







 On Sun, Apr 15, 2012 at 5:25 AM, Vexorian vexor...@gmail.com wrote:
  I had a couple of issues with the tool during the qualification. Wondering
  if it was just me or if anyone else experienced them.

  I was surprised it did not have any issue downloading and submitting 
  problem
  A, as it has a different format and all that.

  When I tried to solve B, I was able to download B-small and B-large, but it
  would not let me upload. It said that I did not download the test case
  before uploading, so I had to submit manually. The same happened with C. I
  did not even try with D-small.

  --
  You received this message because you are subscribed to the Google Groups
  Google Code Jam group.
  To view this discussion on the web visit
 https://groups.google.com/d/msg/google-code/-/EdHd4Qm_BmUJ.
  To post to this group, send email to google-code@googlegroups.com.
  To unsubscribe from this group, send email to
  google-code+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

 --
 You received this message because you are subscribed to the Google Groups 
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-code?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] How can I increase my speed to solve problems.

2012-04-16 Thread Paul Smith
Did you write the code for reading in the input from the file, and
writing the output to a file?  Well, now you have that you won't need
to re-write it.

Some people use a template file filled with things they will commonly
use.  I don't, maybe because I haven't thought far enough to what my
templates would even look like.

Other than that, practise.  2.5 hours means that maybe you'll get one
question done in Round 1.  That would be a huge success for your first
time in the Code Jam :)  Practise until next year and maybe you'll get
2 questions done next time!

Paul Smith

p...@pollyandpaul.co.uk



On Mon, Apr 16, 2012 at 7:43 AM, Harish Moolchandani
harish.8...@gmail.com wrote:
 It takes me so much time to solve gcj problems.
 Speaking in tongues was really easy and still it took 1 hour for me to read,
 understand, and implement the logic.
 Then dancing with googlers took 2:30 hours.
 And recycled numbers  again took 2:30 hours.

 What I should do to increase my speed.  I cannot qualify round1 if this will
 be my speed to solve code.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Online IDEs

2012-04-15 Thread Paul Smith
If you got the time expiring due to your program running too long, it
probably is not down to the speed of your computer.

It probably is down to the efficiency of your code.

Paul Smith

p...@pollyandpaul.co.uk



On Sat, Apr 14, 2012 at 1:26 PM, Prateek Kushwaha
prateekkushwah...@gmail.com wrote:
 Can anyone suggest a good online IDE where you can run your code ?
 I got the output of question 3 Recycled Numbers- Small part correctly, but
 the large part is taking too long to run and the time expired. Any
 suggestions ?

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Command line tool issues during qualification round

2012-04-15 Thread Paul Smith
Exact same problem here - A uploaded fine, B and C both told me I
hadn't downloaded that input.

No problem, I was well within my 4 minutes so just clicked through
from the webpage to upload like before.

Paul Smith

p...@pollyandpaul.co.uk



On Sun, Apr 15, 2012 at 5:25 AM, Vexorian vexor...@gmail.com wrote:
 I had a couple of issues with the tool during the qualification. Wondering
 if it was just me or if anyone else experienced them.

 I was surprised it did not have any issue downloading and submitting problem
 A, as it has a different format and all that.

 When I tried to solve B, I was able to download B-small and B-large, but it
 would not let me upload. It said that I did not download the test case
 before uploading, so I had to submit manually. The same happened with C. I
 did not even try with D-small.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-code/-/EdHd4Qm_BmUJ.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] how to identify test cases

2012-04-13 Thread Paul Smith
The problem itself will tell you.  It depends on the problem but
either a test case will be a specific number of lines long, or, if
it's variable, one of the first lines of the case will tell you how
long the case is.

The first line of the input as a whole is usually the number of test cases.

Of course, this has been true for previous years and might not
necessarily be true for this or future years.

Paul Smith

p...@pollyandpaul.co.uk



On Fri, Apr 13, 2012 at 6:47 PM, anujCD247 anujcd...@gmail.com wrote:
 how can we differentiate different test cases in the input file(by space or
 newline or by what factor)

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-code/-/8tcG9Y77my4J.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Python

2012-04-13 Thread Paul Smith
I don't run in python, but you can almost certainly have the python
script read from stdin, write to stout, and use shell redirection to
attaché the files.

Something like

python abc.py  A-small.in  A-small.out

Paul Smith

p...@pollyandpaul.co.uk



On Fri, Apr 13, 2012 at 7:09 PM, vivek dhiman vivek4dhi...@gmail.com wrote:
 Hi all python lovers ..
 so my question is .. i guess to every one who is running python on windows

 How r u running python programs?
 I think of 1 case
 1st case
 1. you write code in  a file(say abc.py) using notepad++/jedit
 2.  then go to cmd prompt.. type python abc.py and run..
 but how do you give in and out files ?
 Are you defining variable inside the code i mean one file variable for  in
 and one for out and fixing the file names. Are you doing this ?
  or are you doing something else??

 Or are you doing something totally different from command line ??

 Just help me out saying that you do it like this .. or may be if u have some
 youtube video link or something that is also ok..

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Problem : Transmission

2012-04-02 Thread Paul Smith
Each set of numbers has 4^3 = 64 possible sets of 3 operators.
Each set of operators has at most 3! = 6 ways to resolve precedence. Many
of these lead to the same result, but it doesn't matter.

With only 384 possibilities to check, I think you can just brute force it.

On Sunday, April 1, 2012, doom731 wrote:

 Problem is as :

 You received a transmission containing an expression of single digit
 positive integers (say: 9 *(5 – 4) * 3). However, during transmission
 all operators and brackets were lost and you only received 9 5 4 3.
 Given the array of digits, you have to calculate the least positive
 integer value of the expression that could NOT have been received by
 you.  The binary operators possible are *, +, -, / and brackets
 possible are ( and ).  Note that / is an integer division i.e. 9/5 =
 1.

 Example:  You have received 6,6,4,4. The minimum positive integer that
 could NOT have been formed is  18. This is because integers less than
 18 are formed as below.

 1 = 6 /6 + 4-4

 2 = 6/6 + 4/4

 3 = 6  +( 6/4) -4

 4 = (6+6+4) / 4

 ……..

 18 cannot be formed

 Input Format:

 FIrst line contains an integer N, the number of digits in the array.

 Then follow N lines each containing a digit.

 Output Format:

 Print a single integer which is the required answer.

 Sample Input:

 4

 6

 6

 4

 4

 Sample Output:

 18

 Constraints:

 1 = N = 10

 Note: You need not worry about the precedence of operators as you can
 impose necessary precedence using brackets at appropriate places.


 ==

 I thought backtracking as an approach , but it will be a mess
 considering bracket-permutaions with operands.

 Can you suggest a better approach.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to 
 google-code@googlegroups.comjavascript:;
 .
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com javascript:;.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.



-- 
Paul Smith

p...@pollyandpaul.co.uk

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Do I have to use commandline tool to compete in code jam?

2012-03-22 Thread Paul Smith
I prefer it - I can submit faster that way and, you know, programmers
like to automate stuff, but no, it's not necessary.

Paul Smith

p...@pollyandpaul.co.uk



On Thu, Mar 22, 2012 at 2:18 AM, Moustafa Farid m.alzan...@acm.org wrote:

 no, you don't have to.
 --
 Moustafa
 Sent from my android.

 On Mar 22, 2012 3:03 AM, freegyp gyp...@live.cn wrote:

 As the title.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-code/-/tbo7IqsHypEJ.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] which c++ compiler should i use.

2012-03-19 Thread Paul Smith
gcc

Paul Smith

p...@pollyandpaul.co.uk



On Sat, Mar 17, 2012 at 6:49 PM, sunil saluja.su...@gmail.com wrote:
 hi
 Please help me..
 which c++ compiler should i use to code in code jam. i want to know
 which one is eligible for codejam.

 regards,
 sunill

 --
 You received this message because you are subscribed to the Google Groups 
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-code?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] which c++ compiler should i use.

2012-03-19 Thread Paul Smith
That's not strictly true - you can't use commercial only compilers IIRC.

Visual studio is fine because the Express editions exist (I assume
this is still true!)

Paul Smith

p...@pollyandpaul.co.uk



On Mon, Mar 19, 2012 at 5:21 PM, bala subramanian
bala.busy...@gmail.com wrote:
 You can use any kind of compiler
 Sent on my BlackBerry® from Vodafone

 -Original Message-
 From: sunil saluja.su...@gmail.com
 Sender: google-code@googlegroups.com
 Date: Sat, 17 Mar 2012 11:49:03
 To: Google Code Jamgoogle-code@googlegroups.com
 Reply-To: google-code@googlegroups.com
 Subject: [gcj] which c++ compiler should i use.

 hi
 Please help me..
 which c++ compiler should i use to code in code jam. i want to know
 which one is eligible for codejam.

 regards,
 sunill

 --
 You received this message because you are subscribed to the Google Groups 
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-code?hl=en.

 --
 You received this message because you are subscribed to the Google Groups 
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-code?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Number_problem..

2012-03-16 Thread Paul Smith
A language with N digits in it is using a Base N number system.

Some 'languages' you are used to are decimal (0123456789), hexadecimal
(0123456789abcdef) and binary (01)

The language oF8 is essentially a Base 3 language.  Think of of8 as being 012.

Therefore, the number Fo8 in this language is actually like the base 3
number 102  which is 2 + (0*3^1) + (1*3^2) = 11 decimal.

The number 11 decimal in the language ABCD would be 11 decimal = 31 base 4 = DB.

So, if the question was

Fo8 oF8 ABCD

then the answer would be DB.

Alternatively, the input

16 0123456789 0123456789ABCDEF

is merely saying to convert the decimal number 16 into hexadecimal.

Hope that helps!

Paul Smith

p...@pollyandpaul.co.uk



On Fri, Mar 16, 2012 at 5:28 PM, mandy mandeep...@gmail.com wrote:
 hi there...can anyone tell what is the actual logic behind alien
 number...
 here is the link to the problem...http://code.google.com/codejam/
 contest/32003/dashboard#s=p0
 so pls..some one tell me logic behind thisnot the program..
 thanks a lot

 --
 You received this message because you are subscribed to the Google Groups 
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-code?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Number_problem..

2012-03-16 Thread Paul Smith
Yes of course, my mistake.  11 = 2*4 + 3

On Friday, March 16, 2012, Trojan Horse sachinthetig...@gmail.com wrote:
 i think 11 decimal = 23 base 4 = CD

 On Mar 16, 11:21 pm, mandeep mandeep...@gmail.com wrote:
 hi paul... i got it upto 11 decimal...will you pls explain later part
 again...
 thanks a lot

 On Fri, Mar 16, 2012 at 11:34 PM, Paul Smith p...@pollyandpaul.co.uk
wrote:







  A language with N digits in it is using a Base N number system.

  Some 'languages' you are used to are decimal (0123456789), hexadecimal
  (0123456789abcdef) and binary (01)

  The language oF8 is essentially a Base 3 language.  Think of of8 as
being
  012.

  Therefore, the number Fo8 in this language is actually like the base 3
  number 102  which is 2 + (0*3^1) + (1*3^2) = 11 decimal.

  The number 11 decimal in the language ABCD would be 11 decimal = 31
base 4
  = DB.

  So, if the question was

  Fo8 oF8 ABCD

  then the answer would be DB.

  Alternatively, the input

  16 0123456789 0123456789ABCDEF

  is merely saying to convert the decimal number 16 into hexadecimal.

  Hope that helps!

  Paul Smith

  p...@pollyandpaul.co.uk

  On Fri, Mar 16, 2012 at 5:28 PM, mandy mandeep...@gmail.com wrote:
   hi there...can anyone tell what is the actual logic behind alien
   number...
   here is the link to the problem...http://code.google.com/codejam/
   contest/32003/dashboard#s=p0
   so pls..some one tell me logic behind thisnot the program..
   thanks a lot

   --
   You received this message because you are subscribed to the Google
  Groups Google Code Jam group.
   To post to this group, send email to google-code@googlegroups.com.
   To unsubscribe from this group, send email to
  google-code+unsubscr...@googlegroups.com.
   For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

  --
  You received this message because you are subscribed to the Google
Groups
  Google Code Jam group.
  To post to this group, send email to google-code@googlegroups.com.
  To unsubscribe from this group, send email to
  google-code+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

 --
 You received this message because you are subscribed to the Google Groups
Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
http://groups.google.com/group/google-code?hl=en.



-- 
Paul Smith

p...@pollyandpaul.co.uk

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Translations of Japan-2011 and Korea-2012 Problems

2012-03-15 Thread Paul Smith
I believe it should tell you in a green box at the top of the screen
if you are correct.

Paul Smith

p...@pollyandpaul.co.uk



On Thu, Mar 15, 2012 at 8:45 AM, bala subramanian
bala.busy...@gmail.com wrote:
 i was browse the output file and submit it for practice purpose but i
 couldnot get the result whether my output is correct or wrong.please anyone
 give idea to find out my output file is correct or not

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Translations of Japan-2011 and Korea-2012 Problems

2012-03-15 Thread Paul Smith
If you already submitted an answer when you were signed in, you should
see your submission score in the left hand side of the screen.

Otherwise:

Click solve C-small.
Download the input file.
Run your program on the new input file.
Upload the output file for that input that you just downloaded (in
practise mode it may well be the exact same file I don't know)
Look at the top of the screen for a green box that says Correct!.

Alternatively, you can google to see if the GCJ command line tools
still exist and work, I know I used them last year and they were fun
:)

Paul Smith

p...@pollyandpaul.co.uk

On Thu, Mar 15, 2012 at 9:33 AM, bala subramanian
bala.busy...@gmail.com wrote:
 http://code.google.com/codejam/contest/32016/dashboard#s=p2 here how can i
 find out my output file is right or wrong.if i give submit file i dont know
 anything whether my output file is right or wrong please give me a good idea

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Digest for google-code@googlegroups.com - 9 Messages in 1 Topic

2012-03-13 Thread Paul Smith
If I were you I would look at a practise problem from last year's Code
Jam to understand.

The input file is a text file that you download *when you have coded
your solution*.  You feed the input file in to your program, generate
some output, and upload the output back to the Code Jam servers to be
marked.

The format of the input file is given to you in the question.  The
expected format of the output file is also given to you in the
question.

Paul Smith

p...@pollyandpaul.co.uk



On Tue, Mar 13, 2012 at 3:41 AM, bala subramanian
bala.busy...@gmail.com wrote:
 please any one explain me what is input files and what is output files

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Digest for google-code@googlegroups.com - 9 Messages in 1 Topic

2012-03-13 Thread Paul Smith
No, based on the problem description you create the source code.  When
you think you have coded a correct solution, download an input, run it
through your program, and upload the output for checking.

Seriously, go read a problem and practise on it:
http://code.google.com/codejam/contest/351101/dashboard#s=p0

Paul Smith

p...@pollyandpaul.co.uk



On Tue, Mar 13, 2012 at 9:38 AM, bala subramanian
bala.busy...@gmail.com wrote:
 so based on input and output we have to create the source code right


 On Tue, Mar 13, 2012 at 3:02 PM, Paul Smith p...@pollyandpaul.co.uk wrote:

 If I were you I would look at a practise problem from last year's Code
 Jam to understand.

 The input file is a text file that you download *when you have coded
 your solution*.  You feed the input file in to your program, generate
 some output, and upload the output back to the Code Jam servers to be
 marked.

 The format of the input file is given to you in the question.  The
 expected format of the output file is also given to you in the
 question.

 Paul Smith

 p...@pollyandpaul.co.uk



 On Tue, Mar 13, 2012 at 3:41 AM, bala subramanian
 bala.busy...@gmail.com wrote:
  please any one explain me what is input files and what is output files
 
  --
  You received this message because you are subscribed to the Google
  Groups
  Google Code Jam group.
  To post to this group, send email to google-code@googlegroups.com.
  To unsubscribe from this group, send email to
  google-code+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/google-code?hl=en.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.


 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Digest for google-code@googlegroups.com - 9 Messages in 1 Topic

2012-03-12 Thread Paul Smith
Whichever c++ compiler you choose - your codejam program runs on your computer.

Paul Smith

p...@pollyandpaul.co.uk



On Sat, Mar 10, 2012 at 1:07 PM, bala subramanian
bala.busy...@gmail.com wrote:
 i want to know which c++  compiler will be used for codejam

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] bug

2012-02-08 Thread Paul Smith
This is the most succinct explanation of debugging I've ever seen.

I love you Luke!

Paul Smith

p...@pollyandpaul.co.uk


On Tue, Feb 7, 2012 at 7:28 PM, Luke Pebody luke.peb...@gmail.com wrote:

 There is no one hard and fast way to fix all bugs, unfortunately. If there
 were, the programmers life would be significantly easier. Essentially the
 method is:
 * understand what your code is doing
 * understand what your code SHOULD BE doing
 and spot the difference between the two.

 For a more detailed answer, I would need a more detailed question. Hope
 this was some help...


 On Tue, Feb 7, 2012 at 6:46 PM, Jugesh Sundram jugeshsund...@gmail.comwrote:

 hey try using something called as a de-bugger...its used to fix bugs !!
 :p :P


 On 8 February 2012 00:14, Satyajit Bhadange 
 satyajit.bhada...@gmail.comwrote:


 Take bug to bug doctordoctor will fix him...[?]

 you should be more specific about you problem..
 On Thu, Jan 26, 2012 at 12:56 PM, Harsh Vardhan harshpr...@gmail.comwrote:

 Can anyone tell me how to fix a bug???

 --
 You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.




 --

 Thanks  Regards,
 *Satyajit Bhadange
 Software Programmer*

 *Problems  Solutions* http://satyajit-algorithms.blogspot.com/

  --
 You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.




 --
 Jugesh Sundram
 (jugeshsund...@gmail.com)


  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.

32A.png

Re: [gcj] Re: Problem with increment in C

2011-08-16 Thread Paul Smith
I think you need to look up what it means for behaviour to be undefined.

I valid, working C compiler can print *anything* for the result of
k=++j + ++j + ++j;  Anything.  You cannot rely on observed behaviour.
The answer might change if you switch certain compiler optimisations
on, change compiler version, change compiler entirely.

The specification says that a C compiler can do anything here and
still be correct.  If you were writing unit tests for a compiler from
the specification, you would not write a unit test for this scenario,
because the behaviour is undefined - the specification does not define
an expected result.

Paul Smith

p...@pollyandpaul.co.uk



On Mon, Aug 15, 2011 at 7:37 PM, sumon sumon.sadhukh...@gmail.com wrote:


 On Aug 15, 10:25 pm, Paul Smith p...@pollyandpaul.co.uk wrote:
 The behaviour of your code is undefined.

 That means you should never write code in this manner - there's no
 need of multiple increment operations within the same expression.

 Paul Smith

 p...@pollyandpaul.co.uk







 On Sun, Aug 14, 2011 at 10:54 AM, sumon sumon.sadhukh...@gmail.com wrote:
  #includestdio.h
  void main()
  {
         int j=2,k;
         k=++j + ++j + ++j;
         printf(%d,k);

  }

  In GCC compiler why is it  giving 13??

  --
  You received this message because you are subscribed to the Google Groups 
  google-codejam group.
  To post to this group, send email to google-code@googlegroups.com.
  To unsubscribe from this group, send email to 
  google-code+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/google-code?hl=en.

 yes.. i know, but i am checking the sequence of execution in a
 expression!
 k=++j + (++j + ++j); it gives 15!

 --
 You received this message because you are subscribed to the Google Groups 
 google-codejam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-code?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
google-codejam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Problem with increment in C

2011-08-16 Thread Paul Smith
On Tue, Aug 16, 2011 at 1:03 AM, Amahdy mrjava.java...@gmail.com wrote:
 I don't agree with you +Paul, one of the essential learning curves IMHO, is
 to learn the compiler behavior and the deep language specifications and
 details.

I agree, and the 'deep language specification' here is that this
behaviour is undefined.

-- 
You received this message because you are subscribed to the Google Groups 
google-codejam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Very minor piece of suggestion to GCJ Team..

2011-05-30 Thread Paul Smith
Yes.  If the 24 hour qualification round did not exist then I would
possibly have issue with output flexibility (even then probably not,
this is a programming contest and programming is about delivering what
the customer wants right?)

Given the fact that every competitor has a 24 hour period in which to
respond and get the output right (as in qualification, penalty time
doesn't even matter) this is a no-brainer.  If you haven't learned how
to get the output right from the qualification round, then you've no
right to complain about it in Round 1.

Paul Smith

p...@pollyandpaul.co.uk



On Mon, May 30, 2011 at 6:13 PM, Lego Haryanto legoharya...@gmail.com wrote:
 Why do we want to reduce the the number of wrong submissions at
 qualifying rounds by new participants?  The 24 hour qual round has
 ample time for new participants to notice this mistake.  If anything,
 these participants will just have to learn to follow output spec the
 hard way and then most likely they won't repeat the same mistake
 again.

 To me, it's more advantageous for new competitors that way rather than
 relying on the mercy of the tester.

 But, that's just my opinion.

 On Monday, May 30, 2011, vettukal vettu...@gmail.com wrote:
 Its true that making GCJ tester code that will accommodate all
 differences and satisfy all participants is impossible to make. But
 evaluating English words(NO,IMPOSSIBLE,RED etc)  which are in output
 in a case insensitive manner is not that difficult to implement.
 It may reduce number of wrong submissions at Qualifying rounds by new
 participants.

 On May 30, 3:01 am, Lego Haryanto legoharya...@gmail.com wrote:
 I'm not sure why this can be a frustrating thing.  I would probably be
 frustrated if I had to work on the GCJ tester code that tries to
 accomodate all those differences, yet will never be able to satisfy
 all circumstances.  From a few posts, it seems that GCJ system is
 already nice enough to point out possible errors, but it certainly is
 not worthwhile to do much more than that.

 The input/output specification is already very clear IMO and following
 them as verbatim as we can be is our very first task, IMO.









 On Monday, May 23, 2011, vettukal vettu...@gmail.com wrote:
  In the output

  Case #45: NO
  is not equal to
  Case #45:No

  Case #45:
  Impossible

  is not equal to

  Case #45: Impossible

  This can lead to a very frustrating effort to debug the program when
  real bug is something this trivial.

  The timer which tells how much time is left at the top of the page is
  small and not very visible. Please make it bigger and bolder. It would
  be nice if u add a timer at the bottom of the page coz most of the
  times we are seeing the sample input and output section of the page.

  And as suggested earlier please make a link to our nickname which
  shows our email link. May be next time every contestant can have a
  (optional) profile page linked to his nickname. It may have his email
  id, his blog address (whatever he wants to put on that page.)

  --
  You received this message because you are subscribed to the Google Groups 
  google-codejam group.
  To post to this group, send email to google-code@googlegroups.com.
  To unsubscribe from this group, send email to 
  google-code+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/google-code?hl=en.

 --
 Fear of the LORD is the beginning of knowledge (Proverbs 1:7)

 --
 You received this message because you are subscribed to the Google Groups 
 google-codejam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-code?hl=en.



 --
 Fear of the LORD is the beginning of knowledge (Proverbs 1:7)

 --
 You received this message because you are subscribed to the Google Groups 
 google-codejam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-code?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
google-codejam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Very minor piece of suggestion to GCJ Team..

2011-05-28 Thread Paul Smith
Yes, that is the point - the original poster asked if there was a
difference between Case #1:NO and Case #1: NO.  The answer is that
there is and that the site tells you this if you do it wrong - you
won't ever make this mistake on a large input because you will have
uploaded a correct small input first.

Paul Smith

p...@pollyandpaul.co.uk



On Sat, May 28, 2011 at 1:25 AM, Julien Dubois
julien.dubois...@gmail.com wrote:
 The answer is in your problem: there must be a space after Case #1:
 A correct output is Case #1: NO


 2011/5/28 Vexorian vexor...@gmail.com

 Forgot to mention, try uploading a file that says Case #1:NO in the
 practice room. The site will reject the solution saying that the file
 must start with Case #1: 



 On May 27, 8:16 pm, Vexorian vexor...@gmail.com wrote:
  For results with decimals it is easy enough to see the sample outputs
  that the format uses . and there is always a note about acceptable
  relative/absolute error (From which you can conclude not only that 0.5
  is the same as 0.50 but also that 0.5 is the same as 0.501).
 
  On May 24, 1:52 am, ulzha uldis.barb...@gmail.com wrote:
 
 
 
 
 
 
 
   Have you actually read the Terms/FAQ? Unix, Mac and Windows endlines
   are
   all acceptable ways of ending lines.
 
   What browser are you using? I have no problem copying the sample
   input.

 --
 You received this message because you are subscribed to the Google Groups
 google-codejam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.


 --
 You received this message because you are subscribed to the Google Groups
 google-codejam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
google-codejam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Goro sort again

2011-05-14 Thread Paul Smith
Your confusing the notation.  In this e-mail E[X] represented the
expected number of numbers that land in the correct position after X
hits.

In the previous e-mail, E[X] represented the number of hits necessary
to sort X unsorted numbers.

So the difference between the 2 e-mails is that the E[X] had a
different meaning in each.

But in both cases he was correct.

Imagine a game where you have equal chances of winning and losing.
When you win I give you £2, when I win nothing happens.  The
expectation of each game is then that I will give you £1, even though
that outcome is impossible in a single game.

On Saturday, May 14, 2011, Eagle khirwad...@gmail.com wrote:
 @Pedro,
  Are you contradicting yourself or the contest analysis, in the
 following statement?
 E[X] = p(X=0) * 0 + p(X=2) * 2 = 0.5 * 0 + 0.5 * 2 = 1
 Until now, you were saying E[2] = 2. Now, you are saying it is 1.
 Check your last mail to me, you have given following-
 E[n=3] = 1 + (1/6 * 0 + 0 * E[n=1] + 1/2 * E[n=2] + 1/3 * E[n=3])  = 1 + 
 (1/2 * E[n=2] + 1/3 * E[n=3])
 The dimension (units) on the LHS  RHS of the equation are not
 matching. I have read the links about
 expected value that you have given. The problem is, I am also having
 the same feeling (please do not
 get offended) that you are not using the concept properly.
 Thanks again for your patience to continue the discussion.

 Eagle



 On May 14, 8:27 pm, Pedro Osório mebm.pedroso...@gmail.com wrote:
 You are saying that it is impossible to put exactly one element into the
 right position when N=2, right? I agree, obviously, we have 2 elements in
 the right position, or 0 elements in the right position.

 What you don't seem to understand is that this doesn't contradict the
 statement The expected number of elements that are put into position is
 exactly 1. The reason why you don't understand it, is because you don't
 understand the concept of expected value (I won't link it again, since you
 refuse to read and try to understand what it means).

 What baffles me is that for the case N=2, it is trivial to understand that,
 even though having exactly one element in the right position is
 impossible, the expected value of elements put into the right position is
 exactly 1:

 Initial: 2 1

 Possible outcomes:
 1 2 - 0.5 probability - 2 elements in the right position
 2 1 - 0.5 probability - 0 elements in the right position

 X - elements that go into the right position after one hit for the array [2
 1]

 E[X] = sum(p(X=x) * x) = p(X=0) * 0 + p(X=1) * 1 + p(X=2) * 2 + ... =

 All elements with p(X=x)=0 will be eliminated so only x=0 and x=2 matter (as
 you have repeatedly said):

 E[X] = p(X=0) * 0 + p(X=2) * 2 = 0.5 * 0 + 0.5 * 2 = 1

 Do you understand now that p(X=E[X]) can be 0?

 --
 You received this message because you are subscribed to the Google Groups 
 google-codejam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-code?hl=en.



-- 
Paul Smith

p...@pollyandpaul.co.uk

-- 
You received this message because you are subscribed to the Google Groups 
google-codejam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Re: Problem D, Qualification round

2011-05-09 Thread Paul Smith
This is incorrect.  The expectation for sorting 3 numbers is 3 hits, not 4.

The expected value of an event is the value of each outcome multiplied
by the probability of each outcome, all totalled.

With 3 unsorted numbers you have:

1/6 chance that 3 numbers will become correct - EV = 0.5
1/2 chance that 1 numbers will become correct - EV = 0.5
1/3 chance that no numbers will become correct - EV = 0

So the total expectation for one hit is that one number will become
sorted.  Therefore you expect to sort all 3 numbers within 3 hits.

Paul Smith

p...@pollyandpaul.co.uk



On Mon, May 9, 2011 at 3:03 PM, Eagle khirwad...@gmail.com wrote:
     As I understand the probability, it goes something like this- If
 you toss a coin 100 times, it is 'expected' (actual result may be
 different) that 50 times you will get 'Heads'  50 times 'Tails'. In
 present problem also, you have to answer the 'expected' number of hits
 by Goro to sort the numbers. This is also confirmed by the explanation
 given for a case at the end of the problem statement D.

     If three numbers are to be sorted, then the 'chance' or
 probability of all three falling in correct place is 1/6. This means
 that on an 'average', Goro will have to hit the table 6 times to sort
 those numbers. But, there is a better strategy, and this number of
 hits can be reduced. It goes like this-
     The chance/probability of getting exactly one number in correct
 position and the remaining two in wrong positions is 3/6 or 1/2. So,
 on an 'average' if Goro makes two hits, he can 'expect' that one
 number will be sorted. The hit counter is 2 by now. After this, he
 holds the sorted number, and his requirement is to sort the remaining
 two numbers. For these two numbers, as explained in the problem
 statement itself, the probability of sorting is 1/2, and on 'average'
 two hits would be required. The hit counter now becomes 2 + 2 = 4.
 Mathematically, P(first event) = 1/2 and P(second event) = 1/2; so,
 combined probability is 1/2 x 1/2 = 1/4, and reciprocal of that is 4,
 which is average hits  (the required answer).

     Goro can use one more strategy, which again gives same answer. If
 [3, 1, 2] are to be sorted, Goro will hold '3' and make on an
 'average' two hits to bring '2' in correct position. Then, he would
 release '3', hold the sorted '2', and make two more 'average' hits to
 bring '1'  '3' in their respective correct positions.

     @Bharath and @Pedro Osorio, I hope my explanation is not
 frustrating to understand. If we come from different backgrounds, it
 is normal that there is communication gap.

 Eagle


 On May 9, 12:07 pm, Bharath Raghavendran rbharat...@gmail.com wrote:
 Probability to get all 3 right = 1/6
 Probability to get only 1 right = 3/6
 Probability to get none right = 2/6

 If you get all 3 right, then it took only 1 try
 If you get 1 right, then you have 2 left .. hope you agree that on an
 avg, it will take 2 more tries [E(2) = 2] on an avg to solve this.
 Hence, total 3 tries
 If you get none right, on an avg, you will take E(3) more tries to
 solve this in an avg. So total tries = 1+E(3).

 So, E(3) = (1/6)*1 + (3/6)*3 + (2/6)*(1+E(3))
   = 1/6 + 9/6 + 2/6 + 2/6*E(3)

 4/6 E(3) = 12/6
 E(3) = 12/4 = 3

 On 9 May 2011 12:13, Eagle khirwad...@gmail.com wrote:

  @Bharath, No it should require 6 hits in your case, if you extend the
  following logic-

  For the three unsorted numbers 3 1 2, the sample set of arrangements
  is-

     1  2  3
     1  3  2
     2  1  3
     2  3  1  -   Not even one in correct position
     3  1  2  -   Not even one in correct position
     3  2  1
  The probability of at least one number being at its sorted position is
  2/3, while the probability of not getting even one number in its
  correct position is 1/3. So, how come, all of a sudden, the
  probability of getting at least one number in its correct position is
  becoming 1.0? If at all, average hits are to be calculated (being
  average, it can be non-integer real number), then it would be
  reciprocal of 2/3, that is, 3/2, that is 1.5 and not 1.
  Also, while calculating total probability of dependent events, you
  MULTIPLY the individual probabilities, and NOT add them.
  In the present example, the P(exactly one element in correct position)
  is 3/6 = 1/2. After that event is realized, Goro will hold that
  number, and only two unsorted numbers are there. This time, the
  P(correct sorting) is 1/2. So, the combined probability is 1/2 x 1/2 =
  1/4. Thus, total 4 hits would be required on average.
  (If my analysis is correct, I will have the life-time joy of catching
  Google employees making logical error! Ha ha ha!!)

  Eagle

  On May 9, 7:45 am, Bharath Raghavendran rbharat...@gmail.com wrote:
  The 4 steps for sorting are not definite. Its just that Goro has to
  follow the following steps :
  * Hold down any element that is in its place
  * Bang table to re-arrange other elements.

  Repeat this step till all elements are sorted

Re: [gcj] Re: Solution for Goro sort?

2011-05-09 Thread Paul Smith
Let x = E[n=3].

We have an equation of the form x = 2 + x/3.

Solve for x.

Paul Smith

p...@pollyandpaul.co.uk


On Mon, May 9, 2011 at 3:10 PM, Eagle khirwad...@gmail.com wrote:
 @Pedro,

      In your last two steps,

 E[n=3] = 2 + 1/3 * E[n=3]

 E[n=3] = 3

 there is something wrong. How are you eliminating E[n=3] on the right
 hand side of the equation?

 Eagle



 On May 9, 12:28 am, Pedro Osório mebm.pedroso...@gmail.com wrote:
 Hi Ricardo,

 For your example regarding 3, you have the following possibilities:

 1 2 3 - perfect
 1 3 2 - one correct
 2 1 3 - one correct
 2 3 1 - wrong
 3 1 2 - wrong
 3 2 1 - one correct

 As you can see, if goro hits without holding anything, 1/6 of the time
 it will be sorted, 1/2 of the time there will be 2 out of place and
 1/3 of the time there will be 3 out of place.

 This means that:

 E[n=3] = 1 + (1/6 * 0  + 1/2 * E[n=2] + 1/3 * E[n=3])

 As you have shown, E[n=2] = 2, so:

 E[n=3] = 2 + 1/3 * E[n=3]

 E[n=3] = 3

 On May 8, 7:57 pm, werneckpaiva werneck.pa...@gmail.com wrote:

  I read too and it doesn't make any sense for me.

  I understand that this is a geometric distribution where if P(X)=p so
  E(X)=1/p. So, if you have 2 numbers unsorted and Goro hits the table,
  there is 0.5% chance to stay in the same position and 0.5% chance to
  swap positions. But, if you have 3 unsorted elements, there are 6
  different permutations, so, P(X)=1/6 and the E(X)=6. My solution is
  hold 1 number, swap the other 2; hold the sorted element and swap the
  other 2 remaining, so 2 + 2 = 4 hits

  3 1 2
  1 3 2
  1 2 3

  But this doesn't seem to be the correct answer. The developers
  solutions say that for 3 unsorted numbers needs only 3 hits. Anyone
  knows how to explain that?

  Regards,

  Ricardo

  On May 7, 8:24 pm, SwiftCoder viv...@gmail.com wrote:

   I looked at some of the solutions, as per that umber of hits are same
   as the count of numbers which are not at their correct sorted
   position. Is that so?

 --
 You received this message because you are subscribed to the Google Groups 
 google-codejam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-code?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
google-codejam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Problem C output !! Candy problem

2011-05-09 Thread Paul Smith
Everyone gets different inputs I think, so you probably need to post
the input as well as the output.

In fact the easiest thing to do is download someone else's answer, run
their answer, run your answer, and compare for differences.

Paul Smith

p...@pollyandpaul.co.uk



On Mon, May 9, 2011 at 3:16 PM, robin john rj81in...@gmail.com wrote:
 Hello
 Can anybody kindly upload prob C output or let me know how my output is
 wrong ?
 Am sure my logic is right. [Comparing xor's of the 2 divided group such that
 they are same and printing highest such possible sum as value]
 Reg, robin.

 On Sun, May 8, 2011 at 12:50 PM, vivek dhiman vivek4dhi...@gmail.com
 wrote:

 Lucky!

 You are right.

 if xor of two lists is same. (say xor1 = xo2)

 So the exor of these two wil be 0  (xor (xor1,xor2) = 0)
 Or in other words lists can be divided if the xor of all the elements is
 zero.

 :)



 On Sun, May 8, 2011 at 8:17 AM, keshav agarwal keshav...@gmail.com
 wrote:

 please tell me of my logic was correct or i just got lucky to get it
 correct

 if xor to a list of nos. is zero only then the division is possible
 in this case patrick can be given the one candy with lowest value while
 sean keeps the rest

 if  xor(n nos.)=0
 then   (nth no.) xor (xor of n-1 nos.)=0

 so patrick gets the nth candy and sean keeps the rest

 --
 You received this message because you are subscribed to the Google Groups
 google-codejam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.



 --
 Regards
 Vivek Dhiman

 --
 You received this message because you are subscribed to the Google Groups
 google-codejam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

 --
 You received this message because you are subscribed to the Google Groups
 google-codejam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
google-codejam group.
To post to this group, send email to google-code@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] T-shirt designs for Code Jam 2011.

2010-12-16 Thread Paul Smith
I would wear the Tic Tac Toe analysis from a recent comic :)

On Thursday, December 16, 2010, Shrey banga.sh...@gmail.com wrote:
 Some ideas to throw around:

 1. Have Randall Munroe design something. I don't think xkcd has
 covered programming contests yet.
 2. An upside down programming contest cheat-sheet. Has been done
 before, useful nevertheless.
 3. Something like Among the top 500 results on Google search for kick-
 ass programmer

 On Dec 16, 5:55 am, Christopher Chen tikitikireve...@gmail.com
 wrote:
 With these sorts of things I'm fond of designs that look interesting
 even to people who don't know what the shirt is about. Like how some
 conference shirts just list a name, date and logo in Helvetica while
 others do interesting artistic things in theme and feel much more
 wearable as a result.

 So try for something unnecessarily pretty! Well-picked data
 visualisation always looks really good and you have plenty of stuff to
 work with just from the competitors' nationalities / programming
 languages / progression rates alone.

 Or do a text-as-art piece naming all the different mathematical and
 algorithmic ideas that have featured in solutions to past GCJ rounds
 (like VFIX's suggestion but you don't have to aim for a giant 'GCJ' at
 the end, the shape of a shiny hyperbolic polyhedron would do just as
 well :D).

 Or a collage of the flavourtext/stories for 2011's various problems;
 there'd be enough material that you could pull off uniform-visual-
 noise quite well and then leave some space in one part for a strongly
 contrasting bold message/logo/etc.

 If you insist on it saying 'Google Code Jam 2011' somewhere on the
 shirt (which, well, fair enough), at least don't feel obligated to put
 it in a giant font where it steals all the focus from the rest of the
 design. :)

 On Dec 15, 3:59 pm, Igor Naverniouk abedn...@google.com wrote:







  Greetings!

  We are playing with a few t-shirt designs for next year, and we would love
  to hear (and see) your ideas.

  What would you like to see on a Google Code Jam t-shirt?

  Send your ideas to this group, if you want to hear comments from other
  contestants, or send them to us at code...@google.com if you want to keep
  them secret and create a surprise for everyone else.

  igor
  -- Google Code Jam team

 --
 You received this message because you are subscribed to the Google Groups 
 google-codejam group.
 To post to this group, send email to google-c...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-code?hl=en.



-- 
Paul Smith

p...@pollyandpaul.co.uk

-- 
You received this message because you are subscribed to the Google Groups 
google-codejam group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] T-shirt designs for Code Jam 2011.

2010-12-15 Thread Paul Smith
Yeah, because that won't blow Google's entire codejam budget...

On Wednesday, December 15, 2010, Shrey banga.sh...@gmail.com wrote:
 +1 for Pakku's idea.

 On Dec 15, 1:17 pm, Pakku lingada...@gmail.com wrote:
 I guess top 500 people get the code jam T Shitrs. So I suggest that we
 have a collage of all 500 code jammers in the T Shirt. But all 500 T
 shirts should be unique with his photo being the stand out of all the
 jammers and then may be add his rank as well. :-)

 -Pakku







 On Wed, Dec 15, 2010 at 12:54 PM, Amit Agarwal lifea...@gmail.com wrote:
  Sorry for going off-topic. I want to know when a code-jam participant
  becomes eligible for getting a code-jam t-shirt?

  -Regards
  Amit Agarwal

  On Wed, Dec 15, 2010 at 12:41 PM, Sarma Tangirala
  tvssarma.ome...@gmail.com wrote:

  Haha! How about an awesome quote from someone like Raj Reddy or Asimov on
  the back?

  Sent from my BlackBerry

  
  From: Gmail g201...@gmail.com
  Sender: google-code@googlegroups.com
  Date: Wed, 15 Dec 2010 14:59:07 +0800
  To: google-code@googlegroups.comgoogle-code@googlegroups.com
  ReplyTo: google-code@googlegroups.com
  Subject: Re: [gcj] T-shirt designs for Code Jam 2011.
  A bottle of jam?

  在 2010-12-15,12:59,Igor Naverniouk abedn...@google.com 写到:

  Greetings!
  We are playing with a few t-shirt designs for next year, and we would love
  to hear (and see) your ideas.
  What would you like to see on a Google Code Jam t-shirt?
  Send your ideas to this group, if you want to hear comments from other
  contestants, or send them to us at code...@google.com if you want to keep
  them secret and create a surprise for everyone else.
  igor
  -- Google Code Jam team

  --
  You received this message because you are subscribed to the Google Groups
  google-codejam group.
  To post to this group, send email to google-c...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-code+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

  --
  You received this message because you are subscribed to the Google Groups
  google-codejam group.
  To post to this group, send email to google-c...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-code+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

  --
  You received this message because you are subscribed to the Google Groups
  google-codejam group.
  To post to this group, send email to google-c...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-code+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

  --
  You received this message because you are subscribed to the Google Groups
  google-codejam group.
  To post to this group, send email to google-c...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-code+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.

 --
 You received this message because you are subscribed to the Google Groups 
 google-codejam group.
 To post to this group, send email to google-c...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-code?hl=en.



-- 
Paul Smith

p...@pollyandpaul.co.uk

-- 
You received this message because you are subscribed to the Google Groups 
google-codejam group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



Re: [gcj] Someone please explain me the solution for this input

2010-08-10 Thread Paul Smith
At step 7, instead of popping, push a 2nd A.

On Tuesday, August 10, 2010, Bragadeesh Jegannathan
bragadee...@gmail.com wrote:
 Hi,
 I was trying to solve the Letter Stamper Problem that was asked in
 codejam finals round.
 I took this sample input : ABCACB.
 I wrote a program and ran it and the output I got was 16 which is
 contradictory from the output that the finalists got which was 14. Can
 someone kindly explain the sequence for this. This is the
 understanding and assumption of my sequence. Correct me if I am wrong.

 Operation               Printed so far          Stack
 0. -                    -                               -
 1. Push A               -                               A
 2. Print                A                               A
 3. Push B               A                               AB
 4. Print                AB                              AB
 5. Push C               AB                              ABC
 6. Print                ABC                             ABC
 7. Pop          ABC                             AB
 8. Pop          ABC                             A
 9. Print                ABCA                    A
 10. Push                ABCAC                   AC
 11. Print               ABCAC                   AC
 12. Push                ABCAC                   ACB
 13. Print               ABCACB                  ACB
 14. Pop         ABCAC                   AC
 15. Pop         ABCAC                   A
 16. Pop         ABCAC                   -

 I looked many times and 16 is the answer I get. But I ran the same
 input for the finalists's solution, but I got 14. Kindly correct me
 where I have gone wrong.

 Thanks,
 Bragaadeesh.

 --
 You received this message because you are subscribed to the Google Groups 
 google-codejam group.
 To post to this group, send email to google-c...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-code?hl=en.



-- 
Paul Smith

p...@pollyandpaul.co.uk

-- 
You received this message because you are subscribed to the Google Groups 
google-codejam group.
To post to this group, send email to google-c...@googlegroups.com.
To unsubscribe from this group, send email to 
google-code+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.



  1   2   >