By mesanu, history, 17 hours ago, In English

Hello Codeforces!

flamestorm, MikeMirzayanov and I want to invite you to Codeforces Round 898 (Div. 4).

It starts on Sep/21/2023 17:35 (Moscow time).

The format of the event will be identical to Div. 3 rounds:

  • 5-8 tasks;
  • ICPC rules with a penalty of 10 minutes for an incorrect submission;
  • 12-hour phase of open hacks after the end of the round (hacks do not give additional points)
  • after the end of the open hacking phase, all solutions will be tested on the updated set of tests, and the ratings recalculated
  • by default, only "trusted" participants are shown in the results table (but the rating will be recalculated for all with initial ratings less than 1400 or you are an unrated participant/newcomer).

We urge participants whose rating is 1400+ not to register new accounts for the purpose of narcissism but to take part unofficially. Please do not spoil the contest for the official participants.

Only trusted participants of the fourth division will be included in the official standings table. This is a forced measure for combating unsporting behaviour. To qualify as a trusted participant of the fourth division, you must:

  • take part in at least five rated rounds (and solve at least one problem in each of them),
  • do not have a point of 1400 or higher in the rating.

Regardless of whether you are a trusted participant of the fourth division or not, if your rating is less than 1400 (or you are a newcomer/unrated), then the round will be rated for you.

Many thanks to the testers: Gheal, Phantom_Performer, KrowSavcik, haochenkang, sandry24, BucketPotato, Vladosiya, NintsiChkhaidze, erekle, Dominater069, MADE_IN_HEAVEN, Qualified.

We suggest reading all of the problems and hope you will find them interesting!

Good Luck!

Full text and comments »

  • Vote: I like it
  • +105
  • Vote: I do not like it

By glebustim, history, 5 days ago, translation, In English

Hello, Codeforces!

SomethingNew and I are glad to invite you to CodeTON Round 6 (Div. 1 + Div. 2, Rated, Prizes!), which will take place on Sep/18/2023 17:35 (Moscow time). You will have 2 hours 15 minutes to solve 8 problems. The round will be rated for everyone.

We would like to thank:

Score distribution:

500 — 750 — 1500 — 1750 — 2750 — 3250 — 3250 — 4000

We hope that our problems will be interesting for you!


Congratulations to the winners!

  1. orzdevinwang
  2. cnnfls_csy
  3. jiangly
  4. emptyhope
  5. maspy
  6. tourist
  7. AoLiGei
  8. Um_nik
  9. noimi
  10. Geothermal

And here is the information from our title sponsor:

Hello, Codeforces!

We, the TON Foundation team, are pleased to support CodeTON Round 6.

The Open Network (TON) is a fully decentralized layer-1 blockchain designed to onboard billions of users to Web3.

Since July 2022, we have been supporting Codeforces as a title sponsor. This round is another way for us to contribute to the development of the community.

The winners of CodeTON Round 6 will receive valuable prizes.

The first 1,023 participants will receive prizes in TON cryptocurrency:

  • 1st place: 1,024 TON
  • 2–3 places: 512 TON each
  • 4–7 places: 256 TON each
  • 8–15 places: 128 TON each
  • 512–1,023 places: 2 TON each

We wish you good luck at CodeTON Round 6 and hope you enjoy the contest!

Full text and comments »

  • Vote: I like it
  • +405
  • Vote: I do not like it

By salyg1n, 12 days ago, translation, In English

Hello, Codeforces! 🤯

green_gold_dog, ace5, bashkort and I salyg1n are pleased to invite you to participate in Codeforces Round 897 (Div. 2), which will take place on Monday, September 11, 2023 in 17:35.

This round will be rated for participants whose rating is below 2100.

You will be given 6 tasks and 2 hours to solve them. We recommend reading all the tasks. Interactive tasks may occur in the round, so we suggest reading this post.

We want to thank:

We hope you'll enjoy our problems! Good luck!

UPD. Score distribution: $$$500 - 1000 - 1250 - 2000 - (2000 + 1000) - 4000$$$.

UPD2. Congratulations to the winners!

Div. 2

  1. candidatecandidatemaster

  2. Coreopsis

  3. iFFT

  4. Dorothy__

  5. wfoifysaasisufgv

Div. 1

  1. Golovanov399

  2. Geothermal

  3. arvindf232

  4. Rubikun

  5. Vercingetorix

UPD3. Editorial.

Full text and comments »

  • Vote: I like it
  • +272
  • Vote: I do not like it

By sszcdjr, 3 weeks ago, In English

Hello, Codeforces! & Happy Chinese Teachers' Day!

