Re: [gcj] Alternative "creative" solutions to "Indicium"

2020-04-06 Thread Joseph DeVincentis
I solved Indicium pretty slowly (17 hours after the other problems...) when I had a brainstorm. It is a lot like what you suggested, but your solution is not complete. (a) if k is a multiple of n, a circulant square with k/n on the diagonal works. (b) When k=n+2, or k=n^2-2, or n=4 and k=10, find

Re: [gcj] Parenting Partnering Returns

2020-04-06 Thread Denys Halachian
I hope its help, from functools import reduce class Solver(object): def __init__(self): super().__init__() def find_distribution(self, intervals): _intervals = list(intervals) intervals.sort(key=lambda x: x[0]) mp = {} J = 0 C = 0

[gcj] Re: Python: Code works on local machine but it says "Wrong Answer"

2020-04-06 Thread Дмитрий Кузьминов
Exactly the same problem. That is because the system supports Python 3.5, but f-strings require Python 3.6 or higher. On Monday, April 6, 2020 at 8:51:49 PM UTC-4, Tornax wrote: > > Hello! At this moment I'm trying to solve the "Vetigium"-Problem in the > qualification round 2020. > I'm

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

2020-04-06 Thread fayyaz lodhi
So a couple of quick things without debugging your entire code since i was stuck on this for a while in a similar situation and was able to figure out the problems and pass eventually. 1) After sorting activities by start time, your solution should still be written maintaining the original

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

2020-04-06 Thread Leandro Coutinho
Does your code print the answer in the original order? On Monday, April 6, 2020 at 9:45:39 PM UTC-3, Olena Lizina wrote: > > Hi all, > > I didn't pass the Qualification Round 2020 because stuck with Parenting > Partnering Returns. > My solution passes the Sample test cases, but failed on the

[gcj] Analysis of Indicium (Codejam 2020 Qualification Round)

2020-04-06 Thread Maverick
I am unclear on the analysis of *Testset-2* of Indicium (Problem-5, Qualification Round, Codejam 2020). It is all clear up until the second last paragraph, where we construct a Latin square matrix out

[gcj] INDICIUM PROBLEM

2020-04-06 Thread Chandu Chegu
Can anyone explain to me? how to solve the INDICIUM problems. It's hard to understand the analysis. I solved that problem using backtracking which helps me to get 7 pts. When my code runs through private test case it exceeds the given time limit. -- You received this message because you are

[gcj] share your approach for Indicium

2020-04-06 Thread Deepansh Parmani
Google Code jam 2020 Qualification round, fifth question Indicium was a problem that had expected different constructive approaches Lets' share all different approaches -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from

[gcj] Parenting Partner Returns Solution did not work, what is the problem?

2020-04-06 Thread Reeba Aslam
Here is my solution to the problem. It works on sample test case but not on actual ones. The judge returns WA with test set skipped error. Please point out a mistake if you can find. I can't find what I missed even after reading the analysis. def solve(actv, N): out = '' owner = {}

[gcj] Parenting Partnering Returns from qualification round 2020

2020-04-06 Thread Kirill Lykov
I had the following idea: 1) Sort intervals in the lexicographical order 2) Mark all intervals as J 3) Mark 0th interval as C, call it prev 4) For all intervals 5) if prev interval marked as C is not intersecting the current interval, mark current interval as C, update prev 6) Check that

[gcj] ESAb ATAd Time Limit Exceeded (Qualification Round 2020)

2020-04-06 Thread Mykhailo Bichurin
Could anyone tell me please what could cause TLE error in "ESAb ATAd" problem? If we talk about regular problem of having a slow algorithm, this couldn't be the thing because my program takes *O(T * B)* which is *O(10^4)* on the hidden test set. Though the code doesn't pass neither Visible test

[gcj] Parenting Partnering

2020-04-06 Thread Thusitha Thilina Dayaratne
Hi All, This is the solution that I come up with for the Parenting Partnering task. no_of_tests = int(input()) for i in range(no_of_tests): schedule = '' c_busy = [0] * 1441 j_busy = [0] * 1441 n_tasks = int(input()) tasks = [] for count in range(n_tasks):

