Skip to main content
  1. Editorial/

Codeforces Educational Round 168 Discussion stream (with hints)

·160 words·1 min
aryanc403
Author
aryanc403
Asia West Champion, ICPC World Finals 2021 | CodeChef Snackdown, World Finalist 2021
Table of Contents

A. Strong Password
#

Hint

When you insert a new character, cost of only 2 elements changes.

Video Editorial

B. Make Three Regions
#

Idea

Type of cells that can split into 3 components has a fixed pattern.

Video Editorial

C. Even Positions
#

Hint

You can always ensure that any prefix of odd length does not contains more than one extra opening bracket.

Video Editorial

D. Maximize the Root
#

Hint

Binary search FTW

Video Editorial

E. Level Up
#

Hint 1

First read all the queries. Group all queries with same $X$ together and try to answer them in one go.

Hint 2

For a fixed value of $K$, you can binary search to find the $j \cdot k^{\text{th}}$ monster, the fight after which level will change.

Hint 3

Use Merge sort tree along with binary search for $O((N+Q) \cdot \log^4 N)$ solution.

Hint 4

Walk on a Segment Tree to remove one $\log N$ factor.

Video Editorial