Errichto's blog

By Errichto, 5 weeks ago, In English

In Codeforces, the nickname color depends on the current rating. I propose to use the historical max rating instead.

The nickname color is not only a bragging right, but also a good heuristic when choosing which blogs to open in "Recent actions", and which posts to read when scrolling through many comments. Here's why I think that we should use max rating:

  1. It's less random.
  2. Current rating is nowadays more affected by AI cheaters.
  3. There will be less incentive to create a second account when you're afraid to drop below some threshold.
  4. It will make recognizing others easier (because the color won't change often).
  5. I don't want to be orange.

Full text and comments »

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

By Errichto, 6 weeks ago, In English

Hi. I'm excited to announce my partnership with Harbour.Space, which will include free Olympiad classes!

I will teach two groups:
- Easy: A course on competitive programming. You'll learn and practice algorithms, including topics from the USACO Guide Silver and Gold. Prerequisites: C++, BFS, DFS, binary search.
- Hard: We will mostly solve Olympiad problems, and cover topics from the USACO Guide Platinum and Advanced. This group is aimed at students who want to get an IOI medal.

The first semester will last from September until December, around 15 classes per group. As an optional pre-course, the Easy group will start next week (17.08.2026) with a few introductory classes in the second half of August.

We haven’t decided on the participant limit yet. You cannot participate in these classes if you've already graduated high school, sorry. I'm planning to upload highlights (e.g. a nice problem or part of a lecture) to YouTube. You can also join my YT/Twitch livestreams, coming soon with a regular schedule.

Harbour.Space believes that exceptional talent deserves exceptional support. As part of our partnership, Harbour.Space sponsors my competitive programming initiatives, including intensive online bootcamps (like the IOI Online Camp), livestreams, and other educational activities.

Feel free to suggest any improvements, or other things that I should organize. See you soon!

Full text and comments »

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

By Errichto, 2 months ago, In English
  • 2022 recordings — CEOI 2016, CEOI 2017, CEOI 2022, optimization problems, segment tree nodes
  • 2023 recordings — POI 2019, POI 2022, CEOI 2018, graphs
  • 2024 recordings — POI 2016, POI 2019 mix, POI 2023, IOI 2014, lazy propagation, sweep line, partial dp/bfs (Bombs)
  • 2025 recordings — POI 2018, IOI 2015, CEOI 2019, Convex Hull Trick

Hi! I'm running an online IOI camp for the fifth time. This edition is sponsored by Harbour.Space Institute of Technology. It's free for IOI participants and coaches. We also accept participants of regional olympiads like APIO, EGOI, BOI and CEOI 2026. Every day will be a 5-hour virtual contest, the problem analysis, and sometimes a lecture.

  • Dates: from 29.07 until around 5.08 (6 training days, some day/s off)
  • Contests: IOI 2016, 2 days of POI, 2 days of some regional olympiad like CEOI
  • Registration: You need to register using this form https://harbour-space.typeform.com/to/Qu4pSHKF. I will later send you a Discord invite via e-mail. You should be a participant or a team leader for IOI 2026 or a regional (multi-national) olympiad in 2026.
  • Lectures: The example lecture topics are those from Range Queries or Trees in Usaco Guide Platinum.
  • Time: The Zoom analysis will start every day at 15:00 CEST. You can participate in a contest earlier that day, or a day before.

Thanks to the Harbour Space for sponsoring this online camp.

Feel free to make suggestions in the comments. See you soon!

Full text and comments »

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

By Errichto, 15 months ago, In English
  • 2022 recordings — CEOI 2016, CEOI 2017, CEOI 2022, optimization problems, segment tree nodes
  • 2023 recordings — POI 2019, POI 2022, CEOI 2018, graphs
  • 2024 recordings — POI 2016, POI 2019 mix, POI 2023, IOI 2014, lazy propagation, sweep line, partial dp/bfs (Bombs)

Hi! For a fourth time, I'm organizing an online IOI camp sponsored by Huawei. It's free for IOI participants and coaches. UPDATE: we will accept participants of regional olympiads too (from this year, so e.g. BOI/EGOI/CEOI/APIO 2025)! Every day will be a 5-hour virtual contest, the problem analysis, and sometimes a lecture.

  • Dates: 17-23.07 (6 training days; Sunday off)
  • Contests: IOI 2015, POI 2024 and something else from POI/BOI/CEOI
  • [EDIT] Registration: You need to register using this form https://www.smartsurvey.co.uk/s/SWYTGK/. I will later send you a Discord invite via e-mail. You should be a participant or a team leader for IOI 2025.
  • Lectures: The example lecture topics are those from Range Queries or Trees in Usaco Guide Platinum.
  • Time: The analysis will start every day at 16:00 CEST. You can participate in a contest earlier that day, or a day before. The analysis on Saturday 19.09 will be shifted because of the CF round.

Feel free to make suggestions in the comments.

Full text and comments »

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

By Errichto, 15 months ago, In English

The blog publish date is incorrect, should be around 12.07.2025. CF saved the draft date.

Hi, I'm organizing paid group classes on Dynamic Programming in August. Last year, I did something similar with general problem-solving (link).

There will be two groups of different style and difficulty. Each group gets 8 lessons of 1h30m each, from 28.07.2025 to 24-31.08.2025. Group size up to 12 people. You get access to recordings and problems from both groups, but you should actively attend only one. There's a lot of homework, some to be discussed next lesson. I will create new original CF/Polygon problems, especially for the easy group. These problems will eventually be published for everybody!

Price: 250 EUR with a small country-based discount.

Registration: You should pay via link (Stripe) and choose the group there. I will send you the Discord invite link via e-mail. Contact me if you're from a country outside Europe/USA/India so I could give you a small discount. The price is already set to 20000 INR for India, 20% off.

Platform: Discord for classes, links and extra discussion. Codeforces group (private GYM/mashup contest) for CF+original problems. YouTube for (private) recordings of the class.

Easy group, solving dp problems

Tuesdays and Fridays at 14:00 CEST.

Prerequisites: multi-dimensional arrays; knowing any way to compute N-th Fibonacci number in $$$O(N)$$$; being able to read C++ (so you would understand my code).

You will thoroughly learn iterative DP by solving 50+ easy/medium problems. You will learn how to come up with states and transitions, use multiple dimensions, iterate in correct order. I will often show a few lines of code in order to discuss e.g. array size, initialization, for-loop order, off-by-one errors. We'll cover knapsack variations (e.g. repetitions or small weights), optimal path reconstruction (with and without "breadcrumbs"), and using prefix sums to speed up transitions.

more info

Hard group, dp techniques

Tuesdays and Fridays at 16:00 CEST.

Prerequisites: Prefix sums, knapsack, bitmasks. Being able to solve (almost) any easy dp problem. Being able to solve at least half of the problems from AtCoder DP Contest.

This group will be more lecture-style, ofc. with asking questions and suggesting solutions to a problem/issue. But you mainly get to solve problems as homework. We'll cover switching dimension/answer, knapsack without one, last 1-2 tricks/problems from here, bitmask dp (briefly) & broken profile, SOS, small-to-large tree DP, some optimizations from here and tricks from here. We'll solve 2-3 very hard DP problems too.

more info

LeetCode classes

Starting from August, I will also do weekly Sunday classes where we cover problems from the most recent LeetCode Weekly contest. 150 EUR / month. Registration soon.

Reach out to me (CF or [email protected]) if you have any questions. Cheers.

Full text and comments »

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

By Errichto, 15 months ago, In English

Hi, I'm back to streaming :)

In particular, I'm going live in 20 minutes. You can watch on Twitch or Youtube. The recording will remain available on YT.

June

July

Just like last year, I'm going to organize paid group classes around July-August, and a free IOI camp sponsored by Huawei. I will announce more details soon.

As an experiment, you can also book a 50€ Google Meet call with me https://calendly.com/errichto. For example, we can discuss your training strategy or just talk about life.

Full text and comments »

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

By Errichto, 23 months ago, In English

Hi. There's an ongoing online competition Tech Arena by Huawei.

There are two optimization problems, with total prize pool of 20k GBP. You should form a team of up to 3 university students (age 18+), registration deadline is November 30.

If I understand correctly, the competition used to be available only for UK students and now it's the EU too. There seems to be an optional trip to China for winners (it was just a trip/ceremony in UK last year).

Full text and comments »

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

By Errichto, 23 months ago, In English

Hi, in 30 minutes starts Huawei ICPC Challenge Championship 2024. It's a 5-hour onsite competition in Shenzhen with a 8000 EUR prize for the winner. There are around 75 participants, mostly prize winners of online CF challenges from past few years. Good luck to all of us! (I'm one of the participants.)

