[code jam] Re: Intranets (2022 Round 1C)

2022-08-19 Thread porker2008
ive, e.g. with k=2 and m=5, we should have i=2, 3, > 4, 5, and when i=3, we should have j=1, 2, 3. When i=3 and j=3, > m-2*j=5-2*3=-1. How should this case be handled/avoided? > > On Thursday, 11 August 2022 at 20:19:56 UTC+1 porker2008 wrote: > >> The part2 only works if y

[code jam] Re: Intranets (2022 Round 1C)

2022-08-11 Thread porker2008
The part2 only works if you are dealing with probability instead of the actual count. Here is a modification of your part2, which give you the correct probability. *from fractions import FractionT = int(input())for cas in range(T):m, k0 = [int(s) for s in

[code jam] Re: About my solution of ASeDatAb in Round 1B

2022-04-29 Thread porker2008
Your solution didn't handle *-1* correctly. Whenever you receive *-1* from the judge, you should immediately terminate your program in order to receive the *Wrong Answer* verdict in time. However, your solution will continue to wait for next test case (which will never come) until the time runs

Re: [code jam] Round 1A 2022 - Code Jam 2022: Equal Sum

2022-04-22 Thread porker2008
The reason why IMPOSSIBLE is not provided is because you can always provide an A[] such that no matter what B[] you get back, it is always possible to divide A+B into two subset with equal sum. So you will never run into IMPOSSIBLE case. The judge however, will never guarantee that A + B can be

Re: [code jam] Qualifications 2022 Twisty Little Passages Analysis Importance Sampling

2022-04-21 Thread porker2008
@Ricola, The formula for weighted average is Sum(value * weight) / Sum(weight) In your case, you have 500 room, with one passage, with weight 1 and you have 500 rooms with 9 passages and with weight 500/9 So Sum(value * weight) = 500 * 1 + 9 * 500 / 9 = 1000 and Sum(weight) =

[code jam] Re: Round 1A 2022 - Code Jam 2022: Equal Sum

2022-04-20 Thread porker2008
Your solution wouldn't work for some test cases as your A is always [1, 2, ..., 100] If the B you received is [101, 102, ..., 199, 10] In this case, you can never divide them into two sets with equal sum. 在2022年4月18日星期一 UTC-7 08:03:03 写道: > Hi expert. > I am a beginner in Python. > I

Re: [code jam] Google Code Jam 2022 - Chain Reactions (RE problem)

2022-04-06 Thread porker2008
Maybe consider the worst case where N = 10, and all of them are not pointing anywhere *11060 20 40 50 60 20 40 50 60 200 0 0 0 0 0 0 0 0 0* 在2022年4月5日星期二 UTC-7 17:27:24 写道: > Hello plesse send one test case where it is failing > >

[code jam] Re: Qualification round - Chain reaction (WA) - Python 3.7

2022-04-06 Thread porker2008
When taking min, you should only consider the propagated fun value of the direct child, not the accumulated sum. You also need to increase the recursion depth to avoid runtime error. See the accepted code below: *import syssys.setrecursionlimit(20)memo =

[code jam] Re: 2021 Round 1c: Closest Pick

2021-05-04 Thread porker2008
You forget to check one case. you can choose to pick an entire range by placing two tickets at the end. For example, if someone else picked 10 and 30 you can pick 11 and 29 and take the entire interval [11, 29] Check out this code from line 49 to 54 在2021年5月3日星期一

[code jam] Re: Code Jam Qualification Round 2021 - "Reversort Engineering" has complexity O(N) instead of O(N^2)

2021-05-03 Thread porker2008
> Hi porker2008, > > No problem at all. Please see the code below. Just a disclaimer - during > code jams I am creating the worst code ever (due to the time limit), so > please be kind to me :) > > So again, the idea is to create the 'worst' solution with last elements +

Re: [code jam] strange Perl output?

2021-04-30 Thread porker2008
This looks like a terrible bug to me. Not sure how often/likely will this bug be triggered. Would it make sense if we ask the Code Jam team to use higher/latest Perl version? or lower version if higher version is not feasible. The 5.28.0 was released back in 2018 and seems pretty old now.

[code jam] Re: 2021 Round A1: Append Sort

