By peltorator, 6 weeks ago, translation, In English


I continue to make videos on algorithms. This time the topic is more basic. In this video, I talk about prefix sums and how they can help you to find sum on segments. You can also learn from this video how to easily generalize prefix sums for 2D, 3D, 4D, etc. cases. In addition, we'll also talk about a simple concept named difference array, which can easily help in some sorts of situations where it seems like you need some complex data structures. And in the end, we'll learn how to add constants, arithmetic progressions, and even quadratic functions to a segment of an array.

Link to the video

The video is in Russian but English subtitles are available. I'd be glad if you watch the video and leave a comment below with your impressions, thoughts, and ideas for future videos. You may also want to text me on telegram if you didn't understand something or you have any questions. I'll be glad to answer!

I'm sorry you need to watch it with subtitles but I'm gonna make an English channel soon. So stay tuned!

If you didn't see it already, I also have a video on disjoint sparse table: here.

Codeforces group with a contest

My realizations:

1D prefix sums

1D prefix sums with structures

2 methods for finding 2D prefix sums: one, two

1D difference array

1D difference array with structures

Read more »

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

By AlFlen, 7 weeks ago, translation, In English

The future is bulletproof
The aftermath is secondary
It's time to do it now and do it loud!

Hello, Codeforces!

74TrAkToR and I are glad to invite you to our Codeforces Round #705 (Div. 2), which will be held at Mar/06/2021 17:05 (Moscow time). Notice the unusual time of the round. The round will be rated for all the participants with rating strictly less than 2100.

We have already held a round and we have worked on errors:

  • the statements will be short and clear
  • we tried to make pretests stronger
  • the editorial will be published shortly after the round ends

We would like to thank everyone who helped us a lot with round preparation.

You will be given 6 problems. You will have 2 hours 15 minutes to solve them.

UPD: Score distribution $$$750-1250-1750-2250-2750-3250$$$.

UPD2: Editorial

UPD3: Congratulations to the winners!

Div. 2:

  1. sawa855

  2. buihoatpt2k9

  3. Totiniii

  4. rainboy

  5. scli_kws

Div. 1 + Div. 2:

  1. neal

  2. BigBag

  3. fastmath

  4. Heltion

  5. tute7627

We wish everyone good luck!

Read more »

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

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

Hello Codeforces!