hieplpvip vinfat tatyam potato167 yokozuna57
takumi152 QCFium amnesiac_dusk yashChandnani Berted
stevenhalim E869120 square1001 csegura reedef
dartvolley Performanceartist heuristica chenjb Pechalka
Tikhon228 maxplus 353cerega orz aropan
Andreasyan LHiC gustokashin ashmelev gamzaza
armand NaughtyMorzh andrewzta daituodt Syloviaely
Akigeor sunkafei Iscream2001 chiranko ybw051114
Macesuted-Moe Huah CRH380BL xiaoxiaobaozi meaningIess
yfzcsc AbstractKangaroo Qingyu orzxyz111 Arturgo
NVAL icecuber msmits Mustang98 Radewoosh
Asymmetry MladenP theodor.moroianu freak93 ___-
marius135 birka0 MZuenni Errichto Zazmuz
gawry Dariost masni-burek alagorithmet milen.petrov
kobor KeNaj712 dfolque99 zyl072

Btw. if you're a UK or EU student, there's an ongoing online competition with 20k GPB in prizes, Tech Arena https://huawei.agorize.com/en/challenges/techarena-uk2024?t=FM5eOG69To5aRGqbjmN8EA

Full text and comments »

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

By Errichto, history, 2 years ago, In English

Hello, everybody. I'm happy to invite you to the 7th Stage of the 3rd Universal Cup. It will take place this weekend, August 24. I will later add info about available timeslots.