2021-04-26 Thread porker2008
One possible reason is that the result does not fit in 32-bit integer and your maxn and min cause overflow 在2021年4月25日星期日 UTC-7 上午8:26:53 写道: > Can anyone please tell me what's wrong with this code? It's showing *RE *at > the *Test Set 2*. > > import java.util.Scanner; > import static

[code jam] Re: Code Jam Qualification Round 2021 - "Reversort Engineering" has complexity O(N) instead of O(N^2)

2021-04-25 Thread porker2008
analysis. 在2021年4月14日星期三 UTC-7 上午5:21:25 写道: > > @ porker2008 > > I did *not *ask to verify if my solution works in O(N) - I know it *does. > *And people working at Google (not from the Code Jam team - as those > never got back to me) confirmed that it *does*. > I only ment

[code jam] Re: Pascal Walk (2020 Round 1A)

2021-04-08 Thread porker2008
Your dfs is incorrect. It does not search all possible paths The correct thing to do is to unset visited[i][j] to false when you return from a path that does not give you any result. 在2021年4月8日星期四 UTC-7 下午12:41:12 写道: > Hello, > > My code passes 2 test sets but on the third one I get WA

[code jam] Re: Code Jam Qualification Round 2021 - "Reversort Engineering" has complexity O(N) instead of O(N^2)

2021-04-08 Thread porker2008
Would you mind if you can share your code here? You mentioned you use the Y numbers to generate the expected cost. I am not sure if that's possible to be done in O(N) without looking at your implementation. Also the analysis does *not *suggest that O(N^2) is the *best *solution. It just give

[gcj] Re: CodeJam 2020 Vestigium , Qualification round - Repeatedly getting WA on submitting

2021-03-08 Thread porker2008
Your code is too complicated and I have simplified it for you. Should pass all the test cases. Let me know if you have question Code: https://ideone.com/IO2oWf 在2021年3月3日星期三 UTC-8 下午2:02:06 写道: > Hello, > > I am repeatedly getting WA for Test Set - 1 on submitting my code. (Note: > Sample

[gcj] Re: Code Jam 2019 Qualification Round Problem D not working

2021-03-08 Thread porker2008
Your solution is almost correct for solving the Test set 1 The only mistake you have made is in function *solve1()* Because you want to represent each worker with the binary representation of the index, i.e. from *0* to *n-1*, you should use *l = len(bin(n - 1).lstrip('0b'))* to determine the

[gcj] Re: CodeJam 2017 Tidy Numbers, Qualification round - Repeatedly getting WA on submitting

