Hello! Here is editorial!

**Editorial**

**Code**

Task B — Roman and lost numbers

**Editorial**

**code**

**Editorial**

**Code**

**Editorial**

**Code**

Task E — Roman and summer vacations

**Editorial**

**Code**

Task F — Roman and hard experiment

**Editorial**

**Code**

Before contest

EPIC Institute of Technology Round August 2024 (Div. 1 + Div. 2)

06:02:51

Register now »

EPIC Institute of Technology Round August 2024 (Div. 1 + Div. 2)

06:02:51

Register now »

*has extra registration

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

1 | tourist | 3947 |

2 | ecnerwala | 3654 |

3 | jiangly | 3627 |

4 | jqdai0815 | 3620 |

5 | orzdevinwang | 3612 |

6 | Benq | 3586 |

7 | Radewoosh | 3582 |

8 | Geothermal | 3569 |

8 | cnnfls_csy | 3569 |

10 | ksun48 | 3474 |

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

1 | awoo | 163 |

2 | maomao90 | 160 |

3 | adamant | 156 |

4 | atcoder_official | 155 |

5 | maroonrk | 152 |

6 | cry | 150 |

7 | nor | 149 |

8 | -is-this-fft- | 148 |

8 | SecondThread | 148 |

10 | Petr | 147 |

Hello! Here is editorial!

I want to make some comments. long long should not work, but I forgot to make 10^18 after testing. I see many WA, because trunk(ans) returns double, you shold return int. Many people asked me about divide by zero. But in statements you can see, that answer exists. Task is simple if you are using Python or int128 on C++.

Task B — Roman and lost numbers

At first, s >= uneven num, because min uneven is 1 and uneven sum of should be not less than s. At second, s % 2 must be same as uneven sum % 2, because only uneven can change parity. That's all

You should see, that we answer requests in real time. For 1-st type we add name to set. For 2-nd type we check if the name is in set.

It is standart task. For sum you should use segment tree or prefix sums. For max we should build ST for max. Now we should print sum(l, r) — max(l, r)

Task E — Roman and summer vacations

All you should do is to find Pascal triangle. Now we find his tier: n = i + j — 2 and number: k = j — 1. Find answer as n! / k! / (n — k)! by module $$$10^9$$$ + 7. We take factorial by module dynamically

Task F — Roman and hard experiment

You should use mathematically expectation formule and no more. Here is explanations for it: a person turn right wuth probability $$$a[i]$$$, and go straight with probability $$$100-a[i]$$$ .

↑

↓

Codeforces (c) Copyright 2010-2024 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Aug/11/2024 11:32:09 (f1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

I'm sorry if you can not understand sth. I want sleep:)

I think "parse" should be replaced by "editorial" everywhere, is it a mistranslation?

Yes

Done!

When clicking on your hyperlink to codes, it gives me

`You're not allowed to view the requested page`

Register in contest

E was good. I was doing n(n-1)(n-2)..../2*3*4..mod 1e9+7 but that was wrong solution. Btw, what's the intuition behind the formula for i+j-2 for finding the nth row?

Edit: nvm I wasn't dividing properly for the above formula to work. Thanks for the contest learned inverse mod division.

You 're welcome

A very good contest for beginners.

Thank u!