Update, timeslots

The contest is equal to AMPPZ 2023, the Polish ICPC subregional. I'm the author of most problems. Big thanks to Marcin_smu, mareksom and tomek for their huge work too. And to Ewa for translating the one long statement.

You can find all the information about the upcoming stages here: https://ucup.ac

About Universal Cup

Good luck!

Full text and comments »

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

By Errichto, 2 years ago, In English

Hello, everybody.

August CP School, cancelled

Huawei IOI Camp 2024

For a third time, I'm organizing an online IOI camp sponsored by Huawei. It's free for IOI participants and coaches. Every day will be a 5-hour virtual contest, the problem analysis, and sometimes a lecture.

  • Dates: 17-24.08 (6 training days: 17, 18, 20, 21, 23, 24).
  • Contests: I always use problems from POI and BOI/CEOI, but now I'm considering including an old IOI year. Maybe 2013 or 2014?
  • Registration: will start on Monday, August 5.
  • Lectures: The example lecture topics are those from Range Queries or Trees in Usaco Guide Platinum.
  • Time: The analysis will start every day at 16:00 CEST. You can participate in a contest earlier that day, or a day before.

Feel free to make suggestions in the comments. See the previous edition here.

Update: contact me for Huawei IOI camp registration. You should be an IOI participant or a coach who wants to register several students.

Update (August 17): The camp starts today. If you still want to join and you're not in the Discord server yet, reach out to me via email (errichto @gm....com) and do a virtual participation of IOI 2014 day 1 https://ioi.contest.codeforces.com/group/32KGsXgiKA/contest/103767 or oj.uz https://oj.uz/problems/source/66

Full text and comments »

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

By Errichto, 2 years ago, In English

Hi, I'm going to teach competitive programming classes this Summer, starting with a 4-week batch to see how it goes. I hope to make 2 or 3 groups of ~12 students, each group aimed at some CF rating. We will use problems from Codeforces, CSES, Atcoder, Polish olympiad (only higher group), and my modifications and follow-ups. There will be homework, some to be discussed next lesson.

  • Dates: June 24 to July 19 (4 weeks)
  • Time: morning-noon in Europe
  • 2-3 lessons per week, 1.5h or 2h each
  • Price: around 20 USD per hour, 260-440 USD total per person
  • Platform: Discord and/or Google Meet

Please fill this form to get a 5% early-bird discount. I will use the results to choose and announce groups (difficulty and frequency) in 1-2 weeks.

Feel free to ask questions in the comments, or DM me.

regarding the idea of USACO classes

Update (6.06.2024): We will do 2 x 1.5h lessons per week, with total cost of 260 USD for 8 lessons, every Monday and Thursday from June 24 to July 18 (or up to July 25 if we skip a lesson or two). There will be three groups:

  1. 8:00-9:30, CF max rating 1000-1400 (time in CEST, Poland)
  2. 10:00-11:30, CF max rating 1500-1800
  3. 12:00-13:30, CF max rating 1900-2200

