Блог пользователя TheScrasse

Автор TheScrasse, история, 4 недели назад, По-английски

Hello everyone!

Consider the following problems.

Problem A

You are given an undirected simple graph with $$$n$$$ nodes and $$$m$$$ edges. It is guaranteed that the graph has no cycles of length $$$3$$$ (i.e., no triangles). You have to label each edge with a distinct integer in $$$[1, m]$$$, in such a way that there are no monotone cycles of length $$$5$$$ (i.e., when traversing a cycle of length $$$5$$$, the edge labels cannot be increasing).

Problem B

Problem A is actually broken. Prove that there exists a test case such that no labeling exists. The test case can have arbitrarily large $$$n$$$.

Challenge for you

Solve Problem B. Here are some hints.

  • If we remove the restriction "the graph cannot have triangles", a sufficiently large complete graph works.
Source
  • If we replace "cycles of length $$$5$$$" with "cycles of length $$$4$$$" (or any even length), problem A becomes solvable.

Good luck!

Полный текст и комментарии »

  • Проголосовать: нравится
  • +44
  • Проголосовать: не нравится

Автор TheScrasse, 5 месяцев назад, По-английски

2157A - Dungeon Equilibrium

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Solution

2157B - Expansion Plan 2

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Hint 3
Solution

2157C - Meximum Array 2

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Hint 3
Hint 4
Solution

2157D - Billion Players Game

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Hint 3
Solution

2157E - Adjusting Drones

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Solution

2157F - Git Gud

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Solution

2157G - Isaac's Queries

Author: KLPP
Preparation: KLPP

Hint 1
Hint 2
Hint 3
Hint 4
Solution

2157H - Keygen 3

Author: TheScrasse
Preparation: TheScrasse, Dominater069

Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Hint 6
Hint 7
Solution

2157I - Hyper Smawk Bros

Author: TheScrasse
Full solution: dario2994
Preparation: TheScrasse, Dominater069

Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Hint 6
Hint 7
Hint 8
Solution

Полный текст и комментарии »

Разбор задач Codeforces Round 1066 (Div. 1 + Div. 2)
  • Проголосовать: нравится
  • +82
  • Проголосовать: не нравится

Автор TheScrasse, 5 месяцев назад, По-английски

text Ciao, Codeforces! We're glad to invite you to take part in Codeforces Round 1066 (Div. 1 + Div. 2), which will start on Nov/23/2025 12:35 (Moscow time). You will be given 9 problems and 3 hours to solve them in both divisions. The round will share some problems with The 2025 ICPC Southwestern Europe Regional Contest (SWERC) 2025.

Note the unusual starting time.

Some of the problems might be interactive, so please read the guide for interactive problems if you are not familiar with it.

The problems were authored and prepared by KLPP and me.

We would like to thank

The score distribution will be announced after the onsite contest starts.

We hope you'll like the problemset!

UPD 1: The score distribution is as follows:

$$$500 + 1000 + 1500 + 1500 + 2000 + 2500 + 3000 + 3750 + 4000$$$

UPD 2: Upsolving & viewing of solutions and tests will be closed until the end of the onsite contest (13:30 UTC, 1 hour after the Codeforces round ends). Please also refrain from discussing the problems in public until that time.

UPD 3: Congratulations to the winners:

UPD 4: The editorial is out.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +410
  • Проголосовать: не нравится

Автор TheScrasse, история, 6 месяцев назад, По-английски

Hello everyone,

since I cannot participate in ICPC anymore, maybe it's time for me to start some serious research in theoretical computer science (possibly, something related to algorithms). In particular, I have just started my master's degree and I would like to write a good master's thesis.

However, I need to find a thesis supervisor. Do you have any suggestions, or experiences to share?

UPD: thanks to everyone for the suggestions! I will take some time to make an informed decision on who I should contact.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +114
  • Проголосовать: не нравится

Автор TheScrasse, 7 месяцев назад, По-английски

Ciao, Codeforces! We're glad to invite you to take part in Codeforces Round 1053 (Div. 1) and Codeforces Round 1053 (Div. 2), which will start on Sep/24/2025 14:35 (Moscow time). You will be given 7 problems and 3 hours to solve them in both divisions.

Note the unusual starting time.

  • One of the problems will be divided into two subtasks.
  • One of the problems will be interactive, so please read the guide for interactive problems if you are not familiar with it.

The problems were authored and prepared by Dominater069, satyam343 and me.

We would like to thank

