### alexwice's blog

By alexwice, history, 5 months ago,

In recent contests, it seems like we are having readforces, many prompts are many paragraphs long. I think it's okay to have an analogy in the problem statement when it motivates the problem or is useful in explanation. But most problem prompts feel like some 8th grader is just making random references to things they like. A lot of times the analogy is extremely contrived anyways so as to not really be that useful. It makes the problems confusing and harder to understand.

Here are examples from CF885 but this problem happens a lot recently imo.

• Problem A, why are we running from friends? We should run from enemies. The problem statement isn't even pedagogical.

In an $R$ by $C$ grid, you stand at $(r_0, c_0)$, and $K$ friends stand at cell $(r_i, c_i)$ ($1 \leq i \leq K$). ($(r, c)$ corresponds to the cell in the $r$-th row and $c$-th column.)

Every minute, you must move to a adjacent cell, and then each of your enemies (seeing your choice) must move to an adjacent cell. (Cells are adjacent if they share an edge.)

Can you move in a way to guarantee you never visit any of your enemies forever?

• Problem D, statement is 5x longer than needs to be:

"You start with a number $X$ and will perform $K$ operations. Initially your $\text{score}$ is $0$. In one operation you can either add the last digit of $X$ to $X$, or add $X$ to $\text{score}$. What is the highest score you can achieve?"

Anyways regardless if you agree or disagree (I imagine some will disagree) please leave a comment, I just wanted to start a discussion about this practice. Thanks.

• +389

 » 5 months ago, # |   +62 Strongly agree with this. English isn't my first language, and although I can read/write/speak English pretty well, it's confusing to read a whole story and try to make sense of it and order things in my mind when they could've just asked the problem straight.
•  » » 5 months ago, # ^ |   +23 Look at this problem. All you need here is print(input()) xD
 » 5 months ago, # |   +48 I dont like story mode problems too. That is why I like Project Euler so much....it is straight upto the point
 » 5 months ago, # | ← Rev. 2 →   +126 The reason why statement was longerThis round is dedicated to an amazingly beautiful girl Vika that I love very much. Every problem will be about her and related to her life.
 » 5 months ago, # | ← Rev. 5 →   +150 I do not like problems with no story. It makes them much harder to remember if I want to recall them in future. Also, stories are fun!Furthermore, problems that don't fit very well with any story are much more likely to be boring problems imo. I don't like problems with very contrived abstract nonsense ideas to fit some math fact (*cough* atcoder). I prefer problems to be something natural I imagine I would ask myself if I thought about similar general topics long enough relating vaguely to the real world.However, the story should not make the problem statement much longer and in good problems should help with understanding. If authors want extra background for fun, it should be in separate paragraph clearly distinguishable from rest of statement.
•  » » 5 months ago, # ^ |   +8 Agreed, on both points!
•  » » » 5 months ago, # ^ |   0 bro is in the allen drip
•  » » » » 5 months ago, # ^ |   0 Yes Sir!
•  » » 5 months ago, # ^ |   +11 No your opinion is irrelevant and i will never watch your anime :(
•  » » 5 months ago, # ^ |   +40 How to raise a boring statement
•  » » » 5 months ago, # ^ |   -13
•  » » 5 months ago, # ^ |   +26 Idk about anyone else but I don't remember almost any of statements from codeforces nor atcoder. Only remember OI problems' statements ._.
 » 5 months ago, # |   +4 Thanks for clarifying problem D, I read it so many times but couldn't understand at all what it was about.
 » 5 months ago, # |   0 Idk man, the thing for me which separates codeforces and other platforms is its question framing. But I agree with your reasoning, I too sometimes misunderstand the question quite a few times
 » 5 months ago, # |   +25 Someone needs to make an extension called "Atcoderized Codeforces" or something like that and when you click on it, it simplifies the problem statement using an AI or something like thatI guess it would have to be sophisticated to understand problemsetter language =)
