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

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

你好,Codeforces!

We (WDOI team) are delighted to invite you to participate in Codeforces Round 1098 (Div. 2), which will be held on May/16/2026 17:35 (Moscow time). You will be given $$$6$$$ problems, including two problems each having easy and hard versions, and $$$2$$$ hours and $$$15$$$ minutes to solve them. This round will be rated for the participants with rating lower than 2100.

The problems are authored and prepared by Sugar_fan and me.

The score distribution:

A B C D E F
$$$500$$$ $$$750$$$ $$$(1500+1000)$$$ $$$2500$$$ ($$$2000$$$ + $$$1500$$$) $$$3500$$$

We would like to express our sincere thanks to the following individuals for their contributions and for making this round possible:

We are a team made up of fans of both competitive programming and the Touhou Project. Although this isn’t our first time hosting contests on Codeforces — we previously organized Codeforces Round 796 (Div. 1) and Codeforces Round 796 (Div. 2) — I authored most of the problems in this round with little assistance. In 2022, most of our members were Olympiad in Informatics (OI) participants, but over the four years since then, many have stepped away from OI and competitive programming. While the older generation may eventually fade away, newcomers like me aim to keep our community alive by injecting fresh energy and passion into what we love. I hope this kind of pure love persists and carries on.

Across these six problems, you will meet characters with their own distinct personalities and beliefs.

Marisa stole Reimu’s takeout and vanished before the shrine maiden could react. Hungry and sharp-eyed, Reimu marched to the Scarlet Devil Mansion, challenged Remilia to a fierce game of Hisoutensoku, and claimed victory—along with her lunch. Near the Misty Lake, Cirno found a cold number frozen in the ice. With a child’s certainty, she reshaped it into a beautiful ice crystal, perfect and gleaming. Atop the Youkai Mountain, Sanae watched the stars and prayed for fortune, her quiet hopes rising with each passing light. Elsewhere, an Amanojaku teetered on the edge of ruin. In Yukari’s contest, it solved a problem others deemed impossible, reversing its fate and reclaiming its place.

Hearing of these scattered lives, Momoyo built a grand network across Gensokyo — linking shrines, mansions, and factions. Conflict gave way to conversation, and peace settled softly over the land. Harmony replaced trouble, and laughter returned to the air.

Help them overcome these trials through your logic, and find satisfaction in lending a hand. We hope you enjoy the round. Good Luck and Have Fun!

May Gensokyo’s peace endure — and may the real world, too, know such days.

UPD1: Tutorial

UPD2:

The top five (official):

  1. the_chill
  2. nguyenphong233
  3. oleinikowc
  4. edmondium23
  5. mo_mo_yu

The top five (unofficial):

  1. the_chill
  2. nguyenphong233
  3. oleinikowc
  4. maspy
  5. edmondium23

The first solvers :

UPD3: Apology

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

»
4 месяца назад, скрыть # |
Rev. 2  
Проголосовать: нравится +15 Проголосовать: не нравится

Same task arrangement as the last full-cf div2 round!

I like that and hope to become master again awa.

Good luck to everyone!

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится -11 Проголосовать: не нравится

As TheWorse, I will become the worst of this round. And future rounds.

»
4 месяца назад, скрыть # |
Rev. 2  
Проголосовать: нравится +8 Проголосовать: не нравится

As a fan of yiren, I will be in my wheelchair in this round.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +24 Проголосовать: не нравится

As a tester, I enjoy watching you suffer.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +28 Проголосовать: не нравится

As a tester,wish you good luck and enjoy the contest! Kochiya Sanae is so cute!!!

»
4 месяца назад, скрыть # |
Rev. 2  
Проголосовать: нравится +38 Проголосовать: не нравится

As a tester, I hope you can possess the same wisdom as Cirno to solve these problems.

»
4 месяца назад, скрыть # |
Rev. 2  
Проголосовать: нравится +11 Проголосовать: не нравится

Sometimes I feel like changing my profile picture to anime girl is my missing piece to improve.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +12 Проголосовать: не нравится

As a tester, I am a tester!

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

Manifesting postive delta for all.