Score distribution:

  • Div. 1: $$$500 + 1000 + 1750 + 2500 + (2000 + 1750) + 3250 + 4250$$$
  • Div. 2: $$$500 + 1250 + 1250 + 1750 + 2500 + 3250 + (2750 + 2500)$$$

We hope you'll like the problemset!

UPD: Congratulations to top $$$5$$$ in Div. 1 and Div. 2.

Winners

UPD 2: the editorial is out.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +365
  • Проголосовать: не нравится

Автор TheScrasse, 7 месяцев назад, По-английски

2151A - Incremental Subarray

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Solution

2150A - Incremental Path

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Solution

2151C - Incremental Stay

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Solution

2150B - Grid Counting

Author: TheScrasse
Preparation: Dominater069

Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Hint 6
Solution

2150C - Limited Edition Shop

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Hint 3
Solution

2150D - Attraction Theory

Author: Dominater069
Preparation: Dominater069

Hint 1
Hint 2
Solution Part 1
Hint 3
Hint 4
Hint 5
Solution Part 2

2150E1 - Hidden Single (Version 1)

Author: TheScrasse
Preparation: TheScrasse, Dominater069

Hint 1
Hint 2
Hint 3
Hint 4
Solution

2150E2 - Hidden Single (Version 2)

Author: TheScrasse
Preparation: TheScrasse, Dominater069

Hint 1
Hint 2
Solution

2150F - Cycle Closing

Author: TheScrasse
Preparation: TheScrasse, Dominater069

Hint 1
Hint 2
Solution

2150G - Counting Is Fun: The Finale

Author: satyam343
Preparation: satyam343

Solution

Полный текст и комментарии »

Разбор задач Codeforces Round 1053 (Div. 1)
Разбор задач Codeforces Round 1053 (Div. 2)
  • Проголосовать: нравится
  • +155
  • Проголосовать: не нравится

Автор TheScrasse, история, 8 месяцев назад, По-английски

For the tenth time, the Italian national contest (valid for the selection of the Italian IOI team) will be mirrored into an online contest. The contest is primarily intended for high school contestants, but everyone is welcome to participate! There are both easy subtasks (div2A) and very hard ones (div1D+), so it can be enjoyable both for newcomers and for very high rated contestants.

This year, there will be three online contests in total, held in the following order:

  1. a mirror of the practice contest (featuring original problems);
  2. an official (rated) Codeforces round based on the main contest;
  3. a mirror of the main contest.

Official Codeforces round

The format of the Codeforces round (2.) will be the usual Codeforces format, so you don't need any extra steps to register / participate. Another blog will be published a few days before the round.

Other rounds

About the other rounds (1. and 3.):

  1. The problem statements will be available in both English and Italian.
  2. Tasks will be IOI-like (with graders and subtasks) and you will have 5 hours to solve them.
  3. The only language allowed is C++.
  4. The time window for the practice contest (featuring original problems) will start on 2025 September 11th, 16:00 UTC and will end on 2025 September 22th, 16:00 UTC.
  5. Then, a rated Codeforces round based on the main contest will be held on Sep/24/2025 14:35 (Moscow time).
  6. The time window for the main contest will start after the official Codeforces round, i.e., on 2025 September 24th, 15:00 UTC.

The contests' timing will be USACO-like: you can decide when to start your 5-hours time window (after the login), but the contest will end at the given time regardless of your time window.

If you want to participate, you must:
  1. Visit the contest website: practice contest, main contest.
  2. Click the link "register", fill out the form and then click on the register button and then "back to login"
  3. You can now log in with the same username and password you used to sign up
  4. If the login is successful you will be ready to participate, just wait for the contest to start! (And maybe save the page in your bookmarks, so that you can quickly get back to it when the contest begins)
  5. When the contest starts, you will see a red button. Click it when you want to start your 5 hour time window!
  6. Good luck and have fun!

Ranking: The ranking of the online contest will be available at the following links when the contest start: practice contest, main contest. Upsolving: After the end of the contest, tasks will be uploaded in the Italian training website https://training.olinfo.it (localised also in English), section "task & quiz archive", where they will be available for online evaluation (after registering to the website).

Полный текст и комментарии »

  • Проголосовать: нравится
  • +63
  • Проголосовать: не нравится

Автор TheScrasse, история, 13 месяцев назад, По-английски

Congratulations to the Italian IOI team!

  1. Luca Baglietto (BestCrazyNoob) — 2532.5 points!
  2. Matteo Arcari (MatteoArcari) — 1961.0 points
  3. Nicola Dindo (_nikd_) — 1789.2 points
  4. Andrea Coato (acoatoitgs) — 1687.3 points

