YouKnowCipher's blog

By YouKnowCipher, history, 22 months 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
  • +8
  • Vote: I do not like it

| Write comment?
»
22 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Hints are awesome.

»
22 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

-Thank you fo mach

»
22 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

»
22 months ago, hide # |
← 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 \gt 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

»
22 months ago, hide # |
 
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

»
22 months ago, hide # |
← Rev. 4  
Vote: I like it 0 Vote: I do not like it

here is the solution for F [sorry it's pretty long for an editorial]

2051F - Joker

Hints
Tutorial