Some of the hardcoded conditions/appends are out of whack. For example,
X1==4 and Y1==1 should be SNE, not NSE. Also, down below these conditions,
when X<0, we need to change E and W, not N and S. The opposite is true for
when Y<0. When all these get corrected, the code passes Test Set 1. For
When I run it locally, I get
{SyntaxError: unexpected EOF while parsing}
Maybe it has something to do with how you are handling the input?
Best,
Matt
On Monday, April 20, 2020 at 12:38:27 PM UTC-4, Nabil Marquez wrote:
>
> Hello, the following code always gives me RE on the judge (during the
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
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"
-4 -1 is outputting IMPOSSIBLE when a possible path is NSW. As a matter of
fact, all solutions involving 1 and 4, positive and negative, say
IMPOSSIBLE. Maybe the program is failing to account for the fact that you
can use 1 and -2 or -1 and 2 to reach -1 and 1 respectively? Hope this
helps.
I have little practice with Java, but take a look at this link:
https://codingcompetitions.withgoogle.com/codejam/submissions/0019fef2/ZWF0bW9yZQ
These are submissions from the 18th place finisher in the competition.
Compare your code to this. Maybe you will catch something.
Best,
Matt
It's this little block right here:
if (j2 != n - 1) {
right.push_back(s.substr(j2 + 1));
}
specifically the condition. n-1 should be s.length()-1. Change that over,
and it passes all test cases.
Best,
Matt
On Monday, April 20, 2020 at 12:37:35 PM UTC-4, Sahil Bansal
Get rid of this line:
{package p3;}
You don't need it, and it makes the judge all moody ;)
Best,
Matt
On Monday, April 20, 2020 at 12:37:16 PM UTC-4, Moustafa Farouk wrote:
>
> Code works fine on local eclipse. Returns Runtime Error on KickStart
> platform. Any idea?
> Round B 2020 - 1st
My python is a bit rusty, so bear with me. I feel as if there is a problem
with this line:
{s[l['x']][l['y']] = 0}
in the solve() method. Consider the following case on a 2x3 floor where
each digit represents the competitor's skill level:
3 2 3
5 1 2
after Round 1, the floor should
Thank you! I miss read the 10^12 as 2^12. What an expensive lesson.
Thanks!
On Mon, Apr 20, 2020 at 3:48 PM porker2008 wrote:
> You need to use long long to handle the day because it is out of range of
> 32-bit integers.
>
>
> -
>
>
> *#include *
> *#include *
> *#include *
>
Taking test case loop and again ur print the output in another loop
Thank You
Chitaranjan Pradhan
On Mon, 20 Apr, 2020, 10:09 PM vishakha narang,
wrote:
> *package* bike_tour;
>
>
> *import* java.util.Scanner;
>
> *import* java.io.*;
>
>
> *public* *class* Solution {
>
>
> *public* *static*
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
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 <
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
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
Try removing the package declaration and it should work.
On Mon, 20 Apr, 2020, 10:09 PM vishakha narang,
wrote:
> *package* bike_tour;
>
>
> *import* java.util.Scanner;
>
> *import* java.io.*;
>
>
> *public* *class* Solution {
>
>
> *public* *static* *void* main(String[] args) {
>
> Scanner in
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
*package* bike_tour;
*import* java.util.Scanner;
*import* java.io.*;
*public* *class* Solution {
*public* *static* *void* main(String[] args) {
Scanner in = *new* Scanner(*new* BufferedReader(*new*
InputStreamReader(System.*in*)));
*if*(in.hasNext())
{
*int* t = in.nextInt();
*int*
from math import ceil
t=int(input())
for p in range(1,t+1):
n,d=map(int,input().split())
a=list(map(int,input().split()))
minn=0
i=0
j=0
for y in a:
b=(d//y)*y
if(i!=0):
if(minn>b):
mi=m-(a[j]*ceil((m-b)/a[j]))
My Python 3 submission got a "Wrong Answer" on Test Set 1 inexplicably.
Since then, I have made the same submission over and over again, and it
always passes. For Test Set 1, there should be no RNG in the solution - so
I don't see how there can be a "Wrong Answer". Unfortunately, I can't seem
Hello, the following code always gives me RE on the judge (during the first
test set):
from math import sqrt, ceil, log
possible = [(0,1),(1,0),(0,-1),(-1,0)]
reflected = {
"E" : "W",
"W" : "E",
"S" : "N",
"N" : "S",
}
def evenReachable(Xi, Yi, Xf, Yf):
if ((Xi + Yi) == 0)
Just attempted the GCJ 2020 : Round 1B. I was able to solve Blindfolded
Bullseye but my code for Expogo gave wrong answer. Would have got a good
score if I could have cracked this as well.
Here's my python3 code.
T = int(input())
t = 1
while(t <= T):
res = ""
Y = input().split(" ")
Editorial for this problem seems to be resulting an unnecessarly
complicated code.
Solution is O(R*S) and 15 LOC (python 3). [I missed it during the contest
"of course", as I spent much time on the interactive problem.]
The idea is same but it is easy to prove that resulting sizes for A and B
can
Hi,
For Google CodeJam 2020 Round 1B - 3.JoinTheRanks - below was my C++
submission, which gave WA for hidden inputs.
https://codingcompetitions.withgoogle.com/codejam/round/0019fef2/002d5b64
Please help identify my error - in code, or input where it fails.
#include
using
Does anyone have a set of (or can generate, using a passed solution) of
test cases for large X and Y? My solution didn't work for them, and as I
took a completely different approach than the model solution, I'm curious
where I went wrong.
--
You received this message because you are
Hi guys, I wrote a straight forward BFS solution to solve 1B Expogo
question, targeting to solve test set 1 and 2.
However, not knowing which corner case it fails, the solution got WA.
Basic cases are all past locally, anyone could advise why below solution
fails?
import java.util.Arrays;
Hi
I'm just a beginner in Java.
I was attempting to submit my solution for *Round 1B - Expogo.*
The sample test case was :
* 4
2 3
-2 -3
3 0
-1 1*
It did not had a new line character or any delimiter such as space which tells
the BufferedReader or Scanner to stop waiting for
Hello all,
Was just attempting this question for practice and have used Python3. I am
repetitively getting WA and I am not able to find any specific case that I
might have missed.
Here's the code:
T = int(input())
t = 1
cas = ["P","R","S"]
while(t <= T):
res = ""
A = int(input())
Hello All!
Question :
https://codingcompetitions.withgoogle.com/codejam/round/000516b9/00134c90
Was just trying out the robot programming strategy problem for practice.
But I feel I am missing some constraint which is giving me an wrong
answer. Here's my solution in Python3.
Code works fine on local eclipse. Returns Runtime Error on KickStart
platform. Any idea?
Round B 2020 - 1st problem:
package p3;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Solution {
Code works fine on eclipse, but returns RE on kickstart. Any idea?
package p3;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Solution {
public static int checkPeakPoints(int n, int[]
Please help me understand where I went wrong on this one. My output from
the test data seemed to match the test output exactly so I'm not sure if it
was some formatting I was missing or a hidden corner case but every
submission I made returned WA.
Thanks,
Scott
*t = int(input())*
*for i in
Really Stumped, Got a Run time error during the competition and still have
not been able to figure it out. Any ideas welcome.
#include
#include
#include
using namespace std;
int calcTime();
vector readVector(int n);
int main() {
int nCases = 0;
cin >> nCases;
for (int i = 0; i <
#include
using namespace std;
#define FAST_IO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef long long ll;
const ll MOD = 1e9 + 7;
#define endl '\n'
bool len_function (string a, string b) {
int m = a.length();
int n = b.length();
return m <= n;
}
void solve(int
Check out the link below if you'd like to review solutions and explanations
to the problem set from Round 1A. Writing the explanations felt a lot like
reiterating the Analysis section of each problem, but it was helpful to
restate them in my own words so that I could ensure that I understood
Can anyone suggest anything here?
понеділок, 13 квітня 2020 р. 19:07:56 UTC+3 користувач Bohdan Dovhan
написав:
>
> During Round 1A I wasn't able to submit correct solution in time.
> When round finished, I have submitted solution which shown in Practice
> Correct result for 3A and TLE for 3B.
36 matches
Mail list logo