You can pay via Paypal https://paypal.me/errichto or contact me for details of Revolut, Wise or EUR wire transfer. The transfer title should be "CF Classes yourcfhandle" or similar. After paying, contact me with your Discord handle and group preference. Remember about the 5% discount if you have filled the form before.

Full text and comments »

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

By Errichto, 2 years ago, In English

Hi, I'm back from the ICPC finals (and proud of Harbour.Space Barcelona for a gold medal!). I have a few announcements for those preparing for an olympiad.

USACO Platinum weekend camp by AlphaStar

A free online olympiad camp for USACO platinum students and CF 1800+ users. Both days start at 9:30 am Pacific / 18:30 CEST. Thanks to AlphaStar for organizing the event. https://alphastar.academy/events/

May 11 (Saturday)
The first day will be two medium-difficulty 3-hours contests with analysis. Skip this if you're an experienced platinum contestant.

May 12 (Sunday)
For stronger participants: 5-hour contest + analysis
For others: lectures on centroid decomposition, EV and summation, randomized algorithms. Then you have 30 minutes to get familiar with the 5-hour contest problems so you could attend the analysis.

I will use existing problems from Polish olympiads, and there'll be a guest problem by bmerry.

Huawei IOI camp in the Summer

This is not finalized yet. Just like two previous years 2022 2023, I will likely organize a free online camp for IOI participants, sponsored by Huawei. This year, I think about using old IOI contests (from around 2014) instead of POI and CEOI. Is August a good month for this? Any collisions that we should avoid?

My USACO classes / school

I'm thinking about teaching USACO bronze/silver/gold classes this July. It would be one month of learning all the important topics and solving a bunch of problems. Groups of around 10 students, 2-3 lessons per week, 1.5-2h per lesson, Discord group to talk between classes. Price around 35$ per hour, so the total should be 500-900 USD. The lesson time would be morning/noon Pacific (afternoon/evening in Europe).

If you're interested, fill this form (link) about your preferences for a 5% early-bird discount (if I actually do organize this). You can register for general olympiad preparation, not just USACO. It's normally difficult for me to work with students from the US because of the timezone difference. It's more viable during their Summer break, hence the focus on USACO here.

Full text and comments »

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

By Errichto, 3 years ago, In English

Here's the previous edition and the video recordings (CEOI 2016, 2017, 2022, two lectures).

Hi. I'm again conducting an online IOI preparation camp in collaboration with Huawei. Every day will be a 5-hour virtual contest, the problem analysis, and sometimes a lecture. Contests will consist of POI problems, and there might be a single day from BOI or CEOI. The example lecture topics are those from Range Queries or Trees in Usaco Guide Platinum.

The camp is free for IOI 2023 participants and coaches. You can register a few extra students if you're a country team-leader (then send me a msg in CF or email at [email protected]). There will be a Discord server and a leaderboard. For everybody else, the video recordings will be posted on Youtube after the camp.

Dates: around 8-16.08
Time of every analysis/lecture: 14:00 UTC / 16:00 CEST
Platform: Discord, Szkopul, CSES
Registration: write a message to gupta_samarth with your name, country and Discord handle (necessary!), and information if you're an IOI participant. Or you can reach via Discord directly, same username. UPDATE: Reach out to me directly if you're a coach and you want to register multiple students.

Schedule: (work in progress)
8.08 — POI 2019
9.08 — POI 2013
10.08 — day off
11.08 — POI 2017
12.08 — POI 2019
13.08 — day off
14.08 — CEOI 2021? Or maybe 2017/2018/2020?
15.08 — maybe CEOI 2023 mirror
16.08 — CEOI 2021?
17.08 — maybe CEOI 2023 mirror

Big thanks to Huawei UK R&D for sponsoring this camp.

Full text and comments »

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

By Errichto, 3 years ago, In English

Hi. I offer classes for groups of 2-3 students. I teach competitive programming with a focus on problem-solving. There won't be many lectures because I can send you an article/video link instead. The lesson cycle is usually: I choose a problem, you say your thoughts and ideas, I comment on incorrect ideas, and we talk about the valid solution(s), possibly with drawings and pseudocode. In beginner groups, I might ask you to implement something, C++ or Python preferred.

There's a lot of homework and you're expected to practice a few hours per week. We might spend half a lesson talking about 1-2 homework problems from last week. This is intended.