Let's try to finally win a gold medal.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +99
  • Проголосовать: не нравится

Автор TheScrasse, история, 15 месяцев назад, По-английски

Dear all,

We invite members of the programming contests community to submit tasks for the 3rd edition of the Western European Olympiad in Informatics (WEOI), to be held in Volterra, Italy on 27th-29th June 2025. Tasks should be similar in style to the IOI. For an idea of previous style and difficulty, you can find tasks from previous editions at https://weoi.org/weoi-2023/ and https://weoi.org/weoi-2024/. Authors of selected tasks will be credited in the official solutions and on the WEOI website.

Please send submissions to tasks@weoi.org by 15th March 2024; we welcome submission of task ideas that may not be polished or in final form. Unused submissions will be returned to task authors and will remain confidential to the Scientific Committee.

On behalf of the WEOI SC,
Luca Versari and Valerio Stancanelli

Полный текст и комментарии »

  • Проголосовать: нравится
  • +36
  • Проголосовать: не нравится

Автор TheScrasse, история, 18 месяцев назад, По-английски

Today I've taken part in AtCoder Regular Contest 186, solved problem E and spent the remaining 90 minutes not solving anything.

Then I've taken part in Codeforces Global Round 27 and spent 90 minutes solving 2035D - Yet Another Real Number Problem.

How to stop being stupid?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +194
  • Проголосовать: не нравится

Автор TheScrasse, история, 19 месяцев назад, По-английски

I clearly cannot write editorials (see here, here, etc.)

Can anyone please actually explain me how to write editorials properly? What I do now is just providing my thinking process to reach the solution, but it seems that most people have a very different thinking process.

UPD: after reading the comments, I think I got what's wrong in my editorials (and I tried to fix that, especially in the editorial of 2018B - Speedbreaker). One of the main issues is that I tend to skip algebraic manipulations, inequalities, etc. (i.e., steps that require simple algebra and/or mathematical logic), and it turned out that they can be the bottleneck for most people here (and maybe this is also the reason why 2018B - Speedbreaker is harder than 2018C - Tree Pruning). Lesson learned: if some numbers / variables appears from nowhere, I should try to elaborate, even if it's a single mathematical step.

For earlier problems, maybe I should also focus on how to convert the ideas into code.

Anyway, I think this comment helped me a lot to write a "better" editorial. In an ideal world, I would ask testers to read the initial version of the editorial and write similar comments, to help me "fix" the editorial. But during problem preparation, the editorial is the most neglected part for obvious reasons (there are a lot of little things that can ruin a contest, but in theory a contest can be held without even publishing an editorial), and ideally I don't want to fix the editorial 2 days after the contest end, because most people would have already read it. A solution might be just to give write access to the editorial directly to the testers and let them fix it if they had trouble understanding something?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +145
  • Проголосовать: не нравится

Автор TheScrasse, история, 19 месяцев назад, По-английски

All the Polygon materials (including the official implementations of all the problems) are here.

2019A - Max Plus Size

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Solution

2019B - All Pairs Segments

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Hint 3
Solution

2018A - Cards Partition

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Hint 3
Hint 4
Solution

2018B - Speedbreaker

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Solution

2018C - Tree Pruning

Author: wksni
Preparation: TheScrasse

Hint 1
Hint 2
Solution

2018D - Max Plus Min Plus Size

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Hint 3
Solution

2018E1 - Complex Segments (Easy Version), 2018E2 - Complex Segments (Hard Version)

Authors: lorenzoferrari, TheScrasse
Full solution: Flamire
Preparation: francesco, lorenzoferrari

Hint 1
Hint 2
Hint 3
Hint 4
Solution

2018F1 - Speedbreaker Counting (Easy Version), 2018F2 - Speedbreaker Counting (Medium Version), 2018F3 - Speedbreaker Counting (Hard Version)

Author: TheScrasse
Full solution: Flamire
Preparation: TheScrasse

Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Hint 6
Solution

Полный текст и комментарии »

Разбор задач Codeforces Round 975 (Div. 1)
Разбор задач Codeforces Round 975 (Div. 2)
  • Проголосовать: нравится
  • +131
  • Проголосовать: не нравится

Автор TheScrasse, история, 19 месяцев назад, По-английски

