Salom. Kim buSamsung Galaxy smartfonimdan yuborildi.
Asl xabar Kimdan: porker2008 Sana:
16/08/22 09:31 (GMT+05:00) Kimga: Google Code Jam
Mavzu: [code jam] Re: Intranets (2022 Round 1C)
I might be wrong, but I think there is an error in the analysis.i itself can
only goes
I might be wrong, but I think there is an error in the analysis.
*i* itself can only goes from *k* to *floor(m/2)*, since the size of a
matching in a graph of *M* node cannot exceed *floor(m/2)*.
This should solve your issue where *m - 2*j* can go negative.
在2022年8月15日星期一 UTC-7 05:28:35 写道:
>
Thanks, that solution works.
Now I'm confused again on the solution for test set 2.
The formula for g(x) is a product of
Fraction(1, math.comb(m, 2)-math.comb(m-2*j, 2))
where j goes from 1 to i, but then i itself goes from k to m. This means
that m-2*j can go negative, e.g. with k=2 and m=5,
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 input().split