»
4 месяца назад, скрыть # |
Rev. 2  
Проголосовать: нравится -9 Проголосовать: не нравится

As a participant, trust the Chinese

Spoiler
»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

As a tester,I tested.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I'm a member

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

is this genshin impact?

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

While the older generation may eventually fade away, newcomers like me aim to keep our community alive by injecting fresh energy and passion into what we love. I hope this kind of pure love persists and carries on.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

why does she hold a shovel? what does it have to do with wind

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

As a potential participant, I potentially participate.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

As the statement writer for the last WdOI round, I look forward to reading new fancy Gensokyo lore.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Why no interactive problems? I love interactive problems!

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

As a participant, I will observe other people solving F.

»
4 месяца назад, скрыть # |
Rev. 2  
Проголосовать: нравится -19 Проголосовать: не нравится

.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

i'm very intersted

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can you bring it to Luogu?

»
4 месяца назад, скрыть # |
Rev. 2  
Проголосовать: нравится -10 Проголосовать: не нравится

I'm interested.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

good luck to everyone. peace <3

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Hope I can solve at least one problem to get some rating... and to enable myself to write blogs (and catch cheaters).

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can someone explain what does 1500+1000 means in question c.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится -8 Проголосовать: не нравится

Is that AI-generated art? Ugh

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

As a newbie, solving B would already make my day lol

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

As a participant, let's go

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +17 Проголосовать: не нравится