We (OICon Team) are so excited to invite you to take part in OICon Round 1 (Codeforces Round 896 (Div. 1) and Codeforces Round 896 (Div. 2)) which will start on Sep/10/2023 17:05 (Moscow time). You will be given 6 problems and 2.5 hours to solve them in both divisions.

  • Please notice the unusual starting time!
  • One of the problems has two versions but their statement are not exactly the same, which means that you can't pass the easy version using the code of the hard version. However, you can only make hacks when you pass both versions.
  • There will be $$$0$$$ interactive problem in each division so you needn't read the guide for interactive problems.
  • Score distribution:
    • Div. 1: $$$500-(500+750)-1000-1750-2500-3000$$$
    • Div. 2: $$$500-750-1250-(1250+1500)-2500-3250$$$

The problems were authored and prepared by Error_Yuan, duck_pear, programpiggy and me.

We would like to thank:

Good Luck & Have Fun!


UPD1. Editorial is out.

UPD2. Contest is over! Congratulations to the winners!

First Solves in Div 2:

Full text and comments »

  • Vote: I like it
  • +350
  • Vote: I do not like it

By sevlll777, history, 2 weeks ago, translation, In English

Hello Codeforces! Codeforces Round 895 (Div. 3) will start at Sep/07/2023 17:35 (Moscow time). You will be offered 7 problems with expected difficulties to compose an interesting competition for participants with ratings up to 1600. However, all of you who wish to take part and have a rating of 1600 or higher, can register for the round unofficially.

The round will be hosted by rules of educational rounds (extended ICPC). Thus, solutions will be judged on preliminary tests during the round, and after the round, it will be a 12-hour phase of open hacks.

You will be given 7 problems and 2 hours and 15 minutes to solve them.

Note that the penalty for wrong submission in this round is 10 minutes.

Remember, that only the trusted participants of the third division will be included in the official standings table. As it is written by link, this is a compulsory measure for combating unsporting behavior. To qualify as a trusted participant of the third division, you must:

  • take part in at least five rated rounds (and solve at least one problem in each of them)
  • do not have a point of 1900 or higher in the rating.

Regardless of whether you are a trusted participant of the third division or not, if your rating is less than 1600, then the round will be rated for you.

Problems have been created and prepared by: Alexdat2000, FairyWinx, sevlll777, Vladosiya, и MikeMirzayanov.

We would also like to thank:

  1. Vladosiya for the amazing coordination, and help with preparing and balancing a problemset.
  2. MikeMirzayanov for Polygon and Codeforces platforms.
  3. Ormlis for black-red testing.
  4. zwezdinv, BledDest for red testing.
  5. Sokol080808, diskoteka, Sweezy, vladmart, Kniaz, Tima, Riblji_Keksic, 74TrAkToR, pavlekn for yellow testing.
  6. notyourbae, gs20036, Kolychestiy for purple testing.
  7. martin0327, tnaito, TooManyMind, Pa_sha, SashaT9, ctraxxd, ezdp, Nafis for blue testing.
  8. NerfThis, _SADIEM_, YudoTLE, sayed_4 for cyan testing.

Good luck!

UPD: Editorial

Full text and comments »

  • Vote: I like it
  • +278
  • Vote: I do not like it

By Pyqe, history, 3 weeks ago, In English


Hello, Codeforces! 😍😍

We are happy to invite you to participate in COMPFEST 15 Preliminary Online Mirror (Unrated, ICPC Rules, Teams Preferred) on . COMPFEST is a national ICPC-style contest for university students in Indonesia.

The problems are written and prepared by ArvinCiu, asteriskzie, CyberSleeper, Edbert.H, FreeJinG, gansixeneh, KokiCoder, nandonathaniel, and Pyqe.

We would also like to thank:

The contest will last for 5 hours and consist of 13 problems. The statements will only be available in English. While it is preferred to participate in a team, individual participation is also allowed.

COMPFEST itself is an annual event hosted by Universitas Indonesia. It is the largest student-run IT event in Indonesia and competitive programming contest is one of the competitions hosted.

We hope you will enjoy and have fun in the contest. Good luck! 🔥🔥🔥🔥

UPD: Contest is over!

Congratulations for our first solvers!

Editorial is available here!

Full text and comments »

  • Vote: I like it
  • +308
  • Vote: I do not like it

By awoo, history, 3 weeks ago, translation, In English

Hello Codeforces!

On Aug/31/2023 17:35 (Moscow time) Educational Codeforces Round 154 (Rated for Div. 2) will start.

Series of Educational Rounds continue being held as Harbour.Space University initiative! You can read the details about the cooperation between Harbour.Space University and Codeforces in the blog post.

