Hello, Codeforces!
We gladly invite you to participate in Codeforces Round 1058 (Div. 1, Div. 2), which will be held on 12.10.2025 17:35 (Московское время)! You will be given $$$\mathbf{2.5}$$$ hours to solve $$$\mathbf{6}$$$ or $$$\mathbf{7}$$$ problems (depending on your division). One problem will be divided into two subtasks.
The problems were authored by wuhudsm, Proof_by_QED and chromate00. We have put so much effort (and time) into this contest, and we hope you will enjoy it!
Do note that for both divisions, at least one of the problems will be interactive. So if you are unfamiliar with them, please read the guide for interactive problems and get yourself ready.
Our team would like to thank the following people:
- TheScrasse for coordinating the round and believing in us for such a long time;
- Alexdat2000 for translating statements in this and every other contest;
- cry and sum for earning the "professional relaxer" title by not proposing problems;
- satyam343, BurnedChicken, zeemanz for VIP testing;
- Um_nik for shortly taking a look at the problemset;
- A_G, _istil, sammyuri, fextivity, cadmiumky, Dragos, IBory, szilb, awoo, rhombus, efishel, Intellegent, turska, adamant, beaaaan, spike1236, ArshiaDadras, qwexd, reirugan, rewhile, harshith_04, macaquedev, Edeeva, IvanBorquez, ProofByContradiction_, DivinePunishment, larush, tin.le2, ymwang, Non-origination, SpyrosAliv, and ALnQ417 for testing the problemset and helping us improve it;
- MikeMirzayanov and KAN for great platforms Codeforces and Polygon;
- and last but not least, You for participating!
And now, the score distribution.
Division 1:
| A | B | C | D | E | F |
|---|---|---|---|---|---|
| $$$750$$$ | $$$1500$$$ | $$$1500$$$ | $$$(1500+1750)$$$ | $$$3000$$$ | $$$3500$$$ |
| A | B | C | D | E | F | G |
|---|---|---|---|---|---|---|
| $$$500$$$ | $$$1000$$$ | $$$1250$$$ | $$$1750$$$ | $$$2500$$$ | $$$2500$$$ | $$$(2500+2750)$$$ |
Good luck, and I hope you find enlightment from the problemset!
UPD: Editorial is uploaded here.
Also UPD by chromate00: I sincerely apologize about the weak pretests of problem 1B/2E. I have greatly underestimated the runtime and memory usage of the worst solutions, while still wanting to be generous about slower solutions. This has led to weak tests during contest. Deeply sorry about the bad contest experiences affected by this.







Hola, Codeforces!

Hello Codeforces!