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**

**Story**

**Story**

**Story**

**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**

**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**

**Story**

cc ANTIKNAPSACK - Anti-knapsack

**Story**

**Story**

ois_fibonacci - Fibonacci Sequences

**Story**

**Story**

**Story**

1485D - Multiples and Power Differences

**Story**

**Story**

preoii_armadio - Evasione dall'armadio

**Story**

**Story**

**Story**

**Story**

**Story**

cc NDANDANDOR - Non-decreasing AND and OR

**Story**

**Story**

preoii_allenamento - Allenamento su ChinaForces

**Story**

**Story**

cc PERMSEGMENTS - Permutation Segments

**Story**

1909F2 - Small Permutation Problem (Hard Version)

**Story**

**Story**

**Story**

1909I - Short Permutation Problem

**Story**

**Story**

### Partially authored (roughly sorted by difficulty)

1654A - Maximum Cake Tastiness

**Story**

preoii_triplets - Comune di Alleib

**Story**

**Story**

**Story**

preoii_permutazione2 - Trova la permutazione

**Story**

preoii_sets - Insiemi nell'armadio

**Story**

oii_corridoi - Arte nei corridoi

**Story**

**Story**

preoii_statue - Galleria d'arte

**Story**

UOI 2023/4 - Array and prefix sums

**Story**

**Story**

I love your questions because of how concise they are.

I wish people like you become immortal and stay healthy.

Thanks! I like the problem 1854C & 1854D.

by the way what is the random solution from JOI 2019 — Virus Experiment ?

I guess this is an implementation of the random solution.

The main idea is that you simulate the process starting from random nodes, and you can discard some nodes (i.e., they don't achieve the minimum number of infections) if you end up in a past starting point. The complexity is $$$O(n \log n)$$$ on average. The initial version of my problem was basically this idea, made interactive.