We use Google Meet, shared whiteboard, and a collaborative editor Codebunk. After a lesson, you get a video recording and a codebunk with code/text history like this one https://codebunk.com/pb/3501100331621/. This allows you to copy links and code easily. There's a Discord group chat to ask questions between classes.

  • 1.5h lesson once per week.
  • Price per person: 66 USD per hour, 400 USD a month.
  • Payment: Paypal, wire transfer, Wise, Revolut. I can send you an invoice.
About me
Free lesson?
Why groups of size 2-3?
How to join?

I also offer:

Interview preparation
Corporate workshops

Full text and comments »

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

By Errichto, 4 years ago, In English

For the next few days, I will do live streams of virtual participation (or casual problem-solving) of CF div1 rounds. The first one is starting in less than 2 hours. You can watch on Twitch and Youtube.

I'm back to practicing because there's a big Polish competition in two weeks and I'm certainly out of shape.

maybe around Wednesday: 1770G - Koxia and Bracket, 1774G - Segment Covering, 1787I - Treasure Hunt

See you in the Twitch chat.

Full text and comments »

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

By Errichto, 4 years ago, In English

Hi. I'm organizing an online IOI-preparation camp in collaboration with Huawei. Every day will be a 5-hour virtual contest, then my problem analysis, and sometimes a lecture. There will be at least 4 contests and 2 lectures.

We will do some old IOI contests (2013?) from the IOI archive, CEOI (2015-2016?), or maybe JOI/JOISC — to be decided this weekend. I don't want to do recent years like 2021 because most participants already covered it. The example lecture topics are those from Range Queries or Trees in Usaco Guide Platinum.

The camp is free for IOI 2022 participants. For everybody else, the video recordings will be posted on Youtube after the camp. By participating you get the live experience (Discord, asking questions, competing with others, leaderboards).

Dates: 25.07-2.08 (updated)
Time of every analysis/lecture: 14:00 UTC / 16:00 CEST
Price: free for IOI participants, 40 USD for everybody else
Platform: Discord & Codeforces & uj.oz (?)

How to register?

Big thanks to Huawei UK R&D for sponsoring this camp.

