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

2022-11-09 Thread soatmominovo
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

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

2022-08-19 Thread porker2008
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 写道: >

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

2022-08-15 Thread gyorok...@gmail.com
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,

[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 input().split