nifeshe's blog

By nifeshe, 3 months ago, In English

Special thanks to reirugan, weirdflexbutok and Intellegent for helping with editorials.

2191A - Array Coloring

Hints
Solution
Code
Rate The Problem!

2191B - MEX Reordering

Hints
Solution
Code
Rate The Problem!

2190A - Sorting Game

Hints
Solution
Code
Rate The Problem!

2190B1 - Sub-RBS (Easy Version)

Hints
Solution
Code
Rate The Problem!

2190B2 - Sub-RBS (Hard Version)

Hints
Solution
Code
Rate The Problem!

2190C - Comparable Permutations

Hints
Solution
Code
Rate The Problem!

2190D - Prufer Vertex

Hints
Solution
Code
Rate The Problem!

2190E - Median Permutation

Special thanks to Sana for showing me how to go from $$$O(n^2)$$$ to $$$O(n)$$$.

Hints
Solution
Code
Rate The Problem!

2190F - Xor Product

Hints
Solution
Code
Rate The Problem!

2190G - Maximize Determinant

Hints
Solution
Code
Rate The Problem!

Full text and comments »

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

By nifeshe, 4 months ago, In English

Hello Codeforces,

After decades of hard work and several quality reviews from independent third parties, I'm delighted to invite you to participate in Codeforces Round 1073 (Div. 1), and, if you really want to, Codeforces Round 1073 (Div. 2), which will both held on Jan/17/2026 17:35 (Moscow time).

In each division, you will be given $$$7$$$ problems and $$$3$$$ hours to solve them, one of which will be divided into subtasks. Problems were mainly authored by me, nifeshe, with help from nika-skybytska and satyam343. Only $$$6$$$ or $$$7$$$ problems will not be interactive in each division, so please make sure to read the guide for interactive problems before the contest.

In related news, we’ve already been awarded the Nobel Peace Prize for this round, for achieving a level of problem quality so universally accepted that all global conflicts have been resolved.

I would like to thank the following people for making the contest possible:

The score distribution is below.

Div. 1:

A B C D E F G
$$$500$$$ $$$(750 + 750)$$$ $$$1750$$$ $$$2250$$$ $$$2750$$$ $$$3500$$$ $$$3750$$$

Div. 2:

A B C D E F G
$$$500$$$ $$$1000$$$ $$$1250$$$ $$$(1500 + 1250)$$$ $$$2750$$$ $$$3250$$$ $$$3750$$$

Unlike other rounds, this one will only be held once, so I sincerely hope you will not skip the round and enjoy all of the problems.

UPD 1 The hacks are disabled for problems A — D2 in Div 2, and for problems A — B2 in Div 1. We have final tests consisting of pretests and hacks for all problems.

UPD 2 Editorial

UPD 3

Congratulations to the winners.

Div. 1:

  1. Petr
  2. strapple
  3. jiangly
  4. tourist
  5. Radewoosh

Div. 2 (subject to change):

  1. LHNB
  2. xoxoKitty
  3. EchidnaTea
  4. AuroraUwU
  5. t1e1

First solves:

Div. 1:
A. 00:02:15 by TKT_YI
B1. 00:08:23 by Petr
B2. 00:14:54 by strapple
C. 00:35:39 by jiangly
D. 00:21:27 by PCTprobability
E. 01:42:55 by XVIII
F. 02:53:16 by olmrgcsi
G. 01:34:40 by rainboy

Div. 2 (subject to change):
A. 00:01:21 by akshW
B. 00:05:49 by khushicodes03
C. 00:10:28 by ansh91627
D1. 00:12:47 by CoderMeow
D2. 00:18:11 by sks4401
E. 00:54:52 by crimson_leaf
F. 00:47:03 by shobhitgagrani.coding33
G. 02:54:37 by dooglius

Full text and comments »

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

By nifeshe, 15 months ago, In English
Rating predictions

2056A - Shape Perimeter

Hints
Solution
Code

2056B - Find the Permutation

Hints
Solution
Code

2056C - Palindromic Subsequences

Hints
Solution
Code