Ciao, Codeforces! We're glad to invite you to take part in Codeforces Round 975 (Div. 1) and Codeforces Round 975 (Div. 2), which will start on Sep/27/2024 16:35 (Moscow time). You will be given 6 problems and 2 hours and 30 minutes to solve them in both divisions. Some problems will be divided into subtasks.

UPD: the time has been changed to Sep/27/2024 16:35 (Moscow time), which is different from the time announced before. Please note the unusual starting time.

This round is based on Italian Olympiad in Informatics (OII) 2024.

The problems were authored by lorenzoferrari, wksni and me.

We would like to thank

Score distribution:

  • Div. 1: $$$500 - 750 - 750 - 1500 - (2250 + 750) - (1500 + 1500 + 1500)$$$
  • Div. 2: $$$500 - 1000 - 1750 - 2000 - 2000 - 3000$$$

We hope you'll like the problemset!

Update 1: the editorial is here.

Update 2: congratulations to the winners!

Winners and first solves

Полный текст и комментарии »

  • Проголосовать: нравится
  • +580
  • Проголосовать: не нравится

Автор TheScrasse, история, 20 месяцев назад, По-английски

For the ninth time, the Italian national contest (valid for the selection of the Italian IOI team) will be mirrored into an online contest. The contest is primarily intended for high school contestants, but everyone is welcome to participate! There are both easy subtasks (div2A) and very hard ones (div1D+), so it can be enjoyable both for newcomers and for very high rated contestants.

This year, there will be three online contests in total, held in the following order:

  1. a mirror of the practice contest (featuring original problems);
  2. an official (rated) Codeforces round based on the main contest;
  3. a mirror of the main contest.

Official Codeforces round

The format of the Codeforces round (2.) will be the usual Codeforces format, so you don't need any extra steps to register / participate. Another blog will be published a few days before the round.

Other rounds

About the other rounds (1. and 3.):

  1. The problem statements will be available in both English and Italian.
  2. Tasks will be IOI-like (with graders and subtasks) and you will have 5 hours to solve them.
  3. The only language allowed is C++.
  4. The time window for the practice contest (featuring original problems) will start on 2024 September 13th, 22:01 UTC and will end on 2024 September 25th, 21:59 UTC.
  5. Then, a rated Codeforces round based on the main contest will be held on September 27th (time to be decided).
  6. The time window for the main contest will start after the official Codeforces round, i.e., on September 27th (time to be decided).

The contests' timing will be USACO-like: you can decide when to start your 5-hours time window (after the login), but the contest will end at the given time regardless of your time window.

If you want to participate, you must:
  1. Visit the contest website: practice contest, main contest.
  2. Click the link "register", fill out the form and then click on the register button and then "back to login"
  3. You can now log in with the same username and password you used to sign up
  4. If the login is successful you will be ready to participate, just wait for the contest to start! (And maybe save the page in your bookmarks, so that you can quickly get back to it when the contest begins)
  5. When the contest starts, you will see a red button. Click it when you want to start your 5 hour time window!
  6. Good luck and have fun!

Ranking: The ranking of the online contest will be available at https://mirror.oii.olinfo.it/ranking when the contest starts.

Upsolving: After the end of the contest, tasks will be uploaded in the Italian training website https://training.olinfo.it (localised also in English), section "task & quiz archive", where they will be available for online evaluation (after registering to the website).

Полный текст и комментарии »

  • Проголосовать: нравится
  • +140
  • Проголосовать: не нравится

Автор TheScrasse, история, 2 года назад, По-английски

Hello everyone,

in this blog I'm trying to convince you that editorials are useful, especially if you read them "correctly".

"Algorithm $$$1$$$" vs "Algorithm $$$2$$$"