•  » » 5 months ago, # ^ | ← Rev. 3 →   0 I've just done this with 1848A - Vika and Her Friends and it does cover the entire problem, but misses out on the more finer details (like the fact that it is at the end of a minute).ChatGPT can do this, but it takes a few tries, and you might want to reread the statement to see if there is anything missing
 » 5 months ago, # | ← Rev. 2 →   +231 If problems have convoluted and confusing stories, the goal should be that problems should not have convoluted and confusing stories, not that problems shouldn't have stories.This aside, I think being able to formalize a real-life scenario into mathematical terms is a skill worth learning for programmers, and it's ironically one of the few actual skills that competitive programming might teach career-wise. The problem here is, of course, that many real-life scenarios are either not interesting enough from a CP perspective, not original, or both. And it's much easier from a problem setter perspective to think about obscure mathematical processes or adapt some hard mathematical problem from old books that no CP-ers will ever read than to create a problem starting from a real-life scenario which might be one of: very constrained; boring; either too simple or too complex for CP. This unfortunately results in problems that have a very unrealistic setup, however are coupled with an often absurd story. To me, I'll always be in favor of problems having stories (any by story I mean an actual scenario that makes sense to the task at hand) to problems having statements composed mainly of $\LaTeX$ formulas. However, to all problem setters, please don't do the worst of both.
•  » » 5 months ago, # ^ |   +52 it's ironically one of the few actual skills that competitive programming might teach career-wise Could we please stop thinking about CP as some kind of a "way to enter software engineering"?
•  » » » 5 months ago, # ^ | ← Rev. 3 →   +56 But being able to translate a real life scenario into a formal setting is not something (only) related to software engineering, it’s an (imo) essential skill related to problem solving in general (at least the industry definition of it). And problem solving is a nice skill to have, it makes you think more clearly, conceptualize, and finally solve complex problems. It also compliments nicely other skills like pattern matching, intuition, reasoning, etc. Not to mention some people (myself included) get much more excitement from solving some problem that sounds like a practical issue than computing some sum. So I think there’s enough benefit to keep it around and continue striving for coming up with both interesting and natural problem setups.
•  » » » » 5 months ago, # ^ | ← Rev. 2 →   +11 yes. I agree.
 » 5 months ago, # |   +75 Problems without stories are the best. Change my mind.
•  » » 5 months ago, # ^ |   0 I will not, in fact, I agree
•  » » 5 months ago, # ^ |   -24 When you remember general idea of a cool problem but not specific details nor the contest it was held, yet you have 1000s of other submissions, good luck trying to find it from only some math formulas on google search...
•  » » » 5 months ago, # ^ |   +22 How would remembering the story of the problem help find it?
•  » » » » 5 months ago, # ^ | ← Rev. 2 →   0 As long as story is somewhat unique, if I remember one keyword about story and add to google search it usually comes up as first few results (as opposed to just remembering it is something about shortest paths with special condition which doesn't narrow down at all). Similarly, if I look for title related to story in problemset tab that usually makes it easier to spot.I also think story just makes problem more memorable anyway.
•  » » » » » 5 months ago, # ^ |   +29 I usually remember the overall idea of a problem, some key parts of its solution.
 » 5 months ago, # |   +4 I believe that problems with statements help to make the problems less boring and more entertaining. It is hard to focus for multiple hours studying boring problems.Maybe there should be toggle, or just have no story during contests, but having story during practice makes it less tedious and boring.
•  » » 5 months ago, # ^ | ← Rev. 2 →   -30 I don't agree.Playing cards is entertainment.Playing cards in a casino where you might lose lots of money is not entertainment at all. You have to be serious.Codeforces is such a casino. Nobody loves these idiot stories in tense contests.
•  » » » 5 months ago, # ^ |   +36 Nothing that is absolutely voluntary should be a pain to do. If the only thing remarkable in a casino is that "you may lose money", maybe you shouldn't play at all. Same should go for codeforces rating. You should enjoy contests regardless. What should be achieved instead is clear statements. In statements "with stories", this often doesn't happen is that there are multiple phrases only to state a single a single condition/operation. This problem can be resolved, but not at the expense of "stories". Only authors should be more mindful and responsible when doing such statements, but not kill them altoghether.
•  » » » » 5 months ago, # ^ |   -15 But you may also earn a lot of ratings from CF :)
 » 5 months ago, # |   -23 To diskoteka: Girls never love verbose boys!