2056D - Unique Median

Hints
Solution
Code

2056E - Nested Segments

Hints
Solution
Code

2056F1 - Xor of Median (Easy Version), 2056F2 - Xor of Median (Hard Version)

Hints
Solution
F1 code
F2 code

Full text and comments »

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

By nifeshe, 16 months ago, In English

Hi, Codeforces!

I'm delighted to invite you to the best/second best/third best round of 2025 so far! Codeforces Round 997 (Div. 2) will be held on Jan/17/2025 17:35 (Moscow time). You will be presented with at least $$$6$$$ and at most $$$6$$$ problems, one of which might be divided into two subtasks, and $$$2$$$ hours to solve them.

Many of you may not believe it, but the problems were authored and written by nifeshe with a great help from maomao90. Moreover, I would like to thank:

The score distribution is as follows: $$$500-1250-1500-2000-2250-(2750+1250)$$$.

I hope you will find a non-empty subset of problems to be interesting. Good luck!

UPD 1: Editorial

UPD 2: Congratulations to the top 5!

Div. 1 + 2:

  1. maspy
  2. BurnedChicken
  3. jiangly
  4. antontrygubO_o
  5. Sugar_fan

Div. 2:

  1. OdtreeKing
  2. saaaalty
  3. STUDENT0
  4. rainboy
  5. MamurjonDeveloper

UPD 3: First solves:

A. 00:02:01 by hitonanode

B. 00:02:17 by pipi0818

C. 00:03:52 by Proof_by_QED

D. 00:13:53 by wishgoodluck

E. 00:18:06 by zdc123456

F1. 00:27:48 by peti1234

F2. 00:28:40 by rainboy

Full text and comments »

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

By nifeshe, 22 months ago, In English

Yesterday some guy posted a blog about accidentally submitting a solution to a problem in the most recent round meaning to do it after the contest ends. He entered a competition, lost 233 rating and then requested to make the contest unrated to him. As it is already clear to probably everyone, he participated from an alt and meant to submit from it, but for some reason logged in from his main.

Screenshot

I quickly found his alt and made a comment. Shortly after that he deleted the blog.

Here is a guide on how to find alts!

Look at the submissions

This method works very frequently. What do people oftenly do after participating in a contest from an alt? They resubmit all the problems from their main. This is how it looks like in the example above:

5 problems were submitted in 1 minute. It means that the guy was either the tester in that round, or participated from an alt. If we know that it is the latter, there is a high probability that we can find his alt already. Go to any problem that he submitted there (prefferably the one with less solves), sort all the submissions on it by the execution time and check all the solutions that have that exact execution time and memory usage. You can also try to only look for the submissions that use his language, but it might not work (as seen below).

Spoiler

If we get lucky, we can find the alt from the first try. In this case we didn't, because his submissions from the alt and the main had different execution times:

We should try again! After 2 more attempts, we find this:

Spoiler

After seeing that, we verify that is it indeed his alt from his name and codestyle. This is how I initially found it.

Search the handle

You would be amazed to know how many alts I found like that. Just look up the handle or any part of it. In this case we find his unrated alt:

Search the handle harder

Since searching handles manually is hard, we can try to do something with code. There are (probably) many clustering algorithms, we can try to use them on the list of handles and check the cluster the handle is in. I have no idea how to do any of that, so I simply asked ChatGPT to make something in Python and it worked. It produced the following after some of my modifications:

generating clusters
saving the clustering to a txt file
getting a cluster of a handle

I don't know (and, frankly, don't care) how this all works, I just tweaked the constants so it produced a reasonable result after running for 1 hour. Here is a download link if someone is interested. Only active users who have the highest rating of at least 1600 are included. As we can see, the cluster my handle is in is: ['nifeshe', 'nifes', 'knifeman', 'iamnifer', 'coniferousdyer'], which indeed contains similar handles to mine.

There are some other ways to find an alt, such as looking through the standings and getting HTML pages of the submissions, but they will rarely work and the 3 methods above are already enough in most cases. Good luck on losing your friends!

Full text and comments »

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