Can somebody please tell how to solve this problem using SQRT decomposition method. I did'nt found any correct way to implement?

Thanks

Before contest

Contest 2050 and Codeforces Round #718 (Div. 1 + Div. 2)

39:53:15

Register now »

Contest 2050 and Codeforces Round #718 (Div. 1 + Div. 2)

39:53:15

Register now »

*has extra registration

# | User | Rating |
---|---|---|

1 | tourist | 3682 |

2 | ecnerwala | 3603 |

3 | Benq | 3549 |

4 | Radewoosh | 3494 |

5 | Petr | 3452 |

6 | ksun48 | 3413 |

7 | maroonrk | 3406 |

8 | Miracle03 | 3314 |

9 | scott_wu | 3313 |

10 | Um_nik | 3299 |

# | User | Contrib. |
---|---|---|

1 | 1-gon | 214 |

2 | Errichto | 188 |

3 | awoo | 187 |

3 | rng_58 | 187 |

5 | SecondThread | 184 |

6 | Um_nik | 177 |

7 | Ashishgup | 176 |

8 | maroonrk | 173 |

9 | antontrygubO_o | 171 |

10 | -is-this-fft- | 169 |

Can somebody please tell how to solve this problem using SQRT decomposition method. I did'nt found any correct way to implement?

Thanks

Can anybody please tell how to solve This problem..

Can someone please help in This problem.

Can someone please tell how to solve This problem

Can anyone please tell how to solve This Problem

Can Someone please tell how to solve This problem..

Thanks.:)

Hello, Can anyone please tell how to solve below problem — There exists a special graph which has directed M edges and N nodes and graph contains no cycles. Count the number of ways to reach different nodes from S. A way is called different from others if the destination node or used edges differ. As the ways can be large, print the ways modulo 1000000007. Include source node as destination also. 1 <= S, N <= 100005 (S=source vertex) (N=number of nodes) 1 <= M <= 200005 (number of edges) 1 <= x , y <= N (edge from x to y)

My approach is to use dp on tree 1)Make a reverse graph (all edges are in reverse order) 2)call DP recursive function for all nodes who are not yet visited 3)Inside Dp recursive function call for number of ways to reach to parent of current node from Source(S)(Using the reverse graph) and add all those ways to dp[current_node] 4)return dp[current node] But this approach is giving TLE in some testcases. Please suggest some ideas... Problem link

Thanks :)

Hello, can any one please tell how to solve This problem

Hello, can any one please tell how to solve This question

Hello, can any one please tell how to solve this question

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Apr/22/2021 01:41:45 (j2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|