problem : LTIME87A conting graphs

https://www.codechef.com/viewsolution/37289982

1 Like

\dfrac{n(n - 1)}{2} > 2^{31} - 1 for n = 10^5

2 Likes

yes i tried this also, it didn’t work.

https://www.codechef.com/viewsolution/37290499

i also tried to use a combinations fuction from my past submission which was limited for N <= 5e5.

https://www.codechef.com/viewsolution/37286136

atleast there is one green line in this.

In this line : “(ans *= ncr.get(extra,avail)) %= mod;” the avail variable can reach O(N^2) crossing the limit. How? consider (N-1) nodes with A_i = 1. where N = 1e5.

1 Like