This round will be rated for the participants with rating lower than 2100. It will be held on extended ICPC rules. The penalty for each incorrect submission until the submission with a full solution is 10 minutes. After the end of the contest, you will have 12 hours to hack any solution you want. You will have access to copy any solution and test it locally.

You will be given 6 or 7 problems and 2 hours to solve them.

The problems were invented and prepared by Adilbek adedalic Dalabaev, Ivan BledDest Androsov, Maksim Neon Mescheryakov, Roman Roms Glazov and me. Also, huge thanks to Mike MikeMirzayanov Mirzayanov for great systems Polygon and Codeforces.

Additionally, big thanks to the tester stAngel for their valuable advice and suggestions!

Good luck to all the participants!

Our friends at Harbour.Space also have a message for you:


Harbour.Space University has partnered with Giga (UNICEF) to offer Master’s degree scholarships in the field of Data Science, as well as work experience.

We are looking for various junior to mid level candidates:

Data Scientist:

  • Strong ML knowledge
  • Experience with Data Visualization Tools like matplotlib, ggplot, d3.js., Tableau that helps to visually encode data
  • Excellent Communication Skills – it is incredibly important to describe findings to a technical and non-technical audience
  • Strong Software Engineering Background
  • Hands-on experience with data science tools
  • Problem-solving aptitude
  • Analytical mind and great business sense
  • Degree in Computer Science, Engineering or relevant field is preferred

Data Analyst:

  • Cleansing and preparing data
  • Analyzing and exploring data
  • Expertise in statistics
  • Analyzing and visualizing data
  • Reports and dashboards
  • Communication and writing
  • Expertise in the domain
  • Solution-oriented

All successful applicants will be eligible for a 100% tuition fee scholarship (29.900 €/year) provided by the partner company.


Study Commitment: 3 hours/day

You will complete 15 modules (each three weeks long) in one year. Daily class workload is 3 hours, plus homework to complete in your own time.

Work Commitment: 4+ hours/day

Immerse yourself in the professional world during your apprenticeship. You’ll learn from the best and get to apply your newly acquired knowledge in the field from day one.


  • Industry experience
  • International exposure
  • Eager to learn
  • Sustainability is a key topic for you
  • You want to work for an NGO
Apply here →

UPD: Editorial is out

Full text and comments »

  • Vote: I like it
  • +107
  • Vote: I do not like it

By pinely, 4 weeks ago, translation, In English

Hey, Codeforces!

Pinely is here! Just like every year, we are sponsoring the PTZ competitive programming camp. As a part of this, we have prepared a contest for the participants and invite everyone to join it on Codeforces.

Pinely Round 2 (Div. 1 + Div. 2) is scheduled to start on Aug/30/2023 17:35 (Moscow time).

During this round, you will have the opportunity to solve 9 problems within a time frame of 3 hours. The round will be rated for everyone.

The problems have been authored and prepared by the Pinely team: AndreySergunin, ch_egor, Endagorion, amethyst0, zeliboba, zemen along with our special friend Golovanov399.

We would like to express our special thanks to:

We sincerely hope that you enjoy our contest. Wishing you good luck and lots of fun!

P.S. If you are interested in working at Pinely, please visit our website:, send us an email at [email protected] or fill in the form here


Congratulations to the winners!

  1. tourist
  2. Radewoosh
  3. QAQAutoMaton
  4. jiangly
  5. Ormlis


Full text and comments »

  • Vote: I like it
  • +472
  • Vote: I do not like it

By amiya, history, 2 months ago, In English

Hello everyone, we are happy to announce that the 2nd Universal Cup has started officially.

The Universal Cup is a non-profit organization dedicated to offering training resources for competitive programming teams. Our website is (in English and Chinese).

In the previous season, over 750 teams from more than 300 affiliations all over the world, registered and participated in a total of 22 stages, encompassing contests from Asia, Europe, and America.

With the permission of contest setters and without involving copyright disputes, the Universal Cup will hold mirror contests for some undisclosed competition sets. It is expected to hold at least 20 contests in this season. We will simulate the actual situation in the competition, executing the board freeze in the last hour. At the same time, we will provide an overall rating board, which will help the team to make a reasonable assessment of itself.

