arthur_9548's blog

By arthur_9548, 6 months ago, In English

We hope everyone enjoyed the problems of XIII UnB Contest Mirror! This editorial contains the description of the solutions and their implementation. Feel free to discuss them in the comments!

Problem A

Solution
Code

Problem B

Solution
Code

Problem C

Solution
Code

Problem D

Solution
Code

Problem E

Solution
Code

Problem F

Solution
Code

Problem G

Solution
Code

Problem H

Solution
Code

Problem I

Solution
Code

Problem J

Solution
Code

Problem K

Solution
Code

Problem L

Solution
Code

Problem M

Solution
Code

Problem N

Solution
Code
  • Vote: I like it
  • +13
  • Vote: I do not like it

»
6 months ago, hide # |
 
Vote: I like it +12 Vote: I do not like it

Fast and nice editorial, thanks!!

»
6 months ago, hide # |
 
Vote: I like it +12 Vote: I do not like it

The problems C and L are my favorites!

»
6 months ago, hide # |
 
Vote: I like it +12 Vote: I do not like it

Awesome! Thanks for the contest.

»
6 months ago, hide # |
 
Vote: I like it +15 Vote: I do not like it

Also, using python in problem L, I calculated the full answer with the formula, printed it modulo 10^9 + 7 and passed.

  • »
    »
    6 months ago, hide # ^ |
     
    Vote: I like it +8 Vote: I do not like it

    nice, samu! however, this code in c++ is also very simple. to calculate a/b in modular arithmetic, we can do a*(b^(mod-2)), with mod being a prime (like 1e9+7). this means multiplying a by the multiplicative inverse of b, which is possible 'cause of fermat's little theorem. for the other operations (+, — and *), you can just apply the mod directly.