The suggestion is that you avoid using float at all (because floating point
arithmetic is hard), and instead use integer arithmetic. In this case, you
can do that by not computing the average.
On Wed, 15 Apr 2020 at 16:42, Matt Fenlon wrote:
> That fixed it! Thank you so much. Out of curiosity,
Did you look at the example I posted?
On Mon, 13 Apr 2020, 17:09 AC, wrote:
> Hi Matt,
>
> Thanks for the response
> So I revisited the problem after reading the many posts.
> Solution below is working and tested.
> For each case:
> 1. take input
> 2. sort the input , but keep the original
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=[]
You can do it with a single pass through the list, maintaining the maximum
sum with every possible set of permitted digits (1024 values).
On Wed, 29 May 2019, 00:03 akshit bhatia, wrote:
> Hello,
>
> I know this is not the right community to ask this coding problem, but
> please if possible,
The analysis covers this case. When there's AABB, you have to take 2 out.
On Sunday, 8 May 2016, Eric Mordezki wrote:
> Could I get some help as to why my algorithm couldn't solve this exercise?
>
> The problem was to figure a way to let people out without having a party
>
Correct. This is proved in the contest analysis.
https://code.google.com/codejam/contest/32016/dashboard#s=a=0
> On 26 Mar 2016, at 11:33, Seung Youp Oh wrote:
>
> https://code.google.com/codejam/contest/32016/dashboard#s=p0
>
> I'm solving this problem and found a solution
Yes - see for example linguo's solution.
He solved bilingual as an integer linear programming problem too.
Edward
On 9 Jun 2015, at 21:09, bigOnion haibren...@gmail.com wrote:
During round 2 I recognized that problem B can be described as a Linear
Programming problem.
There are two
For any pair of trees, drawing the line connecting them and then clearing all
trees on one side of the line will put both of them on the boundary. Checking
all ways to do that is n^3 naively but can be made n^2 log n by sorting the
trees clockwise around the tree being considered.
Edward
On
Try a single stack of 9 pancakes.
Edward
On 12 Apr 2015, at 09:10, utkarsh gupta guptautkarsh2...@gmail.com wrote:
For small B, what I did was to first divide all the maximum sized pancakes to
half giving the extra half to empty plates.Now it will be take special
minutes equal to the
Perhaps you could list the 4 moves which you believe solve the particular case?
Edward
On 13 Oct 2014, at 18:46, Shenghua Song songsheng...@gmail.com wrote:
I'm new to Google Code Jam. I am very excited and thank you for providing me
this opportunity to learn coding from world top
This general approach will work if you are careful about defining what your
variables mean. You may find writing explicit loop invariants helpful.
To progress though, you'll need to switch from direct simulation of this sort
to analysing the problem with pencil and paper, finding a simpler way
11 matches
Mail list logo