Over the past few weeks, the committee has worked hard to schedule stages and try to improve the competing experience for participants. We are very excited to share some information here as a head up:

  • In the upcoming 2nd Universal Cup, starting from September 2nd, 2023, we have already scheduled 14 high-quality stages from Asia and Europe mainly. The current schedule can be viewed on the main page of our website

  • There are also 4 stages (expected on October 7th, 14th, 21st, and December 9th) in confirming. The schedule in the second half will also be updated later.

  • We have managed to upgrade our judging system on QOJ, and we will use it as the contest platform starting this season. To provide more flexibility, instead of 3 fixed time windows, teams now can choose to start to compete in one of the following 6 windows as they want:

    • 13:00 (UTC +8) on Saturday ~ 18:00 (UTC +8) on Saturday
    • 16:00 (UTC +8) on Saturday ~ 21:00 (UTC +8) on Saturday
    • 19:00 (UTC +8) on Saturday ~ 24:00 (UTC +8) on Saturday
    • 21:00 (UTC +8) on Saturday ~ 02:00 (UTC +8) on Sunday
    • 23:00 (UTC +8) on Saturday ~ 04:00 (UTC +8) on Sunday
    • 02:00 (UTC +8) on Sunday ~ 07:00 (UTC +8) on Sunday
  • For teams that have already registered, if they have done at least 3 contests in the previous season, their account will be preserved and enrolled into the current season automatically. Otherwise, the same as new teams, please register following the instructions on Registration.

  • The official website has been upgraded. You are able to view all information from the previous by simply choosing the corresponding season on the website.

The first contest will be the stage Qingdao on September 2nd, 2023. The contest source is The 2018 ACM-ICPC Asia Qingdao Regional Online Contest prepared by SUA Problem Setter Team. For a great number of Chinese teams, we believe this will be a good practice to prepare for the upcoming ICPC preliminary online contests in late September.

As well as many other future stages, this stage will be uploaded to Gym afterward. We are grateful to MikeMirzayanov for letting us advertise Universal Cup in Codeforces and providing the great platform Codeforces and Polygon to help prepare contests. We are also very thankful to all contest setters of stages for your support to the Universal Cup. If any setter would like to propose a stage, please feel free to contact us.

Universal Cup Committee:

(Sorted by lexicographical order of the last name)

Full text and comments »

  • Vote: I like it
  • +654
  • Vote: I do not like it

By Parisa_Amiri, 5 weeks ago, In English

Salam, Codeforces! $$$\color{white}{\text{ «Be attentive about your thought that becomes your behavior» «Be attentive about your behavior that becomes your speech» «Be attentive about your speech because it becomes your habit»«Be attentive about your habit because it becomes your personality»«Be attentive about your personality because it becomes your destiny» Said by: Imam Ali}}$$$

We're so excited to invite you to take part in our round Harbour.Space Scholarship Contest 2023-2024 (Div. 1 + Div. 2) which will start on Aug/26/2023 17:35 (Moscow time). The round will be rated and open for everyone.

The problems were prepared and authored by amenotiomoi, Psychotic_D, wuhudsm, Parisa_Amiri, chromate00, JohnVictor, ODT, ugly2333, Lavine, RiverHamster, flowerletter and AquaMoon.

We would like to thank :

You will be given $$$9$$$ problems and $$$3$$$ hours to solve!

Score Distribution:


UPD1 : Editorial is out.

UPD2 :

First Solve

Problem Name
A qiuzx
B noimi
D Um_nik
E Geothermal
F MysticPanda
G Radewoosh
H maroonrk
I Radewoosh, One and only Orz

Top Performers

Rank Name
1 Radewoosh
2 maroonrk
3 amiya
4 Benq
5 Um_nik
6 jiangly
8 noimi
9 hos.lyric
10 Brewess

GL & HF ;)

Sign up for the contest →

This round wouldn't have been possible without Harbour.Space University's support.

This contest is for all interested eligible programmers who want to start their bachelor and master studies in Barcelona, Spain or Bangkok, Thailand, and join ICPC team.

For the next academic year (2023/24), Harbour.Space University is recruiting a fascinating community of competitive programmers from the top prize-winners of international Olympiads to join one of several competitive programming teams at the university.

In the next few years, their goal is to continue winning SWERC and competing at a high level in the ICPC globally. Therefore they want to invest a serious amount of energy, resources, and talent into these activities.

That’s why you are invited on an exciting journey in the company of like-minded people, outstanding coaches, and ongoing partnership Harbour.Space University with Codeforces.

Over 100 educational rounds were already organized, so the time has come to test our joint efforts and reward the most diligent.

Here’s what you win if you place in the contest:

Codeforces and Harbour.Space

The monthly living allowance throughout the entire duration of studies may vary depending on the overall performance of the students as measured by their GPA, professional achievements and official ICPC competition results. As a guideline, it is in the range of 700-1500 EUR (it might be applied to the contestants who win 4th-10th places).

No application fee is required for any of the awards listed above.

Good luck, and may the code be with you!

Full text and comments »

  • Vote: I like it
  • +614
  • Vote: I do not like it