EDIT: I'm now aware of CEOI collision. There's nothing I can do about it :(

Schedule:
25.07 — CEOI 2016 day 1
26.07 — CEOI 2022 day 1 + lecture
27.07 — CEOI 2016 day 2
28.07 — CEOI 2022 day 2
29.07 — lecture + homework
weekend off
1.08 — CEOI 2017 day 1
2.08 — CEOI 2017 day 2

Participants voted to cover CEOI instead of IOI to avoid problems that they already know.

Full text and comments »

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

By Errichto, 4 years ago, In English

When some country organizes an ICPC or IOI preparation camp, they often need a teacher from abroad. When they ask me, I usually decline because of a lack of time. I want to be able to link this blog so they would find a good teacher.

If you teach and want to be reached by camp organizers, leave a comment and say something about your experience.

More info about such camps

Feel free to advertise your 1:1 online coaching too. It's not the main purpose of this blog though.

Full text and comments »

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

By Errichto, 5 years ago, In English

Target audience: newbies and pupils (rating up to 1400).
Group link: https://codeforces.me/group/yg7WhsFsAp/contests (hit "join" on the right).

Hi. Enjoy a series of 8 problem lists for beginners. The example topics are strings, arrays, math, and binary search. You are allowed to discuss anything with others, or just look up solutions online. There are also 3 exams, each recommended for a 2-hour individual virtual participation. Use the displayed order, e.g. take exam 1 after day 3. It all should take you 2 weeks of intense bootcamp-like work (or a few months if you take your time).

The problems were originally used two years ago in a Saudi Arabia camp. It's a mix of around 70 existing CF problems and 30 new original problems, mainly prepared by kostka, with some help from me and mustafabar. I asked them for permission to publish everything.

I will put hints to some problems in this blog (or in the group? not sure). Expect a few videos and/or streams for beginners too. You should also read two first chapters of Competitive Programmer's Handbook.

UPD: On Sunday evening I'm making a stream with explanations to a few hard problems: P8, P11, P18, P30, P31, P33. You can try it with hints first:

P08. Cashier
P11. Queens attack!
P18. Mountain peaks
P30. Temporarily unavailable
P31. Shuffle Hashing
P31. Shuffle Hashing, hint 2
P33. Thanos Sort

Full text and comments »

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

By Errichto, 5 years ago, In English

This is my 100th CF blog!

This is a list of techniques with $$$O(\sqrt n)$$$ time complexity. Watch the lecture https://youtu.be/BJhzd_VG61k, with timestamps!

  1. Square root decomposition — split the sequence into blocks of fixed size.
  2. Splitting objects (e.g. vertices) into light and heavy.
  3. Square root decomposition by the time of queries & rebuilding the structure.
  4. Mo's algorithm — processing queries in proper order and updating the answer by erasing/inserting new elements. https://cp-algorithms.com/data_structures/sqrt_decomposition.html
  5. Strings — if the sum of lengths is $$$S$$$ then there are at most $$$\sqrt{S}$$$ distinct lengths.
  6. Birthday paradox & baby-step giant-step. See P4 and P6 here, and see https://cp-algorithms.com/algebra/discrete-log.html.

P1. 398D - Мгновенные сообщения
P2. 220B - Маленький Слоник и массив
P3. 86D - Мощный массив (actually, skip this one because it's boring)
P4. Count triangles in a graph, i.e. cycles of size 3.
P5. Given $$$N$$$ strings with total length $$$S$$$, find a pair where one string is a substring of the other, in $$$O(S \cdot \sqrt S)$$$.

Homework (will be discussed in a second stream soon)
P6. You are given $$$N$$$ positive integers $$$a_1, a_2, \ldots, a_N$$$ and target value $$$X$$$. Check if there is subset with sum equal to $$$X$$$, in $$$O(X \cdot \sqrt S)$$$ where $$$S = \sum a_i$$$.
P7. 13E - Лунки
P8. 455D - Серега и веселье
P9. You're given a sequence $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \leq a_i \leq n$$$). It describes a functional graph: there is a directed edge from $$$i$$$ to $$$a_i$$$. Handle updates U i x (change $$$a_i$$$ to $$$x$$$) and answer queries Q v — if we start in $$$v$$$ and keep following edges, after how many steps do we get to an already visited node?

And two problems from recent contests: 1580C - Техническое обслуживание поездов and ABC 219 G Propagation.

Thanks to krismaz for letting me use his list of techniques and problems.

Full text and comments »

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

By Errichto, 5 years ago, In English

Hello. Every week, I will discuss few nice recent problems from CF, AC, CC. I will alternate between div2 and div1 streams, with difficulties [1400, 1800] and ~[2200, 2800] respectively. Try to solve problems on your own before each stream!
You can suggest new cool/interesting/educational problems in comments below this blog.

2.10.2021, Div2 Problems of the Week https://youtu.be/AbeEJvmsx0E

  1. [1800] 1572A - Book
  2. [1600] 1567C - Carrying Conundrum
  3. [1800] 1556C - Compressed Bracket Sequence + O(N) solution

honorable mentions
- [1700] 1579E2 - Array Optimization by Deque
- [1800?] Cross-free Matching https://atcoder.jp/contests/arc126/tasks/arc126_b

9.10.2021, Div1 Problems of the Week https://youtu.be/7rtZEXAVzmk

  1. [2400] 1592E - Bored Bakry
  2. [2700] 1572C - Paint
  3. [3000] 1572E - Polygon

Full text and comments »

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

By Errichto, 5 years ago, In English

Meet in the Middle lecture & problem-solving starts in an hour https://www.twitch.tv/errichto. See the problem list below. I will later update this blog with codes and written explanations.
UPD, video recording: https://youtu.be/18sJ3mK173s, some codes from the stream: https://ideone.com/1uScID

P1. Knapsack with $$$n \leq 40$$$ and values up to $$$10^9$$$ https://cses.fi/problemset/task/1628

P2. Given a sequence $$$a_1, a_2, \ldots, a_n$$$ ($$$n \leq 2000$$$), count increasing subsequences of length 3.

P3. 4-SUM, find four values that sum up to the target value https://cses.fi/problemset/task/1642

P4. Find a string with the standard polynomial hash equal to the target value $$$X$$$ modulo $$$10^9+7$$$. The hash is computed by converting characters a-z into 0-25 and multiplying every character by the next power of 26. Find a solution without just converting $$$X$$$ to base $$$26$$$.

P5. You're given a graph: $$$n \leq 300$$$, $$$m \leq n\cdot(n-1)/2$$$. Count paths made of 5 nodes. Nodes and edges can be repeated.
Bonus 1: Count simple paths only. No repetitions allowed.
Bonus 2: $$$n, m \leq 2000$$$
Similar problem: https://codeforces.me/blog/entry/94003

P6. You're given a sequence $$$n \leq 10^6, 0 \leq a_i \lt M = 10^9$$$. Find two subsequences with equal sums modulo $$$M$$$. https://quera.ir/problemset/olympiad/34090. The two subsequences can have common elements.

P7. Number Clicker https://codeforces.me/contest/995/problem/E. You start with the number $$$a$$$ and want to get $$$b$$$ in at most 200 moves. You can increment, decrement or change the current number into its modular inverse, all modulo prime $$$p$$$. Find any valid sequence of moves.

Full text and comments »

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

By Errichto, 5 years ago, In English

Hi. I think these are nice medium-hard interactive problems. I will discuss solutions in a stream today at https://www.twitch.tv/errichto.

UPD, recording is here https://youtu.be/9oEihYrAR5kUPD and I added text solutions in this blog.

P1. Mostly A — You're given two integers $$$N$$$ and $$$K$$$ ($$$N \leq 50\,000$$$, $$$K \leq 10$$$). You need to find a hidden string of length $$$N$$$ with lowercase English characters a-z. At most $$$K$$$ characters are different than 'a'. You can choose your own string of length $$$N$$$ and you will get info YES/NO whether your string is lexicographically smaller than the hidden one. There is no explicit limit on the number of queries. There's still some time limit (say, 2 seconds).
Hard version: Minimize the number of queries.

slow solution
hint
solution
hard version (optimal number of queries)

P2. Cloyster (https://codeforces.me/gym/102341/problem/C) — There's a grid $$$N \times N$$$ ($$$N \leq 2000$$$), each cell with some value. You can ask at most $$$3 \cdot n + 210$$$ queries "get value at cell (i, j)". Find the cell with the maximum value. For each of other $$$N^2 - 1$$$ cells, it's guaranteed that at least one adjacent cell has a greater value. Two cells are adjacent if they share a side or a corner.

hint

P3. Moving Car — A car on an infinite line starts at unknown position $$$X$$$ and unknown constant speed $$$V$$$ ($$$1 \leq X, V \leq 1000$$$). After $$$i$$$ seconds, it will be at $$$X + i \cdot V$$$. At time $$$0$$$ and then after every second, you get to ask about some position and you get a response whether the car is on the left, on the right, or at this position. Use at most 1000 queries to find values $$$X$$$ and $$$V$$$.
Hard version: $$$1 \leq X, V \leq 10^5$$$

hint
solution
cool improvement
hard version

If you know the source of problems 1 or 3, please let me know.

Full text and comments »

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

By Errichto, 5 years ago, In English

In a few hours, I will talk with guests about the upcoming IOI 2021. I will be joined (at least for 10-15 minutes each) by tmwilliamlin168, Petr, kostka and hopefully more.

We might talk winner predictions, stories, tips, training style in various countries. Feel free to post suggestions under this blog too.

See you at https://www.twitch.tv/errichto

UPD, recording: https://youtu.be/XNvcYFvFBls
Thanks to eduardische and jonathanirvings for joining the second part, when we discussed IOI from the organizers's point of view.

Full text and comments »

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

By Errichto, 6 years ago, In English

I and Radewoosh will virtually participate in Swiss-Slovak subregional (announcement, contest) on Tuesday at 16:00 CET. Watch my live stream on Twitch https://www.twitch.tv/errichto. Or later rewatch on YT https://youtu.be/M-xGjXwTXzQ.

Thanks to Xellos for the suggestion and majk for the contest.

This should be a nice warm-up before Petrozavodsk camp, which starts in a few days. I'm going to participate in half of the contests (as a member of mixed Polish Mafia team). I will record screencasts if allowed.

Full text and comments »

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

By Errichto, 6 years ago, In English

I'm going to solve CSES geometry section live on Saturday (tomorrow) while explaining and drawing stuff to make it educational. There are seven problems. We'll start with the cross-product recap and eventually get to Convex Hull and Closest Pair Of Points. No prewritten code.

Problems: https://cses.fi/problemset

Watch on Twitch or Youtube https://www.twitch.tv/errichto, https://youtu.be/G9QTjWtK_TQ. The latter will be available later to rewatch too.

Full text and comments »

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