**Hint**

**Hint**

**Solution**

**Hint**

**Solution**

1839C - Insert Zero and Invert Prefix

**Hint**

**Hint**

**Hint**

**Solution**

**Hint**

**Hint**

**Solution**

**Hint**

**Hint**

**Hint**

**Hint**

**Solution**

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

1 | Radewoosh | 3759 |

2 | orzdevinwang | 3697 |

3 | jiangly | 3662 |

4 | Benq | 3644 |

5 | -0.5 | 3545 |

6 | ecnerwala | 3505 |

7 | tourist | 3486 |

8 | inaFSTream | 3478 |

9 | maroonrk | 3454 |

10 | Rebelz | 3415 |

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

1 | adamant | 173 |

2 | awoo | 167 |

3 | nor | 164 |

4 | SecondThread | 162 |

5 | BledDest | 161 |

5 | maroonrk | 161 |

5 | Um_nik | 161 |

8 | -is-this-fft- | 149 |

9 | Geothermal | 146 |

10 | ko_osaga | 142 |

The first and last elements are always equal to $$$1$$$.

There are at least $$$\lceil \frac{n - 1}{k} \rceil$$$ ones among the first $$$n - 1$$$ elements.

Tutorial is loading...

Try to solve the problem if all $$$a_i$$$ are equal.

Tutorial is loading...

1839C - Insert Zero and Invert Prefix

After every operation, the last element of $$$b$$$ is equal to $$$0$$$.

If the last element of $$$a$$$ is $$$0$$$, then you can always achieve $$$b = a$$$ with some sequence of operations.

Try to solve the problem if $$$a$$$ consists of $$$k$$$ ones followed by single zero.

Tutorial is loading...

Consider the set of balls that were never moved by operations of type 2.

The relative order of these balls never changes, so their colors must form an increasing sequence.

Tutorial is loading...

Consider the graph with $$$n$$$ vertices $$$1, 2, \ldots, n$$$, and on each round of the game, connect vertices $$$i$$$ and $$$j$$$. What can you say about this graph?

This graph is a tree.

Vertices of a tree can be divided into two parts, such that all edges connect vertices from different parts.

If the second player won the game, then sums of elements in both parts were equal in initial array $$$a$$$.

Tutorial is loading...

Tutorial of Codeforces Round 876 (Div. 2)

Hello, Codeforces!

I invite you to participate in Codeforces Round 876 (Div. 2), which will be held on Jun/03/2023 17:35 (Moscow time).

The round will be rated for participants with rating lower than 2100. Participants with higher rating can participate in round unofficially.

You will be given 5 problems and 2 hours to solve them. I recommend you to read all problems. One of the problems will be interactive, so please read guide for interactive problems before the contest.

All problems are authored by me.

I would like to thank:

- Renatyss for helping with preparation and discussing the problems.
- IgorI for great round coordination.
- bashkort, Allvik06, Ormlis, satyam343, maomao90, Dominater069, Yuu, Kirill020708, asafiul, iliya_mon, sdyakonov, tallbee23, Asgat, AquaMoon for testing the round and providing useful feedback.
- MikeMirzayanov for Codeforces and Polygon platforms.

Score distribution: 500 — 1000 — 1500 — 2250 — 2750.

Good luck to all participants!

Editorial has been published.

Winners:

Unofficial winners:

First-to-solve:

- A. M_bolshakov — 0:01.
- B. Never_Lose — 0:05.
- C. SSRS_ — 0:10.
- D. BucketPotato — 0:18.
- E. BeyondHeaven — 0:22.

Announcement of Codeforces Round 876 (Div. 2)

Codeforces (c) Copyright 2010-2023 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Dec/06/2023 10:19:22 (j3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|