Why so loooooooooooong queueueueueueueue :-(

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

as a tester and a student suffering from midterm exams, wish everyone good luck!

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

aaaahhhh !!! ... queue too slow

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится -14 Проголосовать: не нравится

Queueforces during the contest again... and again...

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

kiram to kos nane jendat madar kosde ye pedar kiri

koskesh kiri in che anie khar kosde

soalaro az to konet dar ovordi ?

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

I am stuck, I am in WAforces

»
4 месяца назад, скрыть # |
Rev. 2  
Проголосовать: нравится +1 Проголосовать: не нравится

я не расист, но нормальных раундов от китайцев я пока не видел

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

C is too hard for me. I have tried 10 times. But all the result is wa 2

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

Why was D 2500 points?????

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

The problems stay in the queue for a very long time, and that affected my performance badly from the very beginning of the contest.

Besides that, Problem B was basically just printing the answer — there was no real work involved. Most people probably got wrong answers because of some corner case. Honestly, I don’t see much value in a problem like that.

Bad starts have a huge impact on performance throughout the entire contest.

  • »
    »
    4 месяца назад, скрыть # ^ |
     
    Проголосовать: нравится -12 Проголосовать: не нравится

    I think there was no work involved for you but many people like me it was a learning. I was unable to solve it. Its discouraging to see your comment. I dont think the author's are stupid enough to give a print answer question. You got to get the answer to print answer and many people struggled on problem 2 until it clicked for them.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

not sure if it was intended, but example test cases were very useless

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +49 Проголосовать: не нравится

CornerCaseForces :(

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

I felt it was kind of an easy round?

$$$A$$$ and $$$B$$$ were pretty easy. $$$D$$$ was kinda a common idea.

$$$C1$$$ and $$$C2$$$ genuinely gave me a headache, but the idea was simple though.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

Some feedback:

  • C1 and C2: trivial to mindsolve but implementation-hell
  • D: too standard, and I don't understand why the time limit is so tight
  • E1: beautiful, I really liked it
  • E2: I think this can be solved with 3d mo's? it would be crazy to implement though
»
4 месяца назад, скрыть # |
Rev. 2  
Проголосовать: нравится +8 Проголосовать: не нравится

Honestly, getting past B, C1, C2 was so fckn difficult. I'm still not sure I'll pass tests on them. Tight constraints on D as well.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Loved the contest! TL too tight on D tho

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

I was really astonished when I see problem C appears in Codeforces. The style is so special in Codeforces...

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +63 Проголосовать: не нравится

Ragebait contest

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

so hard B :/

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Bro mistakenly set the questionnaire of Div 1. :(((

Hardforcess

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +24 Проголосовать: не нравится

implementation hell...

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Waiting for editorial..

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Hello! I have a question regarding B. Suppose you have the 2 placed such that on both sides the number of free position is equal ? Is the answer then not k + min(dist,n-dist) — 1 ? The -1 comes from: She stays, he moves towards her, then she starts moving the other way, so in the k he gains 1 distance to her, hence it should be less. Let me know !

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +46 Проголосовать: не нравится

whoever made c

never cook again, impl hell isn't fun please remember that

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

C1 TLEforces

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +21 Проголосовать: не нравится

weaksampleforces

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Any hints for E1?

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

I rarely give contests But when I give contest it be like :

»
4 месяца назад, скрыть # |
Rev. 2  
Проголосовать: нравится +6 Проголосовать: не нравится

I don’t know what the point D has 2e6 input, I know author want to hack O(n lg n) solution, but making n 2e6 only make the bottleneck be input, and force users to use fast read, which is meaningless. Author can make alternative way, like given a random generator and let user generate the points by themselves.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Why do I even have to rewrite my C++ solution into pure C just to pass Problem D’s time limit?

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +22 Проголосовать: не нравится

corner case contest :/

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Please make the TL for problem D bigger and rejudge the submissions. The TL is too tight, to the point where the bottleneck seems to be input processing. Implemented it in O(N) but still got TLE.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I had a stupid bug in C2 because I didn't pay attention that n could be equal to 1. I didn't manage to find it till the end of the contest. Sadge.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +16 Проголосовать: не нравится

C was a nightmare

»
4 месяца назад, скрыть # |
Rev. 3  
Проголосовать: нравится +16 Проголосовать: не нравится

My initial rating was 2098. I originally hoped to reach Master after this contest.

But, I got stuck by numerous corner cases on problems C1 and C2, resulting in six consecutive WA on pretest #2. This directly led to my poor performance, and I feel really upset about it.

In addition, I think setting the upper limit of n in problem D to 2e5 would be the most appropriate. Making n ≤ 2e6 only forces us to add a bucket sort on the standard solution, and I really don't understand why the problem setter chose to set n up to 2e6.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

corner case forces :|

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I lose the score badly because I don't know "llabs()" at C1 and C2…

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +25 Проголосовать: не нравится

You say you want to carry on the "pure love" of that passion.

But which I see is you are just stealing others love of CP by setting such ragebait problemset.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +27 Проголосовать: не нравится

TIME LIMIT EXCEEDED ON TEST CASE 19-forces

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

goodbye expert

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

This is by far the worst Codeforces round i participated in. 0% problemsolving 100% debugging. Both B, and C just consisted of considering the edge cases correct.

»
4 месяца назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

CornercaseForces

»
4 месяца назад, скрыть # |
Rev. 8  
Проголосовать: нравится +4 Проголосовать: не нравится

.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

Worst contest I have ever participated in, by far. So bad, it compelled me to make my first comment. Really upsetting.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

The purpose of setting problems is to torture the contestants.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +20 Проголосовать: не нравится

Unpopular opinion but ppl complaining about debugging, corner-cases and hard implementation should probably work on those things rather than blaming the author

»
4 месяца назад, скрыть # |
Rev. 2  
Проголосовать: нравится +9 Проголосовать: не нравится

Cornercaseforces

»
4 месяца назад, скрыть # |
Rev. 2  
Проголосовать: нравится +15 Проголосовать: не нравится

Positive thinking, C1 and C2 are good practice for debugging. Test cases are easy to generate and naive solution is quite straight forward to implement.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

long queue,corner case,the cn round is too bad,I only solve 1 problem,it makes my rating -150

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +20 Проголосовать: не нравится

Two question.

Why C appears in Codeforces?

And why n in D approach $$$2 \times 10^6$$$?

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

why C>>D

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Holy Reference

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +16 Проголосовать: не нравится

insane amount of cheaters in the top 100s

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Please don't worry about the positive comments.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится -12 Проголосовать: не нравится

A bad round!!!!!!!!!

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

Time limit exceeded on pretest 19 and Wrong answer on pretest 2-forces

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

why C>>>>>>>D :(

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can anyone spot the bug in this code(or any counter-example)?

Code

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can someone help me out i am stuck in problem C1.

My code in C++

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

cnm

»
4 месяца назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Proud to be the first solver of problem A. Enjoyed the problemset, hope to see more from the WDOI team!

»
4 месяца назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

For the problem B the Pretest 2 test number 10 The test is

4 1 3 1 and the answer should be 2 and not 3 as we can't increase the distance if min_dist is equal to n/2. Please tell me if I am wrong

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

?!strongstrong?!

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

A,D 800,B 3500

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Asia round!!!

»
3 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Hello moderators, I would like to clarify regarding the plagiarism warning on my submission 374806988 for problem 2228E1.

I did not intentionally copy code from any participant during the contest. I solved the problem on my own and submitted my own implementation. If there are similarities with other submissions, they were unintentional and possibly due to common logic or implementation patterns for the problem.

I respect the contest rules and understand the seriousness of plagiarism concerns. I will also make sure to write more personalized implementations in future contests to avoid such situations. Thank you.

»
3 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Subject: False Plagiarism Appeal — Round 1098 (Div. 2) — Handle: sudeepreddy7893

Dear Contest Coordinator,

My handle is sudeepreddy7893. My submissions for Codeforces Round 1098 (Div. 2) were skipped due to a plagiarism flag on problem 2228E1, matching with user MBBN. I would like to request a manual review of my case because I submitted my solution significantly earlier than the other user, proving that I did not copy from them.

Submission Details & Timestamps: My Submission ID: 374810486My Submission Time: 2026-05-16 18:41:31

MBBN's Submission ID: 374843969MBBN's Submission Time: 2026-05-16 19:30:02

As shown by the system records, my solution was written and officially submitted 48 minutes and 31 seconds before user MBBN made their submission. I did not collaborate with this user, nor did I share my code. Any structural similarity is either a consequence of the standard mathematical approach to this problem or a result of my code being accessed after my submission without my knowledge.

Explanation of my logic:To solve the queries efficiently, I first isolated the fixed sum and counted the number of open slots (free) containing -1. I used the standard stars-and-bars combinatorial formula C(R + free — 1, free — 1) to find the total valid configurations for the remaining sum R.

For the contribution of the prefixes, I applied the linearity of expectation. Since each empty slot expects an equal share of the remaining sum (R / free), the expected sum of a prefix containing A empty slots is simply ex = A * R / free. To compute the expected squared sum, I expanded the algebraic identity (fixedPref + freePref_sum)^2 into fixedPref^2 + 2 * fixedPref * E[freePref_sum] + E[freePref_sum^2], which I calculated using the combinatorics coefficients accumulated in the ex2 variable.

Given that the timeline clearly shows my submission came first, I kindly request that you restore my rating for this round. Thank you for your time and for maintaining the integrity of the platform.Best regards,sudeepreddy7893

»
3 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

As a Chinese, I will give this an upvote

»
3 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

(Sorry to my poor English and my beginner code at first) Subject:​ Potential error in Editorial for Problem 2228B The 2228B's answer have some problem.When the distance of x1 and x2 == n / 2,the x2 should choose stay in place,and the x1 should stay too until the finally second,the k seconds x1 can choose move to make the distance -=1.Such as the test of n = 4,x1 = 1,x2 = 3,k = 2,if x2 move,the distance become smaller,it's wrong,so x2 should stay in place,and x1 didn't move in 1th second.But in 2th second,x2 also stay,x1 should move to 2 or 4,so the answer should be k — 1 + distance at first that is 2.But in the editorial,the answer is 3. I put my code here,it maybe have some wrongs: ~~~~~

include

include

include

using namespace std;

int dis(int n,int x,int y){ int dis = min(abs(x — y),abs(x + n — y)); dis = min(dis,abs(x — n — y)); return dis; }

signed main(void){ int LOOP; cin >> LOOP; while(LOOP --){ int n,x,y,k; cin >> n >> x >> y >> k; if(n <= 3){ cout << '1' << '\n'; continue; } if((dis(n,x,y) == n / 2) && k > 0){ k -= 1; } cout << k + dis(n,x,y) << '\n'; } return 0; } ~~~~~ Thanks!