YouKnowCipher's blog

By YouKnowCipher, history, 5 hours ago, In English

Many thanks to BledDest for the excellent problem set. However, the last two problems are quite difficult for me to solve. Therefore, I am sharing my thoughts on the first five problems.

2051A — Preparing for the Olympiad

Hint
Tutorial
Implementation

2051B — Journey

Hint
Tutorial
Implementation

2051C — Preparing for the Exam

Hint
Tutorial
Implementation

2051D — Counting Pairs

Hint
Tutorial
Implementation

2051E — Best Price

Hint
Tutorial
Implementation
  • Vote: I like it
  • +7
  • Vote: I do not like it

»
4 hours ago, # |
  Vote: I like it +1 Vote: I do not like it

Hints are awesome.

»
4 hours ago, # |
  Vote: I like it +1 Vote: I do not like it

-Thank you fo mach

»
3 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Bhai complexityr jonno catagory na koira Tutorialer niche diya dile valo hoi.

»
107 minutes ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

There's a $$$\mathcal{O}(m + q)$$$ solution for C. Case where $$$n - k$$$ is 0, or $$$n - k > 1$$$ is handled similarly for yours, however, for $$$n - k = 1$$$, we'll do things a bit differently. Since we know that $$$q$$$ contains of $$$k$$$ distinct integers that should sum up to $$$n$$$, but there's one missing integer, the missing integer will be $$$x = \sum\limits_{i=1}^n i - \sum\limits_{i=1}^k q_i = \frac{n * (n - 1)}{2} - \sum\limits_{i=1}^k q_i$$$, so the answer will be 1 for $$$i$$$ which $$$a_i = x$$$ and 0 otherwise

»
80 minutes ago, # |
  Vote: I like it +1 Vote: I do not like it

There is a simple binary search solution for E too.
Check my submission
298020385

»
21 minute(s) ago, # |
  Vote: I like it 0 Vote: I do not like it

Solved the fifth problem after seeing your hint. This hints make your editorials the best than the official one.