•  » » 5 months ago, # ^ |   +31 How can I delete this comment? It is not very proper.
 » 5 months ago, # |   +4 I agree that problem A of this round had a needlessly long story, however, other problems seemed fine to me. If clarity is an issue we should focus on problems having clear statements rather than no stories. I mean a chuckle here and there hurts nobody but if you write nonsense for 3 paragraphs, it becomes unbearable.
 » 5 months ago, # | ← Rev. 3 →   +16 Good stories wherever possible. If not possible, don't force it. Math and abstraction has its value just as much as relatability. What doesn't have any value is obscurity. Maybe a word limit on problem statements can help keep the balance.
 » 5 months ago, # |   0 there are some advantages and disadvantages of having long background stories: One advantage-> it will not be boring One disadvantage -> it can be annoying sometimesSuggestion: extra background should be in extra paragraph which easy to differ from the main statementIn conclusion, having different types of problems will help you improve better both your thinking and coding skills :)
 » 5 months ago, # |   +10 I like stories in problems statements in codeforces because it brings character to a problem and makes the round more memorable. This is why I like themed rounds in particular.
 » 5 months ago, # |   +73 I wanted to write such a blog post for a long time. Yes!If you write a problem description and then add a story at the beginning, don't.If you came up with a problem and then tried to add a story to it, don't.If you came up with a problem through a story, keep it (but it's probably not a story, just a real-life context of a problem).If you came up with a problem, then came up with a story, and you feel like this story helps understand the problem better than the mathematical formulation, keep it.
 » 5 months ago, # | ← Rev. 3 →   +35 Lol... I've just read the problem statements. I didn't feel like these problem stories specifically are useless. No, it's actually pretty ok. In my previous comment I was more talking about problems that have something like "X and Y are friends, blablabla, X has a birthday, Y gave him an array as a gift", and then there is just a problem about an array.However, the problem statements you provided are actually pretty sexist. That was weird to read. I don't think it's ok to have this kind of stuff on Codeforces.
•  » » 5 months ago, # ^ |   +17 Well, Vika is problemsetter's love interest. If the statements are indeed about her life, can you really call them sexist?Although, I got weirded out when I was reading them in contest, my man did Vika a bit dirty
 » 5 months ago, # |   +9 The problem statements are unnecessarily long & the English translation of the statements and the explanation of the test cases are sometime horrible, complex & confusing. Analogy ,stories are fine , as long as the questions are clearly stated. Sometimes understanding the questions properly feels harder than solving it. Rather than spending time on writing fancy stories for questions, Respected authors should spend time in translating the questions properly. It's completely my point of view. I can bet some people would downvote me based on my rating & simply gonna ignore the query. Such a nice community !
 » 5 months ago, # |   -11 everything is fine there's no problem with stories but when the problem statement is very big give it's translation in hindi. requesting MikeMirzayanov
 » 5 months ago, # |   +3 Strongly agree.
 » 5 months ago, # | ← Rev. 2 →   0 I agree. I think people should have the ability to upvote/downvote problems, so that we can filter out good problems. Similarly, before contest's release, a large enough amount of testers should upvote/downvote problems and data should be released to community. This will help boost the quality of the problems here.
 » 5 months ago, # |   0 I think stories should be short and useless details must only be in the first paragraph of the problem. this helps you know that this part is unnecessary to read, and keeps the story for those who can understand the problem with it
 » 5 months ago, # |   +74 A very nice solution was adopted in Codeforces Round #746. Citing the announcement :The statements are short and we have tried to make the pretests strong. I encourage you to read all the problems.For people who don't like stories, you will find all the stories written in italic you can skip them safely.
•  » » 5 months ago, # ^ |   +13 Thank you for mentioning this, I was just looking for that contest. It seems to be the best of both worlds, and I'm somewhat surprised this way of writing problem stories didn't become the norm.
•  » » 5 months ago, # ^ | ← Rev. 2 →   +45 +1. I'm largely sympathetic to the concerns of both the author and SuperJ6, and this seems like the easiest way to satisfy everyone.One other thought: even if authors choose to omit stories for problems, please use unique problem names! I rarely remember problem stories unless they're especially amusing, but I frequently remember problems by their names (e.g. I will always think of the $O(n^2)$ tree DP complexity bound as the trick from Miss Punyverse). This would be substantially more difficult with less memorable problem titles, so please don't name every problem "Array and Operations".
 » 5 months ago, # |   +13 Very unpopular opinion: problem legends are not for participants, they are for authors. But at least I agree that they should not be long and hard to read.
 » 5 months ago, # | ← Rev. 2 →   0 This also might be a right place to share the best problem stories, for me it's 1407E - Егор в республике Дагестан for sure :D
 » 5 months ago, # |   0 ya