[gcj] Re: ESAb ATAd problem was working in local.

2020-04-10 Thread Matt Fenlon
The name of your class should be Solution rather than Database. Check out the Coding section in the FAQ here: https://codingcompetitions.withgoogle.com/codejam/faq On Tuesday, April 7, 2020 at 11:55:21 AM UTC-4, Aditya Gupta wrote: > > Following is my solution to it. I tested it extensively and

Re: [gcj] Debugging Interactive Problems

2020-04-10 Thread mattfenlon2
The interactive runner links stdin and stdout but does not touch stderr. I had success printing to stderr throughout your program to print useful, readable information. > On Apr 10, 2020, at 6:55 PM, Lev Raizman wrote: > >  > Hello all, > > I'm looking for a method for debugging my

[gcj] Debugging Interactive Problems

2020-04-10 Thread Lev Raizman
Hello all, I'm looking for a method for debugging my solutions to interactive problems using a debugger. In particular, I wan't to be able to set breakpoints in my C++ solution, and have them trigger when it reaches that point. The problem arises because I call the interactive runner, and pass

Re: [gcj] Re: Parenting Problem Returns more creative solution?

2020-04-10 Thread Nate Bauernfeind
The approach of greedy assigning out-of-order fails in this case: J1: 0 2 (Assigns to C) J2: 1 4 (Assigns to J) J3: 8 10 (Assigns to C) J4: 3 10 (Now Impossible because C is busy 8-10, and J is busy 3-4.) However swapping J1 and J2 so that J is busy 0-2 and C is busy 1-4, now J is free to do

[gcj] Re: [Python3] QR 2020 - Parenting Partnering Returns

2020-04-10 Thread porker2008
> Apparently "Case #3: CJJCC" is not a valid alternative for "Case #3: > JCCJJ". > I think CJJCC should also be accepted. -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving emails from it,

[gcj] Re: Java: Parenting Partnering Returns WA

2020-04-10 Thread porker2008
Your solution simply does not work. You need to process the activities based on their start time (or end time) instead of the order given in the input. -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop

[gcj] Re: [Python3] QR 2020 - Parenting Partnering Returns

2020-04-10 Thread eegee
Turns out that it *was not* a Runtime Error. Thanks to @porker2008 I was able to fix my answer by first sorting the activities. Apparently "Case #3: CJJCC" is not a valid alternative for "Case #3: JCCJJ". On Tuesday, 7 April 2020 02:44:08 UTC+2, eegee wrote: > > I keep getting a RE (Runtime

[gcj] Re: Vestigium C++ code giving Sample Failed:WA error

2020-04-10 Thread porker2008
Not sure why you need to call *cin.sync()* in your code. You shouldn't do that because everything you haven't read from *STDIN* will be lost at that point. -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and

[gcj] Re: Problem with 'printf' in ESAb ATAd (Interactive problem)

2020-04-10 Thread porker2008
How do interactive problems work? Just as in non-interactive problems, you will receive input from stdin and print output to stdout. Our system will do the job of directing your output stream to the judge's input stream, and pointing the judge's output stream to your input stream. However,

Re: [gcj] Re: Parenting Partnering Returns

2020-04-10 Thread Edward Lockhart
The greedy approach you're using doesn't handle all cases, eg 0 1 5 6 0 2 1 6 On Fri, 10 Apr 2020, 16:55 rajeswara reddy, wrote: > > Can anyone find what's wrong in my program for parenting partners returns > problem > > z=int(input()) > for zz in range(1,z+1): > n=int(input()) > l=[]

[gcj] Link to Commented Solutions Archive

2020-04-10 Thread Matt Fenlon
I am maintaining an archive of C++ solutions for 2020 problems. Feel free to check out the link below if you have questions regarding a problem. Even if you are not using C++, reading through the comments may help you solve the problem in your preferred language. As time permits, I will be

[gcj] Re: Parenting Partnering Returns

2020-04-10 Thread rajeswara reddy
Can anyone find what's wrong in my program for parenting partners returns problem z=int(input()) for zz in range(1,z+1): n=int(input()) l=[] out='C' for i in range(n): t=list(map(int,input().split())) l.append(t) c=set(range(l[0][0],l[0][1])) j=set()

[gcj] Re: Parenting Partnering Returns

2020-04-10 Thread Pronoy Mandal
I will explain the algorithm step wise if someone wants to know the same and at the same tome tell about the edge cases one can miss. Following is the logic 1. Sort the input in ascending order of start times 2. Assign (0,0) as the end time of jobs allocated to Cameron and Jamie. They are o

[gcj] Re: Parenting Partnering Returns

2020-04-10 Thread Saurabh Gattani
C++ solution passing all test cases with detailed explanation here:- https://www.golibrary.co/google-codejam-2020-parenting-partnering-returns-solution/ Thanks, Saurabh On Tuesday, 7 April 2020 10:50:28 UTC+10, Martin Seeler wrote: > > I'm asking to keep my sanity: Did anyone solve this

[gcj] Java: Parenting Partnering Returns WA

2020-04-10 Thread Nuria Ruiz
Hi, I'm trying to resolve Parenting Partnering Returns, but I'm getting WA. The problem is that for me the results are OK. My idea to solve that is to create a class named Activity and override the method equals, in the method equals I will check if the activity A intersects with activity B.

[gcj] ESAb ATAd [Python Solved]

2020-04-10 Thread Joseandres Hinojoza
Hello everybody, I would like to share my solution with Python 3. Its pretty long code, but it passes the three cases. I dont know about you, but this problem was really challenging and took a lot of tries to get it right. Basically first I check 2 pairs that Bits[x] == Bits[B-x] and

[gcj] Re: C++, Parenting Partnering Returns, Qualification Round 2020. Help to find out the cause for fault!!!

2020-04-10 Thread Saurabh Gattani
Solution with explanation for parenting partnering here:- https://www.golibrary.co/google-codejam-2020-parenting-partnering-returns-solution/?fbclid=IwAR2SJfghu5n0yU1eTueA8SjGZ9Gcc5yIGj6i-pLCV5l-DJR_YJIUuwQBam8 On Tuesday, 7 April 2020 10:45:39 UTC+10, Olena Lizina wrote: > > Hi all, > > I

[gcj] Problem with 'printf' in ESAb ATAd (Interactive problem)

2020-04-10 Thread Sairam Gaddam
Hi everyone, I have some issue when testing the interactive problem ESAb ATAd with the provided testing tool. I coded my solution in C and the testing tool doesn't run because of 'printf'. It waits in infinite loop. I ran my code separately and it works just fine. To investigate this issue, I

[gcj] Re: Vestigium C++ code giving Sample Failed:WA error

2020-04-10 Thread Saimohan Kuncham
Here is the code in C++. Can you please clarify - When testing on local machine is it sufficient to enter inputs from keyboard. Or should the program run from redirected standard input and output. My program works when I enter input manually from keyboard. I am using cin for reading No of

[gcj] How to use Hall's Marriage Theorem to prove in Indicium

2020-04-10 Thread James Prudd
According to the analysis of Indicium problem in https://codingcompetitions.withgoogle.com/codejam/round/0019fd27/00209aa0 I wonder how to prove it. Can someone here write a detailed proof please? In particular, why greedily starting from the rows with B and C on their diagonal

[gcj] Re: kick start 2020 round A: allocation problem Sample Failed: RE

2020-04-10 Thread porker2008
Your code does not run on my local dev machine To be more specific, the following line throw a runtime exception *A.sort()* The exception message was like *AttributeError: 'map' object has no attribute 'sort'* To fix this, you simply convert A to a list. See my code below. *def solution():* *