Here is the link to the editorial. Feel free to discuss problems and ask me questions. I'll be glad to improve the editorial with your comments.

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

1 | tourist | 3870 |

2 | Benq | 3618 |

3 | Miracle03 | 3453 |

4 | peehs_moorhsum | 3430 |

5 | Radewoosh | 3418 |

6 | Petr | 3408 |

7 | maroonrk | 3387 |

8 | sunset | 3338 |

9 | ko_osaga | 3334 |

9 | jiangly | 3334 |

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

1 | YouKn0wWho | 214 |

2 | 1-gon | 203 |

3 | Um_nik | 195 |

4 | Errichto | 181 |

5 | awoo | 180 |

6 | tourist | 176 |

6 | sus | 176 |

8 | antontrygubO_o | 173 |

9 | maroonrk | 170 |

10 | -is-this-fft- | 168 |

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Dec/07/2021 15:33:29 (g2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

I'm not getting div2 c ...how it is linked to knapsack?? can you explain the logic more clearly??

We want to find the probability of gaining i scores in games other than G. It's similar to finding in how many ways we gain i scores. It's a knapsack problem.

we need to gain i scores in such a way that after adding G to it .It must become greater than n*(n+1)/4.In other words we need to look for only those i's such that after adding G to it ,it can become greater than n*(n+1)/4.Am i right?

and we'll use knapsack to find those i's and we won't be using G as a weight?

Correct.

Thank you :)