This is what many users do when reading the editorial for one problem (let's call it "algorithm $$$1$$$"):

  • Read it.
  • Repeat until able to implement the solution.
  • Implement the solution; possibly forget about any previous attempt to solve that problem without editorial, and any detail in the editorial that seems unrelated to the implementation of the solution.
  • Possibly, read the comments trying to find out how it is possible to come up with the solution in the editorial.

This is what you should do in my opinion (let's call it "algorithm $$$2$$$"):

  • Keep the editorial open until you are able to implement the solution, using both your ideas and editorial's ideas: sometimes, this just means opening the editorial for $$$1$$$ second, because you had already found most of the ideas on your own.
  • Implement the solution.
  • Re-read the editorial carefully, and pretend you can modify it; ask yourself which parts of the editorial you would modify.
  • Possibly, read the comments to find additional insights / ideas.

(I'm not saying "algorithm $$$2$$$" is the best way to use editorials. It's just a method that works for me, and seems strictly better than "algorithm $$$1$$$". Feel free to find your own way to use editorials.)

Examples:

1909B - Make Almost Equal With Mod

Algorithm $$$1$$$:

  • Read the editorial.
  • Understand that, for some unintuitive reason (i.e., some math formulas), you only need to check $$$k = 2^i$$$.
  • Implement the solution.
  • Read the comments; find out that an alternative solution is printing $$$k = 2 \cdot \gcd(|a_i - a_{i+1}|)$$$. Convince yourself that you could come up with that by trial and error, and lots of small examples on paper (i.e., do some "proof by examples").

Algorithm $$$2$$$:

  • Look at the picture for some time (between $$$1$$$ second and $$$5$$$ minutes), understand what's going on, understand the solution.
  • Implement the solution.
  • Re-read the editorial carefully. Read the comments and find out that an alternative solution is printing $$$k = 2 \cdot \gcd(|a_i - a_{i+1}|) =: 2g$$$. This seems a completely different solution, but let's check if you can use the editorial to prove it fast.
  • We have to prove $$$f(2g) = 2$$$. But $$$f(g) = 1$$$ because all the $$$a_i$$$ modulo $$$g$$$ are the same. Then, either $$$f(2g) = 1$$$ or $$$f(2g) = 2$$$ (according to the editorial). But $$$f(2g) \neq 1$$$ because otherwise $$$\gcd(|a_i - a_{i+1}|)$$$ would be a multiple of $$$2g$$$.

With both algorithm $$$1$$$ and algorithm $$$2$$$ you would learn two solutions, but only with algorithm $$$2$$$ you would have a "full" understanding of them.

  • With algorithm $$$1$$$, you could get conclusions such as "when number $$$2$$$ appears in the statement, consider binary representation" or "when $$$\text{mod}$$$ appears in the statement, consider $$$\text{gcd}$$$" which seem random and not so practical.
  • With algorithm $$$2$$$, you have an intuitive visualization and an actual proof of the solution. You have also used the proof in the editorial to prove another (seemingly unrelated) solution (so proofs are not useless!). You learned the "binary" trick, but you also got better at proving stuff.

1909C - Heavy Intervals

Algorithm $$$1$$$:

  • Read the editorial.
  • Understand that, for some unintuitive reason (i.e., a proof which seems unnecessarily long), you need a bracket matching.
  • Implement the solution.
  • Read the comments; find out that many people tried to sort $$$l$$$ and $$$r$$$ in ascending order, but somehow it does not work.

Algorithm $$$2$$$:

  • Look at the picture for some time (between $$$1$$$ second and $$$5$$$ minutes), understand what's going on, understand the solution.
  • Implement the solution.
  • Re-read the editorial carefully. Ask yourself why the proof is so long. In particular, why do we need "Keep swapping endpoints until you get the "regular" bracket matching. You can show that the process ends in a finite number of steps"? Can't you just swap a single pair of endpoints to show that intersecting segments are never optimal?
Spoiler
  • Read the comments; find out that many people tried to sort $$$l$$$ and $$$r$$$ in ascending order. Realize a fun fact: sorting $$$l$$$ and $$$r$$$ in ascending order is the worst possible ordering (assuming you sort $$$c$$$ correctly).

Conclusions

Editorials are not evil! But, if you are not improving, ask yourself if you are reading them correctly.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +172
  • Проголосовать: не нравится

Автор TheScrasse, история, 2 года назад, По-английски

Sorry for weak tests in 1917C - Watering an Array.

Initially, the statement had the array $$$b$$$ in input, and we had to do these three things simultaneously:

  • make $$$O(n^2)$$$ pass;
  • make $$$O(nd)$$$ fail;
  • make $$$d$$$ small enough (i.e., $$$\leq 10^6$$$), so that the input could be read fast in any language.

But $$$O(nd)$$$ was too fast, so (on Dec 22) we decided to use $$$d \leq 10^9$$$ and compress the array. But testers had already tested the old version of the problem, and I can't expect testers to reset their memory and retry the problem, so no one found the wrong $$$O(nk)$$$ solution.

I'm sorry for making at least two mistakes:

  • Modifications 2 days before the contest may be ok, but they must be checked very carefully because fewer testers will see them.
  • I should have checked the existence of a pretest with all small cases. Maybe in this problem such test is not so comfortable to make, but you can achieve a similar effect by using a pretest with many random cases where every value in the input is small.

Please downvote this blog (instead of the announcement).

Полный текст и комментарии »

  • Проголосовать: нравится
  • +515
  • Проголосовать: не нравится

Автор TheScrasse, 2 года назад, По-английски

text Ciao, Codeforces! We're glad to invite you to take part in Pinely Round 3 (Div. 1 + Div. 2), which will start on Dec/23/2023 17:35 (Moscow time). You will be given 9 problems and 3 hours to solve them. One of the problems will be divided into two subtasks.

The problems were authored and prepared by me.

Spoiler

We would like to thank

Score distribution: $$$500 - 1000 - 1500 - 2000 - 2500 - (1500 + 1500) - 4000 - 6000 - 6000$$$

We hope you'll like the problemset!

Update 1: the editorial is here.

Update 2: congratulations to the winners!

This round is made possible with the support of Pinely!

Pinely is an algorithmic trading firm, with its main focus set on high-frequency and ultra-low-latency trading. They have offices in Amsterdam, Limassol, Singapore, and Shanghai and are open for job discussions. Pinely is a team of winners, awardees, and medalists of various competitions in respective fields such as ICPC, IMC, HITB PRO CTF, and Google HashCode, etc. They constantly face various challenges such as developing strategies for trading, optimizing trading systems to achieve the lowest latency reactions to various market events, and saving and processing large volumes of historical data.

You can find out more about Pinely on their website or from their employees registered here on Codeforces. If you want to join the Pinely team, please send your CV to hr@pinely.com or fill in the form:

Apply

Prizes: top 30 contestants and 10 random contestants placed 31-100 will receive a branded Pinely hoodie :)

Полный текст и комментарии »

  • Проголосовать: нравится
  • +797
  • Проголосовать: не нравится

Автор TheScrasse, история, 2 года назад, По-английски

The official implementations of all the problems are here.

Timeline of the round proposal (may contain spoilers)

1909A - Distinct Buttons

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Solution

1909B - Make Almost Equal With Mod

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Hint 3
Solution

1909C - Heavy Intervals

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Hint 3
Solution

1909D - Split Plus K

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Hint 3
Solution

1909E - Multiple Lamps

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Hint 3
Hint 4
Solution

1909F1 - Small Permutation Problem (Easy Version), 1909F2 - Small Permutation Problem (Hard Version)

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Hint 3
Hint 4
Solution

1909G - Pumping Lemma

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Solution

1909H - Parallel Swaps Sort

Author: TheScrasse
Full solution: Endagorion, errorgorn
Preparation: TheScrasse, francesco

Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Hint 6
Hint 7
Hint 8
Hint 9
Hint 10
Hint 11
Hint 12
Solution

1909I - Short Permutation Problem

Author: TheScrasse
Full solution: errorgorn
Preparation: TheScrasse

Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Hint 6
Solution

Полный текст и комментарии »

Разбор задач Pinely Round 3 (Div. 1 + Div. 2)
  • Проголосовать: нравится
  • +354
  • Проголосовать: не нравится

Автор TheScrasse, история, 2 года назад, По-английски

This problem was going to be used in Pinely round...

Problem

but it has exactly the same solution as 1913D - Array Collapse.

A while ago I invented another problem, but my coordinator rejected it because the authors of Hello 2024 (whose coordinator is the same) had just invented the same exact problem!

:(

Полный текст и комментарии »

Теги sad
  • Проголосовать: нравится
  • +329
  • Проголосовать: не нравится

Автор TheScrasse, история, 3 года назад, По-английски

For the eighth time, the Italian national contest (valid for the selection of the Italian IOI team) will be mirrored into an online contest. The contest is primarily intended for high school contestants, but everyone is welcome to participate! There are both easy subtasks (div2A) and very hard ones (div1D+), so it can be enjoyable both for newcomers and for very high rated contestants.

  1. The problem statements will be available in both English and Italian.
  2. Tasks will be IOI-like (with graders and subtasks) and you will have 5 hours to solve them.
  3. The only language allowed is C++.
  4. The time window for the practice contest (featuring original problems) will start on 2023 September 30th, 00:00 CET and will end on 2023 October 10th, 23:59 CET.
  5. The time window for the main contest will start on 2023 October 13th, 10:00 CET and will end on 2023 October 14th, 15:00 CET.

The contests' timing will be USACO-like: you can decide when to start your 5-hours time window (after the login), but the contest will end at the given time regardless of your time window.

If you want to participate, you must:

  1. Visit the contest website: https://mirror.oii.olinfo.it
  2. Click the link "register", fill out the form and then click on the register button and then "back to login"
  3. You can now log in with the same username and password you used to sign up
  4. If the login is successful you will be ready to participate, just wait for the contest to start! (And maybe save the page in your bookmarks, so that you can quickly get back to it when the contest begins)
  5. When the contest starts, you will see a red button. Click it when you want to start your 5 hour time window!
  6. Good luck and have fun!

Ranking: The ranking of the online contest will be available at https://mirror.oii.olinfo.it/ranking when the contest starts.

Upsolving: After the end of the contest, tasks will be uploaded in the Italian training website https://training.olinfo.it (localised also in English), section "task & quiz archive", where they will be available for online evaluation (after registering to the website).

Полный текст и комментарии »

  • Проголосовать: нравится
  • +106
  • Проголосовать: не нравится

Автор TheScrasse, история, 3 года назад, По-английски

Hi everyone,

after Codeforces Round 889 (Div. 1), maybe it's time to collect all my problems here. For now, I've mainly invented easy-ish problems. I wish to invent a very hard problem sooner or later :)

Update after Pinely Round 3

I'm putting the story of each problem under spoiler, because it may contain parts of the solution. I invented many problems by just trying random setups until I came up with something solvable, but some problems (especially the harder ones, for example 1854D - Michael and Hotel) may have more interesting stories.

Fun facts:

  • I struggled a lot to find a suitable div2A for Codeforces Round 778 (Div. 1 + Div. 2, based on Technocup 2022 Final Round). I proposed a lot of problems that turned out to be unsuitable (for example, because they were too hard), then I used them somewhere else.
  • While I was writing this blog, I realized that 1849E - Max to the Right of Min is identical to my problem preoii_allenamento - Allenamento su ChinaForces, and I could just copypaste the code. Unfortunately I realized this $$$20$$$ minutes after the start of the contest, and I couldn't get the first AC :D
  • Sometimes, if you just remove parts of the statement, the problem becomes better (and sometimes harder)! For example, initially 1854D - Michael and Hotel and preoii_statue - Galleria d'arte were relatively easy problems with a slightly longer statement (e.g., in 1854D - Michael and Hotel it was guaranteed that the input had a special structure), but making the statement simpler also made these problems more interesting.
  • Coming up with a good problem starting from the solution is really hard (at least for me). After failing to generate any difficult problem from the solution, I would say I fully agree with Um_nik's last pro tip.

Authored (roughly sorted by difficulty)

preoii_vm - Aggiornamento della macchina virtuale

Story

cc PATHPAR - Path Parity

Story

cc XORPERM - Xor Permutation

1909A - Distinct Buttons

Story

1485A - Add and Divide

Story

cc SUMPRODSEG - Sum Product Segments

Story

cc MXMODSUM - Maximum Pairwise Modular Sum

Story

1855B - Longest Divisors Interval

Story

terry 2023/3 - Dipingere i muri

Story

1485B - Replace and Keep Sorted

Story

1928B - Equalize

Story

cc SEGFAULT - Segmentation Fault

Story

cc SUBARRAYLEN - Subarrays with length

Story

terry 2023/4 - Viaggio intrigante

Story

1909B - Make Almost Equal With Mod

Story

1909C - Heavy Intervals

Story

cc ANTIKNAPSACK - Anti-knapsack

Story

cc THROWTAKE - Throw and Take

Story

ois_fibonacci - Fibonacci Sequences

Story

1854A2 - Dual (Hard Version)

Story

1909D - Split Plus K

Story

1485D - Multiples and Power Differences

Story

1854B - Earn or Unlock

Story

preoii_armadio - Evasione dall'armadio

Story

UOI 2023/7 - Add Again

Story

1485E - Move and Swap

Story

1485F - Copy or Prefix Sum

Story

1909E - Multiple Lamps

Story

cc NDANDANDOR - Non-decreasing AND and OR

Story

1854C - Expected Destruction

Story

preoii_allenamento - Allenamento su ChinaForces

Story

ois_aliga - A Day in Olbia

Story

cc PERMSEGMENTS - Permutation Segments

Story

1909F2 - Small Permutation Problem (Hard Version)

Story

1854D - Michael and Hotel

Story

1909G - Pumping Lemma

Story

1909I - Short Permutation Problem

Story

1909H - Parallel Swaps Sort

Story

Partially authored (roughly sorted by difficulty)

1654A - Maximum Cake Tastiness

Story

preoii_triplets - Comune di Alleib

Story

1485C - Floor and Mod

Story

arc147_c - Min Diff Sum

Story

preoii_permutazione2 - Trova la permutazione

Story

preoii_sets - Insiemi nell'armadio

Story

oii_corridoi - Arte nei corridoi

Story

1762E - Tree Sum

Story

preoii_statue - Galleria d'arte

Story

UOI 2023/4 - Array and prefix sums

Story

1654H - Three Minimums

Story

Полный текст и комментарии »

  • Проголосовать: нравится
  • +75
  • Проголосовать: не нравится

Автор TheScrasse, история, 3 года назад, По-английски

Ciao, Codeforces! We're glad to invite you to take part in Codeforces Round 889 (Div. 1) and Codeforces Round 889 (Div. 2), which will start on Jul/29/2023 17:35 (Moscow time). You will be given 6 problems and 2 hours and 30 minutes to solve them in both divisions.

  • One of the problems will be divided into two subtasks.
  • One of the problems will be interactive, so please read the guide for interactive problems if you are not familiar with it.

The problems were authored and prepared by akifpatel, dario2994, Kaey and me.

We would like to thank

Score distribution:

  • Div. 1: $$$(750 + 750) - 1500 - 1500 - 2000 - 2750 - 3250$$$
  • Div. 2: $$$500 - 1000 - (1250 + 1250) - 2500 - 2500 - 3000$$$

We hope you'll like the problemset!

Update 1: the editorial is out.

Update 2: congratulations to the winners!

Winners and first solves

Полный текст и комментарии »

  • Проголосовать: нравится
  • +377
  • Проголосовать: не нравится

Автор TheScrasse, 3 года назад, По-английски

The official implementations of all the problems are here.

1855A - Dalton the Teacher

Author: Kaey
Preparation: akifpatel

Hint 1
Hint 2
Solution

1855B - Longest Divisors Interval

Author: TheScrasse
Preparation: TheScrasse

Hint 1
Hint 2
Hint 3
Hint 4
Solution

1854A1 - Dual (Easy Version)

Author: TheScrasse
Preparation: akifpatel

Hint 1
Hint 2
Hint 3
Hint 4
Solution

1854A2 - Dual (Hard Version)

Author: TheScrasse
Preparation: akifpatel, dario2994

The hints and the solution continue from the easy version.

Hint 5
Hint 6
Hint 7
Hint 8
Hint 9
Solution

1854B - Earn or Unlock

Author: TheScrasse
Preparation: akifpatel

Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Hint 6
Solution

1854C - Expected Destruction

Author: TheScrasse
Preparation: akifpatel

Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Hint 6
Solution

1854D - Michael and Hotel

Author: TheScrasse
Preparation: akifpatel

Hint 1
Hint 2
Hint 3
Hint 4
Solution

1854E - Game Bundles

Author: dario2994
Preparation: akifpatel, dario2994

Hint 1
Hint 2
Hint 3
Solution

1854F - Mark and Spaceship

Author: dario2994
Preparation: akifpatel, dario2994

Hint 1
Hint 2
Hint 3
Solution

Полный текст и комментарии »

Разбор задач Codeforces Round 889 (Div. 1)
Разбор задач Codeforces Round 889 (Div. 2)
  • Проголосовать: нравится
  • +196
  • Проголосовать: не нравится

Автор TheScrasse, история, 3 года назад, По-английски

Hello, Codeforces! We're glad to invite you to take part in WPF Sudoku GP7.

  • Authors: Giulia Franceschini, Stefano Forcolin, Valeria Losasso, Valerio Stancanelli (TheScrasse).
  • The time window is USACO-style: you can choose any time window of $$$90$$$ minutes from Jul 7th to Jul 10th.
  • The instruction booklet with the score distribution is available here.

Why should you join?

  • If you are good at competitive programming, expect to be good at sudoku.
  • There are $$$13$$$ grids of different difficulties: anyone can find something to solve.
  • You will compete against tourist!

We hope you'll like the round!

Полный текст и комментарии »

  • Проголосовать: нравится
  • +90
  • Проголосовать: не нравится

Автор TheScrasse, история, 3 года назад, По-английски

A while ago, I posted this blog. I was wrong.

In CodeRush May '23 (a contest with prizes), problem E was copied from yukicoder. The sample input is also almost the same: the CodeRush organizers just made it weaker by removing the last 2 queries!

Problemsetters, please stop.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +101
  • Проголосовать: не нравится