[gcj] Parenting Partnering WA, please help

2020-04-06 Thread Aditya Vikram Jain
I'm not able to make out why my code below fails. Any help would be most welcome #include #include #include #include #include using namespace std; int main(){ int T; cin>>T; for(int tc = 1;tc<=T;tc++){ int N; cin >> N; vector,int > > vData; pair

[gcj] Parenting Partners in Code Jam Qualifying Round, Java code gives WA

2020-04-06 Thread Brandon Yang
Unfortunately, I'm not sure what's the issue with my code for this problem. I'm just a newbie who competed in Code Jam for the first time, even though I do have some experience with Java. For your reference, here's my code: //Template for Solution submissions import java.util.*; import

[gcj] QR 2020 - Parenting Partnering Returns

2020-04-06 Thread AC
I keep getting WA for this. Not sure if I misunderstood or missed an edge case. Code in Python3. It was clearing sample code. def is_overlap(num1, num2): firstNum, lastNum = None,None if num1[0] < num2[0]: firstNum = num1 lastNum = num2 else: firstNum = num2 lastNum = num1 if lastNum[0]

[gcj] Parenting Partnering Returns: WA

2020-04-06 Thread Rohit Sutradhar
Hi I am getting a wrong answer verdict but I don't know why. I read the analysis and my code, as far as I understood, uses the same logic. Here's my code: #include "bits/stdc++.h" using namespace std; vector ind; int search(vector> v, int l, int r, int key) { for(int i=l;i<=r;i++) {

[gcj] WA when submit attempt

2020-04-06 Thread Nuria Ruiz
Dear all, Yesterday I was trying to send my resolution for Parenting Partnering Returns but as a result, I obtained WA error. I don't know what's the meaning of that error, in my test the result is OK. And it is failing the first test. Here the code, import java.io.*; import java.util.*;

[gcj] Parenting Partnering Returns - Solution in C++

2020-04-06 Thread Elyasin Shaladi
I would like to ask for some help for the recent Code Jam problem Parenting Partnering Returns. I wrote my solution in C++11. My solution returns Sample Failed: WA - though I cannot figure out an example test case that makes my code fail. My solution is close to what was described in the

[gcj] Solution giving WA for test cases Nesting Depth