On Mar/02/2021 17:45 (Moscow time) Educational Codeforces Round 105 (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 Roman Roms Glazov, Adilbek adedalic Dalabaev, Vladimir vovuh Petrov, Ivan BledDest Androsov, Maksim Neon Mescheryakov and me. Also huge thanks to Mike MikeMirzayanov Mirzayanov for great systems Polygon and Codeforces.

Good luck to all the participants!

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

Codeforces and Harbour.Space

Amazing news once again, Codeforces!

We are especially glad to have a chance to share our scholarship opportunities more often!

This time we have partnered with OneRagtime again to open the door for an exciting career in technology for the most talented people in our network.

In partnership with OneRagtime, we are offering a full scholarship to study a Master’s in Computer Science at Harbour.Space while working as a Full Stack Developer at OneRagtime!

Scholarship Highlights:

Work in Europe’s most exciting tech cities

Scholarship value of up to €31,500

Competitive compensation for the internship at OneRagtime (€800 / month)

Opportunity to join OneRagtime full-time after graduation

Some of the advantages of working at OneRagtime:

  • International team
  • Fast-paced workplace
  • Be a part of the OneRagtime adventure!
  • Be fully immersed in the European tech ecosystem
  • Thrive within a Venture Capital that does things a little differently
  • Work in Europe’s most exciting tech cities

Codeforces and Harbour.Space

We have previously partnered with other companies like OneRagtime, Hansgrohe, Coherra, and Remy Robotics to empower young talents around the world and help them boost their tech career. We’ve already filled a few of the positions with OneRagtime including:

  • Full Stack Developer at OneRagtime awarded to Alejandro Martinez from Mexico
  • UI/UX designer at OneRagtime awarded to Davit Petriashvili from Georgia

We are always happy to see Codeforces members join the Harbour.Space family. Apply now to get a chance to learn from the best in the field and kickstart your career!

Keep in touch and follow us on LinkedIn for more scholarship opportunities. And follow us on Instagram to evidence student life, events, and success stories from our apprenticeship program students.

Good luck on your round, and see you next time!

Harbour.Space University

Congratulations to the winners:

Rank Competitor Problems Solved Penalty
1 antontrygubO_o 6 251
1 Pyqe 6 251
3 kefaa2 6 260
4 tute7627 6 272
5 Um_nik 6 288

Congratulations to the best hackers:

Rank Competitor Hack Count
1 noimi 11
2 neal 7
3 Origenes 6
4 Kregor 5:-2
5 chilliagon 5:-4
94 successful hacks and 293 unsuccessful hacks were made in total!

And finally people who were the first to solve each problem:

Problem Competitor Penalty
A noimi 0:01
B noimi 0:04
C wygzgyw 0:15
D conan1412yang99 0:16
E thenymphsofdelphi 0:15
F rainboy 0:35

UPD: Editorial is out

Read more »

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

By star_xingchen_c, 2 months ago, In English

Hello Codeforces!

On Feb/28/2021 16:35 (Moscow time) we will host Codeforces Global Round 13.

It is the first round of a 2021 series of Codeforces Global Rounds. The rounds are open and rated for everybody.

The prizes for this round:

  • 30 best participants get a t-shirt.
  • 20 t-shirts are randomly distributed among those with ranks between 31 and 500, inclusive.

The prizes for the 6-round series in 2021:

  • In each round top-100 participants get points according to the table.
  • The final result for each participant is equal to the sum of points he gets in the four rounds he placed the highest.
  • The best 20 participants over all series get sweatshirts and place certificates.

Thanks to XTX, which in 2021 supported the global rounds initiative!

The problems were written and prepared by 3.141592653, Widowmaker, Ynoi, errorgorn, oolimry, star_xingchen_c, syksykCCC.

We would also like to thank:

You will have 3 hours to solve 9 problems. We encourage you to read all the problems and solve them all.

One of these problems is interactive, please see the guide of interactive problems if you are not familiar with it.

UPD1: Scoring distribution: 500-750-1000-1250-1750-2000-2250-3000-5000

UPD2: Tutorial published.

UPD3: System testing finished, congrats to the winners!

  1. maroonrk
  2. DmitryGrigorev
  3. Petr
  4. jiangly
  5. RALZH
  6. qazswedx2
  7. sunset
  8. ecnerwala
  9. lumibons
  10. p_b_p_b

Read more »

Announcement of Codeforces Global Round 13
  • Vote: I like it
  • +1092
  • Vote: I do not like it

By ReplyChallenges, history, 2 months ago, In English

Hello Codeforces!

We're glad to invite you to the upcoming Reply Code Challenges 2021 edition, on 11th of March.

It's a free online team-based challenge and you can choose between:

Standard Edition: designed for university students and professionals

Each member of the first-placed team wins a Mac Book Pro™ 16 (2.3GHz 6-core 9th-generation Intel Core i9 processor, AMD Radeon Pro 5500M with 4GB of GDDR6 memory, 16GB 2666MHz DDR4 memory and 1TB SSD storage). The second-placed team members each win a Mac Mini™ (Apple M1 chip with 8-core CPU, 8-core GPU and 16-core Neural Engine, 256GB SSD storage), the team members placed third in the ranking each win Apple Air-pods Pro™.

Registration opened on

Teen Edition: designed for students aged 14 to 19

The winning team will receive 5,000 euros. The second-ranked team will receive 2,000 euros, the third-ranked team will receive 1,000 euros.

Registration opened on

Description and rules available online at on March 11th from 4.30pm to 8.30pm CET. To play you must form a team by March 10th.

Follow us on our Telegram Channel:

Read more »

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

By ch_egor, 2 months ago, translation, In English

Hi everybody,

This Tuesday there will be a Moscow programming competition for school students of grades from 6 to 9. This contest is prepared by Moscow Olympiad Scientific Committee that you may know by Moscow Open Olympiad, Moscow Team Olympiad and Metropolises Olympiad (rounds 327, 342, 345, 376, 401, 433, 441, 466, 469, 507, 516, 541, 545, 567, 583, 594, 622, 626, 657, 680).

Round will be held at Feb/23/2021 12:05 (Moscow time). You will be given 5 problems and 2 hours to solve them. Round will be rated for second division (rating below 2100). As usual, participants from the first division can participate in a contest out of competition.

Problems are prepared by grphil, Jatana, rip, Sehnsucht, DebNatkh, KiKoS, wrg0ababd, V--o_o--V, voidmax, meshanya, vintage_Vlad_Makeev under my supervision.

Thanks to adedalic for the round coordination, cdkrot and meshanya for statement translation, and also thanks for MikeMirzayanov for systems Codeforces and Polygon, which was used to prepare problems of this olympiad.

Also thanks to Noam527 for providing an additional problem that helped to create (I hope) a balanced problem set for the round.

Good luck everybody!

Due to the official competition source codes of other participants will not be available for an hour after the end of the round.

UPD1: Thanks to LHiC, awoo, ScarletS, adarsh7777, kassutta, raj_mehta_ for testing.


Scoring distribution: 500 — 1000 — 1500 — 2250 — 3000

UPD3: Editorial

UPD4: Winners!

Div. 2:

  1. InternetPerson10
  2. egor95123657
  3. hhhyyyfff
  4. xXx_KevinDu58_xXx
  5. Flying2021

Div. 1 + Div. 2:

  1. Um_nik
  2. qazswedx2
  3. 3.141592653
  4. BigBag
  5. InternetPerson10

Read more »

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

By vitovt, history, 2 months ago, translation, In English

Registration for International Data Analysis Olympiad (IDAO 2021) is open now. It’s being organized by HSE University and Yandex for the 4th time. Otkritie bank will be our platinum partner this year. The Olympiad will be convened by leading experts in data analysis and aims to bring together analysts, scientists, professionals, and junior researchers. Participation is free. Winners and prize-winners of IDAO 2021 will receive valuable prizes.

This year the online task is coming again from Physics. The task was given by the Laboratory of Methods for Big Data Analysis (LAMBDA, HSE University) together with CYGNO Collaboration (Italy).

The registration is open till March 12, 2021. The Olympiad includes two stages:

Online Stage (March 1-31):

  • Track 1: Traditional machine learning competition on Yandex.Contest platform. You will need to make new predictions and upload them to the automatic verification system.
  • Track 2: Come up with a solution for the same problem, keeping within a rigid framework of time and memory used.

Final (April 17-18):

  • top 30 teams according to the Online Stage results will be invited to the Online final.
  • In the final 36 hours of the competition, participants will try not just to train the model, but to create a full-fledged prototype, which will be tested both in terms of accuracy and performance.

Learn more:

Read more »

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

By okwedook, 2 months ago, In English

Hi, Codeforces!

I finally get to return something to this great community, so I am glad to invite you to take part in Codeforces Round #703 (Div. 2), which will take place on Feb/18/2021 17:35 (Moscow time). The round will be rated for the participants with rating lower than 2100. Participants from the first division are also welcomed to take part out of competition.

You will be given 2 hours 15 minutes to solve 6 problems. All the problems were created and prepared by me. One of the problems is interactive, please read the guide of interactive problems before the contest.

I would also like to thank:

Scoring: $$$500-1000-(750+750)-1750-2250-3000$$$.

Don't forget to read ALL the problems. I wish you good luck and high ratings!

I tried my best to create some good problems and clear statements, so I hope you'll enjoy the round:)


UPD: Editorial

UPD: Winners and First to solve

Div1 + Div2

Place Participant
1 renascencepjw0510
2 dlalswp25
3 Bohun
4 kmjp
5 theodor.moroianu


Place Participant
1 renascencepjw0510
2 Quirrel
3 YuuKoito
4 _Nyusha_
5 JackF

First to solve

Task Participant
A king_of_tt
B IgorI
C1 dlalswp25
C2 dlalswp25
D Omer223
E lulzz
F JackF

Read more »

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

By geranazavr555, history, 2 months ago, translation, In English

For example, tourist, you can find it on his profile page:


Read more »

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

By Supermagzzz, 2 months ago, translation, In English

Hello, Codeforces!


Hello! Codeforces Round #702 (Div. 3) will start at Feb/16/2021 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 1600 or higher, can register for the round unofficially. The round will be hosted by rules of educational rounds (extended ICPC). Thus, during the round, solutions will be judged on preliminary tests, and after the round it will be a 12-hour phase of open hacks. I tried to make strong tests — just like you will be upset if many solutions fail after the contest is over.

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

Note that the penalty for the wrong submission in this round (and the following Div. 3 rounds) 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 trusted participants of the third division, you must:

  • take part in at least two 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.

The problems for this round were invented by MikeMirzayanov, Supermagzzz, Stepavly and sodafago.

Thanks to MikeMirzayanov for platforms and coordination of our work. Thanks to darkkcyan, Sho, sodafago, Nebuchadnezzar, kocko, akagami_no_shanks, Gassa, infinitepro, bfs.07 for help in round preparation and testing the round.

Good luck!


UPD: Editorial is ready!

Read more »

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