2021-03-02 Thread porker2008
Hi, I can give you some input that your solution will fails to handle try *221* your code produce *219*, which is not a tidy number 在2021年3月2日星期二 UTC-8 上午8:18:15 写道: > Hello, > > I am repeatedly getting WA for Test Set - 1 on submitting my code. (Note: > Sample test data input produces the

[gcj] Re: Kick Start Round C 2020 Question 4 (Candies)

2020-06-02 Thread porker2008
Your code has runtime error when* N *is *1* Removing the following two lines (and also change the start index of the two loops from 2 to 1) should fix your problem: *a1[1]=-1*a[1];* *a2[1]=-2*a[1];* They will cause out of bound error when N is 1 A full passing solution is attached for your

[gcj] Re: Kickstart 2020 Round C Problem 2: Stable Wall. Having issues figuring out what's wrong

2020-05-28 Thread porker2008
If the test2 is a hidden test, then you are unlucky to pass test1 because you are not aware of such bug. If the test1 is a visible test, then you are lucky to pass test1 because you get more points in case you can't fix the problem. -- You received this message because you are subscribed to

[gcj] Re: Kickstart 2020 Round C Problem 2: Stable Wall. Having issues figuring out what's wrong

2020-05-28 Thread porker2008
You replied twice and i wasn't sure what's the order you sent them. In case you still don't understand why it is wrong to reset *polAdded *to *false *inside the for loop, let me know. -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To

[gcj] Re: Why my code in python3 for round 1 allocation problem showing test set skipped.

2020-05-28 Thread porker2008
There are two sets of test for this problem. If you failed test 1, then test 2 will be skipped (even if your solution will pass test 2 but not test 1) In this case, you are missing a* return n *at the end of the* house(n, b, a)*. This would happen when you have enough money to buy all the

[gcj] Re: Kickstart 2020 Round C Problem 2: Stable Wall. Having issues figuring out what's wrong

2020-05-28 Thread porker2008
You have an extra *polAdded = false* that caused the wrong answer. You are lucky to pass the first test case. *for (int i = 0; i < pol.Count; i++) {* *polAdded = false; // Remove this line* *var tmpWall = new string[int.Parse(rc[0])];* *finalwall.CopyTo(tmpWall, 0);* *for (int

[gcj] Re: [Kick Start B 2020][Java] Robot Path Decoding

2020-05-20 Thread porker2008
You need to take care of overflow problem. See the code below for references. *import java.util.ArrayList;* *import java.util.List;* *import java.util.Scanner;* *public class Solution {* *public static void main(String[] args) {* *Scanner scann = new Scanner(System.in); // Create a

[gcj] Re: round 2: Wormhole in one, dont know what went wrong...

2020-05-20 Thread porker2008
I cannot figure out what test case your code will fail, but I was able to fix your problem The problem is with floating point arithmetic. Because this problem requires very precise calculation, you should avoid using floating point at all Please check out the following code that would pass

[gcj] Re: Kickstart Round C Problem 2 (Stable Wall)

2020-05-20 Thread porker2008
You can try the following test case *1* *4 2* *AA* *AB* *AC* *AA* -- 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.

[gcj] Re: Robot Programming Strategy

2020-05-02 Thread porker2008
You are welcome :D -- 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

[gcj] Re: My code( in Python 3 ) works fine during the test but it shows Wrong answer during submission of Round A allocation(kisckstart 2020)

2020-05-01 Thread porker2008
Your output should match the given format and shouldn't contain extra white spaces *T = int(input())* *for i in range(1,T+1):* *N, B = input().split()* *N, B = int(N), int(B)* *A = []* *expense = 0* *y = 0* *A = [int(x) for x in input().split()]* *for k in

[gcj] Re: Robot Programming Strategy

2020-05-01 Thread porker2008
Try this case Input: *1* *2* *R* *S* Expected Output: *Case #1: RP* -- 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

[gcj] Re: Code Jam Qualification Round Parenting Partnering

2020-04-30 Thread porker2008
Your *compareTo()* is causing the runtime error. More specifically, your *compareTo()* does not satisfy the requirement. check out https://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html For example, given two identical interval A and B *compareTo(A, B)* should be *0* instead of

[gcj] Re: BuildingPalindromes

2020-04-27 Thread porker2008
Your solution has time complexity O(N^2) for each query which is too slow to pass Test set 2 In order to pass test set 2, you need to calculate the number of A to Z in a given prefix. Then use this prefix to calculate the number of A to Z in any given range Then for any given range, check if at

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

2020-04-27 Thread porker2008
Hey jawa, You need to process all activities based on the start time. If you greedily assign activity in the given order, you will fail the following input Sample Input *1* *4* *1 2* *1 5* *5 6* *2 6* Expected output: *Case #1: CJJC* However, your solution answers *IMPOSSIBLE* -- You

[gcj] Re: RobotPathDecoding

2020-04-24 Thread porker2008
You need to use long long to handle intermediate result, otherwise it will overflow. Otherwise, your solution looks pretty good! *#include * *#include * *#include * *using namespace std;* *long long MOD = 10LL;* *pair, int> xydis(string s) {* * long long x = 0;* * long long y = 0;* *

[gcj] Re: Inexplicable "Wrong Answer" (Blindfolded Bullseye, Round 1B 2020)

2020-04-22 Thread porker2008
This is an interactive problem, so the input data may not be fixed. i.e. the location of the center may change each time you submit your solution. Since you have a bug in your code (not correctly handle the right bounday), so in rare cases, your solution would fail. -- You received this

[gcj] Re: Round 1B 2020 Expogo - WA For Test Set 3

2020-04-22 Thread porker2008
Try the following test case Input *1* *0 536870911* Expected output: *Case #1: N* The problem is that for the case above, *min_jumps* should be *29* However, due to floating point precision error, your *min_jumps* is rounded up to *30* The following code will fix

[gcj] Re: WA- - GCJ'19 ROUND 1C - Robot Programming Strategy

2020-04-21 Thread porker2008
When it is Scissor and Paper, you should swap al[0] and al[1], assuming al[0] always beat al[1] *T = int(input())* *t = 1* *cas = ["P","R","S"]* *while(t <= T):* *res = ""* *A = int(input())* *l = []* *for i in range(A):* *l.append(input())* *pos = 0* *

[gcj] Re: Inexplicable "Wrong Answer" (Blindfolded Bullseye, Round 1B 2020)

2020-04-20 Thread porker2008
Also, your *binary_search_right()* is incorrect, it fails when *left = 10**9 - 1* and *func(10**9)* is *HIT* In this case, it returns *10**9 - 1* instead of *10**9* Wrong implementation: *def binary_search_right(self, left, func):* *right = 10**9* *while left < right:* *m = (left

[gcj] Re: Inexplicable "Wrong Answer" (Blindfolded Bullseye, Round 1B 2020)

2020-04-20 Thread porker2008
While test data is not random, your solution is. It is very likely that you have a bug in your code that in some cases, the random number you generated cause your program to behave incorrectly. -- You received this message because you are subscribed to the Google Groups "Google Code Jam"

Re: [gcj] Round 1B - Join the Ranks

2020-04-20 Thread porker2008
AFAICT, your solution is exactly what the analysis is trying to do. Your code is simply doing the work in a more effective way. (by keeping track of how many cards in pile A and where to insert it into pile B) -- You received this message because you are subscribed to the Google Groups

[gcj] Re: Help with run time error on Bus Routes

2020-04-20 Thread porker2008
You need to use long long to handle the day because it is out of range of 32-bit integers. - *#include * *#include * *#include * *using namespace std;* *long long calcTime();* *vector readVector(int n);* *int main() {* * int nCases = 0;* * cin >> nCases;* * for (int i = 0; i <

[gcj] Re: Round 1b 2020 BUS routes problem

2020-04-20 Thread porker2008
Your approach is wrong IMO. Please checkout the analysis and try to understand the intended 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

[gcj] Re: Round B 2020 - Bike Tour - Python3

2020-04-20 Thread porker2008
should be *m[j + 2]* instead of *m[j]* at line 11 *t = int(input())* *for i in range(0, t * 2, 2):* *n = int(input())* *m = [int(x) for x in input().split()]* *peaks = 0* *before, current, after = m[0], m[1], m[2]* *for j in range(1, n - 1):* *if before < current and

[gcj] Re: Java RE!

2020-04-20 Thread porker2008
Maybe you should remove the package declaration? -- 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] Re: Kickstart Allocation problem 2020. How to improve the (python) code ?

2020-04-17 Thread porker2008
How about this? *from itertools import accumulate* *T = int(input())* *for t in range(T) :* *N, B = map(int, input().split())* *A = sorted(list(map(int, input().split()))[:N])* *prefix = list(accumulate(A))* *y = len(list(filter(lambda x : x <= B, prefix)))* *print("Case

[gcj] Re: I'm new to these code jams and wondering how we're supposed to use input.

2020-04-15 Thread porker2008
Please checkout FAQ: https://codingcompetitions.withgoogle.com/codejam/faq Section "Coding" Question: *How should my program read input and write output?* *TL;DR; *Your program should read from *standard input stream* (e.g. *scanf*, *cin* in C/C++, *input()* in python, *System.in* in Java, etc)

Re: [gcj] Re: Square Dance - WA for Test Set 2

2020-04-15 Thread porker2008
The reason to avoid floating point arithmetic is that floating point number has wider range than integer but has lower precision. In any case, if a problem can be solved without using floating points (meaning that all operations are done using integers and they fit the range of long long) you

[gcj] Re: [2020][Pascal Walk] Java - WA second test case

2020-04-15 Thread porker2008
duplicate question I believe. Please check my comments in the other threads -- 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

[gcj] Re: Square Dance - WA for Test Set 2

2020-04-14 Thread porker2008
I think the problem is related the following line *total += f[i][j] * when[i][j];* Since f[][] and when[][] are both int, the result may be overflowed. Change the line to *total += 1LL * f[i][j] * when[i][j];* would solve the problem. Also for calculating average, try avoid using float number

Re: [gcj] Re: Java: Parenting Partnering Returns WA

2020-04-14 Thread porker2008
Oh didn't notice that you override the equal() to for checking overlap. As Matt pointed out, this is not efficient because you have to run through the entire list to determine whether the new activity can be assigned to C or J, and it leads to O(N) to process each new activity and hence O(N^2)

Re: [gcj] Re: Java: Parenting Partnering Returns WA

2020-04-14 Thread porker2008
I think the running time of your solution is O(N log N) unless you think otherwise. -- 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

[gcj] Re: RE in Pascal Walk - C++

2020-04-13 Thread porker2008
for some reason, your code passed all 3 tests in my submissions after the trim() was fixed. Maybe our submissions are run against different test data? -- 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: RE in Pascal Walk - C++

2020-04-13 Thread porker2008
your trim function is not working properly. To fix it, you can try *string trim(string bstring) {* * for (int i = 0; i < 1000; ++i) {* * if (bstring[0] == '0') bstring = bstring.substr(1);* * else return bstring;* * }* * return bstring;* *}* Also you have nested loop reusing loop variable *i*,

[gcj] Re: Help with a simple runtime error having to do with input/output

2020-04-13 Thread porker2008
I haven't tested your code yet. But I encourage you to try fixing this issue first. -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[gcj] Re: Getting Run Time error for Parenting Partnering Returns

2020-04-13 Thread porker2008
You can try the following test data *1* *4* *0 1* *1 6* *5 6* *0 2* Expected output: *Case #1: CCJJ* -- 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

Re: [gcj] Re: Java: Parenting Partnering Returns WA

2020-04-13 Thread porker2008
Your printing order is correct. My point is for some specific input, there is a solution but your program will output *IMPOSSIBLE* e.g. Input: *1* *4* *0 1* *5 6* *0 2* *1 6* Expected output: *Case #1: CJJC* (or *JCCJ*) But your program will return *IMPOSSIBLE* -- You received this message

[gcj] Re: Help with a simple runtime error having to do with input/output

2020-04-13 Thread porker2008
f-string isn't supported in python 3.5.3 -- 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

[gcj] Re: ESAb ATAd question debugging

2020-04-13 Thread porker2008
if (ne > -1) { System.out.println(ne + 1); bit = input.nextInt(); ne_change = a[ne] != bit; i++; // removing this line } else { System.out.println("1"); bit = input.nextInt(); } -- You received this message because you are subscribed to the Google Groups "Google Code

[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: 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,

[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():* *

[gcj] Re: Parenting Partnering Returns Question

2020-04-09 Thread porker2008
Hi MANASA, > > I replied to you in another thread, so I just put a summary here. iterator from PriorityQueue does not return elements in a particular order , so your code does not actually work as your intended

[gcj] Re: Parenting Partnering Returns Submission error "WA" for code in JAVA

2020-04-09 Thread porker2008
*for (Interval itm : oFinal) {* *System.out.print(itm.person);* *}* The iterator from PriorityQueue does not return the elements in a particular order , that's why your solution does not work. Instead you

[gcj] Re: RE in Test set 2 for ESAb ATAd (Java)

2020-04-08 Thread porker2008
*else if (diff != -1) {* * System.out.println(diff+1);* * int l = ms.nextInt();* * if (ans[diff] != l) {* * for (int j=0;jhttps://groups.google.com/d/msgid/google-code/ae666510-b1e2-4812-81e7-90ada6ece336%40googlegroups.com.

[gcj] Re: RE in solution for parenting partnering returns

2020-04-07 Thread porker2008
You can try the following test case *1* *2* *1 10* *1 10* Expected output *Case #1: CJ* (or *JC*) -- 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

[gcj] Re: Regarding ESAb ATAd Question

2020-04-07 Thread porker2008
It does not matter whether quantum fluctuation was applied before 1st query or not Because you always answer what the string was *currently *looks like -- 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: Python Code works on local machine but it says "Wrong answer"

2020-04-07 Thread porker2008
You can try the following input *1* *10* *1 2 3 4 5 6 7 8 9 10* *1 2 3 4 5 6 7 8 9 10* *1 2 3 4 5 6 7 8 9 10* *1 2 3 4 5 6 7 8 9 10* *1 2 3 4 5 6 7 8 9 10* *1 2 3 4 5 6 7 8 9 10* *1 2 3 4 5 6 7 8 9 10* *1 2 3 4 5 6 7 8 9 10* *1 2 3 4 5 6 7 8 9 10* *1 2 3 4 5 6 7 8 9 10* Expected output: *Case

[gcj] Re: Error in the subject for ESAb ATAd ?

2020-04-07 Thread porker2008
It does not matter whether the fluctuation will happen before the 1st query or not It is safe to assume it is not -- 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

[gcj] Re: Parenting Partnering question sample set wrong?

2020-04-07 Thread porker2008
The answer is in the original order given in the input so JCCJJ means J took (99 150) C took (1 100) C took (100 301) J took (2 5) J took (150 250) You can easily verify that neither C or J took any conflicts jobs -- You received this message because you are subscribed to the Google Groups

[gcj] Re: parenting partners return

2020-04-07 Thread porker2008
your solution's output is *Case #3: CJJCJ* So C's job is *(2, 5) (90, 150)* J's job is *(1, 100) (100, 301) (150, 250)* Clearly J has two conflict job *(100, 301)* and *(150, 250)* So your code would fail the sample. -- You received this message because you are subscribed to the Google

[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

[gcj] Re: Cryptopanagrams

2020-03-31 Thread porker2008
C++ does not have built-in support for big integers You can consider using other languages like python or Java(BigInteger) -- 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: Cryptopanagrams

2020-03-30 Thread porker2008
you can try the following test case 1 10 3 9 9 15 Expected output would be Case #1: AAAB Explanation A = 3 B = 5 -- 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

[gcj] Re: Forgone Solution: Program runs in IDE but getting runtime error in google

2020-03-27 Thread porker2008
A few comment: 1. Your solution would not work for hidden test because the input does not fit into 32-bit integer. You need to read the input as string or char[] 2. pow(10,i) returns result in floating points, which is not ideal because it could potentially lose precision for large integers.

[gcj] Re: I get WA when I run this java code for Kickstart 2020 Round A Allocation problem

2020-03-27 Thread porker2008
I don't see major issue with your code The only issue is you need to have an extra space after the case number Instead of outputting *Case #1:2* you should output *Case #1:2 * -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe

[gcj] Re: Can anyone tell me why my code cannot pass the test set 2 with "TLE"

2020-03-25 Thread porker2008
*for pp in range(1,P+1): * can be optimized to *for pp in range(1,min(P, (nn+1)*K)+1):* This should allow your code to pass the test set 2 -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving

[gcj] Re: I get WA when running this java code

2020-03-25 Thread porker2008
A couple of feedback: 1. Most of the time you shouldn't need to implement sorting yourself. You should take advantage of the sorting library that comes with your languages/platform for free In this case, you should sort the array using Arrays.sort() in Java 2. In contadorCasas(),

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

2020-03-25 Thread porker2008
You can change the following code *if len(arr) == 1 and sum(arr) <= budget:* *return 1* to *if sum(arr) <= budget:* *return len(arr)* This is because the loop below assume the sum of the array is greater than *budget *at some point so you need to handle the case where the sum of the

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

2020-03-23 Thread porker2008
You have two bugs in your code *for j in range(n-1, -1, -1):* should be *for j in range(n-1, 0, -1):* This is to make sure that j-1 is not negative. The other bug is for finding the right pair of CS to swap. Use the following as example: CCSS The first pair you swap is C*CS*S, then it

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

2020-03-22 Thread porker2008
Can you share your 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 view this discussion on the web visit

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

2020-03-22 Thread porker2008
*for i in range(0, len(arr) - 1):* should be *for i in range(0, len(arr)):* -- 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

[gcj] Re: How to read test file? - Google Kickstart 2020

2020-03-22 Thread porker2008
Please check out FAQ: https://codingcompetitions.withgoogle.com/kickstart/faq In *Coding *section, you can find a few samples regarding how to read input and write output -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from

[gcj] Re: Cryptopanagram problem: sample failed RE

2020-03-14 Thread porker2008
The reason why you are getting *Runtime Error* is because you used Formatted string literals which is new in version 3.6 However, code jam used version 3.5.3 (see FAQ: https://codingcompetitions.withgoogle.com/codejam/faq Section *Platform*) *Python 3:* *3.5.3 (package: python3.5)* * numpy

[gcj] Re: Registration is open! New scoring rules

2020-03-10 Thread porker2008
> > Imagine I have a problem with a visible set worth 10 points, and a hidden > set worth 20 points. > > *Situation A:* > 1. I submit a problem get the visible set right, but the hidden set wrong, > at 1 hour. > 2. I submit again and get the visible set right, but the hidden set wrong, > at 2

[gcj] Re: Parcel Posts - Help

2020-02-14 Thread porker2008
Easy for this one. you should change the main loop to for (int i = 0; i < k; i++) This is to ensure you search to end of the list and when flag is 2, also check ihttps://groups.google.com/d/msgid/google-code/3729275c-bea8-4273-8c0d-302dd383f28a%40googlegroups.com.

Re: [gcj] Re: Is participating in code jam helpful to find job in google?

2013-05-10 Thread porker2008
to Interview? Also I'm 16 nowWill i be called for the interview?  Also how did u get to round 2? Can u suggest some tips...Pls. On Thu, May 9, 2013 at 6:17 PM, porker2008 zhangx...@gmail.com wrote: On Site Interview. The reason that I fail was that I sucks in the interview

[gcj] Re: Is participating in code jam helpful to find job in google?

2013-05-09 Thread porker2008
It helps but it does not help a lot. I was in the top 500 last year (Round3) but still fail the interview of Google. Participating in Codejam would give you no more than a chance to get an interview, but after that, the result only depends on your performance in the interview. Parker On

[gcj] Re: Is participating in code jam helpful to find job in google?

2013-05-09 Thread porker2008
On Site Interview. The reason that I fail was that I sucks in the interview. =( On Thursday, May 9, 2013 8:31:02 PM UTC+8, supermind wrote: Ohh that's really interesting to know. Please would you provide some details about the interview? I mean was it a phone call? or some on site

[gcj] Re: Violations observed

2013-05-04 Thread porker2008
Good job. How do you detect or what tools did you use to find out those cheaters? :) Parker On Sunday, May 5, 2013 3:07:37 AM UTC+8, ICY wrote: samarth3692 and HARSH94 have identical B-small solutions (ranks 981, 984). prakhar120793 (rank 950) had a wrong code attached to B-small solution.

Re: [gcj] Arrrggggghhhh

2013-05-04 Thread porker2008
I already know why you have that wrong output. Did you figure it out by yourself? :) Parker On Sunday, May 5, 2013 4:26:21 AM UTC+8, zach polansky wrote: N! 2 cases away from round 2! D: -- You received this message because you are subscribed to the Google Groups Google Code Jam

[gcj] Re: Violations observed

2013-05-04 Thread porker2008
also romeo (ranks 987) They have the same B small with samarth3692 and HARSH94 On Sunday, May 5, 2013 3:07:37 AM UTC+8, ICY wrote: samarth3692 and HARSH94 have identical B-small solutions (ranks 981, 984). prakhar120793 (rank 950) had a wrong code attached to B-small solution. -- You

[gcj] Re: Violations observed

2013-05-04 Thread porker2008
also Jasraj (rank 955). Same B Small On Sunday, May 5, 2013 3:07:37 AM UTC+8, ICY wrote: samarth3692 and HARSH94 have identical B-small solutions (ranks 981, 984). prakhar120793 (rank 950) had a wrong code attached to B-small solution. -- You received this message because you are subscribed

Re: [gcj] Arrrggggghhhh

2013-05-04 Thread porker2008
I think it should be (1+4+6)/16 = 11/16 = 0.6875 On Sunday, May 5, 2013 5:30:55 AM UTC+8, zach polansky wrote: Yup! I noticed that small limits were very small, and I computed all of the individual probabilities by hand that were not 1 or 0. I did (1+4+6)/32 = (12)/32 and couldn't find my

Re: [gcj] Disqualification

2013-05-02 Thread porker2008
Very interesting. Good Job! Wish everything working fine on Round1B On Friday, May 3, 2013 3:30:53 AM UTC+8, Bartholomew Furrow wrote: All right, I think I've tracked down the bug! First, my apologies to everyone who got an email saying he or she had been disqualified.  That's a nasty

Re: [gcj] which IDE of c++ you are uesing?

2013-04-24 Thread porker2008
Dev-C++ is buggy for debugging. On Wednesday, April 24, 2013 1:31:59 PM UTC+8, Jayaganesh wrote: Dev-C++ is the best IDE for C++ On Wed, Apr 24, 2013 at 10:15 AM, Ashish Vasava ashish9...@gmail.com wrote: I think some of the very good editors for C++ are sublime, gedit and vim.

Re: [gcj] Qualification Round

2013-04-14 Thread porker2008
the solution to Problem A is so impressive. =) On Sunday, April 14, 2013 3:58:34 PM UTC+8, CoderBaba wrote: In the mean time below is a post from my blog which contains the solution to Problem A and Problem C small.