2020-04-06 Thread anonymous
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Collections; class Solution { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new

[gcj] ANY CORNER CASES FOR Parenting problem

2020-04-06 Thread ACTECH
according to my logic I got my code correct can u provide any corner cases for the problem? as though my code is giving correct answer for sample test case its d=showing final verdict as WA -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group.

[gcj] Parenting Partnering Returns Question

2020-04-06 Thread Dhruva Sagar
The analysis is out, and I am quoting this from the analysis : An activity with start time s1 and end time t1 overlaps with another > activity with start time s2 and end time t2 if the time intersection is > not empty (i.e., max(s1, s2) > min(t1, t2)). > The same provided in the problem has

Re: [gcj] Sample Failed: WA

2020-04-06 Thread Srikant Jena
On Sunday, March 24, 2019 at 11:06:29 PM UTC+5:30, Pablo Heiber wrote: > > It means that your submission got a Wrong Answer on the sample input (the > one in the statement). Submissions that fail the sample input are not > considering for penalty purposes. > > On Sun, Mar 24, 2019 at 1:59 AM

[gcj] This Allocation Problem (3rd Problem). All Given Test cases passed but after submission it shows WA.

2020-04-06 Thread Srikant Jena
func solve(cases: Int, range: [[Int]]) { var outPut = "" var cArr = [(start:Int, end: Int)]() var jArr = [(start:Int, end: Int)]() var list = [Int]() var map = [Int :Int]() for item in range { list.append(item[0]) map[item[0]] = item[1] }

[gcj] Re: Interactive Problems

2020-04-06 Thread Shawn Sun
Hi, I'm using python3 for the interactive problem. The code passed some tests on google, but when I try it locally using the local interactive tool, it only returns "Judge return code: 0 Solution return code: 0". Do you have an idea why it does not work locally? The command line I'm having is

[gcj] Not able to Justify the string output

2020-04-06 Thread akshit bhatia
Hello All, In one of the problems for Code Jam, I am getting the below output Case #1:CJC Case #2: IMPOSSIBLE Case #3: CJJCC Case #4: CC Meanwhile, the real output should have been like this: Case #1: CJC Case #2: IMPOSSIBLE Case #3: JCCJJ Case #4: CC Can anyone tell how to

[gcj] Re: RE when Submit attempt, by Java, Cryptopangrams

2020-04-06 Thread KapyoniK
I have exactly the same problem. Compiler gives RE, without any trace of the error, but still the code compiles on local platform. I'm not using OpenJDK though, I don't know if my code is incompatible because of that. On Friday, April 3, 2020 at 6:11:53 PM UTC+2, Vũ Hoàng wrote: > > Hi all, I

[gcj] Code giving WA,while the code works fine in local machine

2020-04-06 Thread shikhar tiwari
t=int(input()) R=[] for i in range(t): k=0 M=[] n=int(input()) for i in range(n): a=input() M.append(a.split(" ")) r=0 c=0 for i in range(n): for j in range(n): if(i==j): k=k+int(M[i][j]) N = [[M[x][y] for y in

[gcj] Re: KickStart 2020 simple problem. Code runs locally, but gets WA on Google's machine

2020-04-06 Thread shikhar tiwari
Hi I am having the same issue, can anyone help me? t=int(input()) tasks=[] output=[] for i in range(t): n=int(input()) for j in range(n): tasks.append(input().split(" ")) for j in range(n): for k in range(2): tasks[j][k]=int(tasks[j][k]) a=lambda

[gcj] Code giving Sample Failed:WA, while it works fine in local machine

2020-04-06 Thread shikhar tiwari
t=int(input()) tasks=[] output=[] for i in range(t): n=int(input()) for j in range(n): tasks.append(input().split(" ")) for j in range(n): for k in range(2): tasks[j][k]=int(tasks[j][k]) a=lambda task:task[0] tasks.sort(key=a,reverse= False)

[gcj] I am Getting WA for this Java Code

2020-04-06 Thread Vijayanathan jayaprakash
Code: import java.util.Scanner; import java.io.*; class time { int t1=-3,t2=-1; } public class Solution { public static void main(String[] args) { int ctc = 0,ctj=0; Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in))); int T = sc.nextInt(); for(int i=1;i<=T;i++) { int

Re: [gcj] Parenting Partnering return

2020-04-06 Thread Joseph DeVincentis
If there are three tasks that conflict in the same period of time, then it is impossible, yes. But consider this input: 1 4 0 100 400 500 0 300 200 600 A working allocation is to put tasks 1 and 4 on one parent and 2 and 3 on the other. But by processing them in the original order and always

[gcj] Parenting Partnering - WA

2020-04-06 Thread Gopala Krishna Viroti
I am getting WA but the code is working fine for sample test cases. Below is my code can some hep - what is wrong with my code ? import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Collections; import

[gcj] RE on Codejam using C++

2020-04-06 Thread Vardhan
#include using namespace std; int main() { int t, n, i, j, q, x, k, r, c, M[100][100], temp, rtemp, ctemp; cin>>t; for(x=1; x<=t ; x++) { cin>>n; k=0; r=0; c=0; for(i=1; i<=n; i++) { for(j=1; j<=n; j++) {

[gcj] Parenting Partnering Returns

2020-04-06 Thread Boopesh Shanmugam
What seems to be wrong in this code , its passing the visible test cases but am getting wrong answer when i subimit n=int(input()) for m in range(n): no=int(input()) inp=[] res=[] flag=1 tempo={} for j in range(no): temp=list(map(int,input().split()))

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

2020-04-06 Thread kamujula srikar
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.*;

[gcj] Q: 2020 Qualification Indicium

2020-04-06 Thread MC
Hi, I read the analysis of the ' https://codingcompetitions.withgoogle.com/codejam/round/0019fd27/00209aa0', and it said you can fill each row greedily, but it doesn't work for some cases. Case 1) N=4, K=10 and A=1, B=2, C=3, I filled the first row like below, 1 4 3

[gcj] Qualification round problem - Nested depth

2020-04-06 Thread Avinash Bhardwaj
I prepared several testcases and each one is passing as per the rules stated in the problem. But still I get WA: wrong answer. Could anyone point me out to a possible case where my solution fails? It'd be great help #include #include #include using namespace std; int main() { int T , N ;

[gcj] ESAb ATAd problem [Codejam 2020 qualification round]

2020-04-06 Thread Hari Krishnan
This was an interesting problem. I had a few questions though: 1. I got WA for b=20 first. Then I realized I had not added `flush=True` for the print statements. After that it worked. Is this because of the randomness of the judge or a problem in my algorithm? 2. It works for b=20, but doesn't

[gcj] Alternative "creative" solutions to "Indicium"

2020-04-06 Thread XYZT
*Link to problem: https://codingcompetitions.withgoogle.com/codejam/round/0019fd27/00209aa0 * The "Analysis" section of Code Jam 2020 Qualification Round Problem 5, "Indicium" says:

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

2020-04-06 Thread Chandrika Srinivasan
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 {

[gcj] Qualification round - Indicium

2020-04-06 Thread Amogh Kamath
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

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

2020-04-06 Thread Ankit Rauthan
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

[gcj] Vestigium

2020-04-06 Thread Nirmal Purohit
I have following Python3 code which works perfectly with my windows machine but give run time error on the code Jam: import numpy as np from collections import OrderedDict result = OrderedDict() for case in range(int(input())): numRows = numCols = 0 mat = np.array([input().split() for _

[gcj] Python: Code works on local machine but it says "Wrong Answer"

2020-04-06 Thread Tornax
Hello! At this moment I'm trying to solve the "Vetigium"-Problem in the qualification round 2020. I'm printing my solution with this line (I'm using Python 3.8): print(f"Case #{solveTestCase}: {trace} {rowsSame} {columnsSame}", flush=True) It works fine on my System, it prints the right

[gcj] Re: Interactive Problems

2020-04-06 Thread Jihye Sofia Seo
Thanks a lot!! I do python, and I forgot to put python before my file. :-) Now I can play with the result. On Friday, 3 April 2020 18:11:15 UTC+2, Josée Mallah wrote: > > I am using Java. But the note written in the given says you have to run > something .py. > I saw this: "python

[gcj] Getting error RE even when I run the test cases, can please someone tell me if the way I process input and output is correct

2020-04-06 Thread Mayuresh Anand
def schedule(jobs,n): jobAssign = [0]*n statusJ = "INACTIVE" statusC = "INACTIVE" jobJ = [0,0,0] jobC = [0,0,0] for i in range(0,n): newJob = jobs[i] if jobC[2] <= newJob[1]: jobC = newJob jobAssign[newJob[0]-1] = "C"

[gcj] response submission

2020-04-06 Thread Mukesh Gupta
>From where to download input file? -- 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

[gcj] getting Run time Error

2020-04-06 Thread Joshi Jaykishan
I turn in my java code in Code Jam but I get Run Time Error. here my code import java.util.*; class Main { public static void main(String[] args) { int t,i=0,k=0,count=0,v=0,c=0,n=0; String r="\0"; int []st=new int[10],e=new int[10]; Scanner s = new Scanner(System.in); t=s.nextInt();

[gcj] Submit problem for "Parenting Partnering Returns"

2020-04-06 Thread Marco Bauschke
Hi there, I’m trying to submit my solution for Problem 3: „Parenting Partnering Returns“ but it’s getting me always a runtime exception. This is strange because my Test attempts are always successful. Has anyone ever had a problem like this before and knows what it could be? -- You

[gcj] Code Jam 2020 WA Help

2020-04-06 Thread Gopala Krishna Viroti
I am getting WA message when i attempted below code. Please help import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.Scanner; import java.util.Stack;

[gcj] Parenting Partnering Returns

2020-04-06 Thread Martin Seeler
I'm asking to keep my sanity: Did anyone solve this problem with Python? I can't find these tricky edge cases where my code fails, all variations I try on my machine seem to work just fine. Still CodeJam Environment says *WA*. If there is someone who solved it in python, then I know I'm

[gcj] Re: KickStart 2020 Allocation problem giving WA, what seems to be the issue in the code??

2020-04-06 Thread Jeffrey Short
Remove the -1 in the for loop in Allocate -- 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

[gcj] VESTIGIUM RE ERROR

2020-04-06 Thread Bal
Hi I am new to python, i am receiving RE Error on my code. I Ran in system everything works correct. May i know what is the problem in my code. I used Python2 to run my code. def calculatetruce(table): truce=0 for i in range(len(table)): truce+=table[i][i] return truce def

[gcj] Showing Runtime Error, While Submitting code on Code Jam Editor

2020-04-06 Thread Laxman Negi
*Language: Python 3* Hello, def sumtracing(mx,n): s=0 for i in range(n): s+=mx[i][i] return s def countIdenticalRows(mat): count = 0 for i in range(len(mat)): hs=dict() #Traverse the row for j in range(len(mat[i])):

[gcj] Re: KickStart 2020 Allocation problem giving WA, what seems to be the issue in the code??

2020-04-06 Thread Jeffrey Short
Remove the -1 from the for loop in allocate() -- 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

[gcj] KickStart 2020 Round A, Allocation problem gives WA in c++ code.

2020-04-06 Thread Nick Tzavidas
Hello, I think on the allocate function you should on the for loop you should also include the A.size() - 1 th element, otherwise it might produce an number off by one. See this example: 3 10 2 2 2 The answer is 3, but your code returns 2. Hope it helped! :) -- You received this message

[gcj] idk whats wrong with my code can anyone help?parenting partnering returns

2020-04-06 Thread DEVANSH CHAUDHARY
#include int main(){ int t,x=1; scanf("%d",); while(t--) { int n,i,j,d=0; scanf("%d",); int s[n],e[n]; char p[n]; for(i=0;is[j])||(e[i]s[j])) { d=1; break;

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

2020-04-06 Thread eegee
I keep getting a RE (Runtime Error) for my solution on "Parenting Partnering Returns". It passes the test case, but fails for the submission. It is quite frustrating not knowing what the issue is. I spent an inordinate amount of time trying to get the first solution submitted since it also had

[gcj] Indicium problem

2020-04-06 Thread Neeraj Kumar
I have written code for indicium. I think it should work but still it is failing at google codejam. Please help and code is below: Indicium TC failing while it is passes locally Inbox Neeraj Kumar to codejam 2 days ago Details I have tried all possible TCs at local for Indicum

[gcj] Parenting Partnering return

2020-04-06 Thread Atta Mohamed
- why I got the wrong answer with this code? - do we need sorting? - I assumed that if three activities overlap with each other so the there is no solution is this assumption correct? import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import

[gcj] Boilerplate code in nodejs for reading multidimentional array

2020-04-06 Thread Saurabh Gattani
Hi All, I am looking for Boilerplate code in nodejs for reading multidimentional array for codejam. If anyone has any inputs, please let me know. -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop

[gcj] Attempts results are not showing (i.e the code just throws a RE without any further explanation)

2020-04-06 Thread Khalil Mohamed Zouitni
Hello everyone, Hope you're doing well. Is there any way to figure out where does my solution stumble ? 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

[gcj] Allocation Problem - Getting WA - Missing corner cases?

2020-04-06 Thread Navdeep Singh
Hi, I've written the following code for the *Allocation* problem of round 1. It passes the basic test cases given in the problem description. But it fails upon submission. Could someone please point out what I might be missing? #include #include using namespace std; int main() { int tc;

[gcj] Re: Help! First timer! Practising some 2019 problems...

2020-04-06 Thread Hallgrimur David
Hi, 1. Currently on Code Jam's platform, you can import packages from the python standard library, numpy and scipy (see "Platform" section on https://codingcompetitions.withgoogle.com/codejam/faq). 2. Your code is not compatible with Python 3.5 which Google uses to run your code on their

[gcj] Re: KickStart 2020 Allocation problem giving WA, what seems to be the issue in the code??

2020-04-06 Thread porker2008
*for(int i = 0; i < A.size() -1; i++)* condition for continuing the loop is incorrect. You should use* i < A.size()* -- 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