alexwice's blog

By alexwice, history, 10 months ago, In English

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.

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

»
10 months ago, # |
  Vote: I like it +62 Vote: I do not like it

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.

»
10 months ago, # |
  Vote: I like it +48 Vote: I do not like it

I dont like story mode problems too. That is why I like Project Euler so much....it is straight upto the point

»
10 months ago, # |
Rev. 2   Vote: I like it +126 Vote: I do not like it
The reason why statement was longer
»
10 months ago, # |
Rev. 5   Vote: I like it +150 Vote: I do not like it

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.

»
10 months ago, # |
  Vote: I like it +4 Vote: I do not like it

Thanks for clarifying problem D, I read it so many times but couldn't understand at all what it was about.

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
10 months ago, # |
  Vote: I like it +25 Vote: I do not like it

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 that

I guess it would have to be sophisticated to understand problemsetter language =)

  • »
    »
    10 months ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    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

»
10 months ago, # |
Rev. 2   Vote: I like it +231 Vote: I do not like it

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.

  • »
    »
    10 months ago, # ^ |
      Vote: I like it +52 Vote: I do not like it

    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"?

    • »
      »
      »
      10 months ago, # ^ |
      Rev. 3   Vote: I like it +56 Vote: I do not like it

      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.

»
10 months ago, # |
  Vote: I like it +75 Vote: I do not like it

Problems without stories are the best. Change my mind.

  • »
    »
    10 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I will not, in fact, I agree

  • »
    »
    10 months ago, # ^ |
      Vote: I like it -24 Vote: I do not like it

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

    • »
      »
      »
      10 months ago, # ^ |
        Vote: I like it +22 Vote: I do not like it

      How would remembering the story of the problem help find it?

      • »
        »
        »
        »
        10 months ago, # ^ |
        Rev. 2   Vote: I like it 0 Vote: I do not like it

        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.

        • »
          »
          »
          »
          »
          10 months ago, # ^ |
            Vote: I like it +29 Vote: I do not like it

          I usually remember the overall idea of a problem, some key parts of its solution.

»
10 months ago, # |
  Vote: I like it +4 Vote: I do not like it

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.

  • »
    »
    10 months ago, # ^ |
    Rev. 2   Vote: I like it -30 Vote: I do not like it

    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.

    • »
      »
      »
      10 months ago, # ^ |
        Vote: I like it +36 Vote: I do not like it

      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.

      • »
        »
        »
        »
        10 months ago, # ^ |
          Vote: I like it -15 Vote: I do not like it

        But you may also earn a lot of ratings from CF :)

»
10 months ago, # |
  Vote: I like it -23 Vote: I do not like it

To diskoteka: Girls never love verbose boys!

  • »
    »
    10 months ago, # ^ |
      Vote: I like it +31 Vote: I do not like it

    How can I delete this comment? It is not very proper.

»
10 months ago, # |
  Vote: I like it +4 Vote: I do not like it

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.

»
10 months ago, # |
Rev. 3   Vote: I like it +16 Vote: I do not like it

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.

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

there are some advantages and disadvantages of having long background stories: One advantage-> it will not be boring One disadvantage -> it can be annoying sometimes

Suggestion: extra background should be in extra paragraph which easy to differ from the main statement

In conclusion, having different types of problems will help you improve better both your thinking and coding skills :)

»
10 months ago, # |
  Vote: I like it +10 Vote: I do not like it

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.

»
10 months ago, # |
  Vote: I like it +73 Vote: I do not like it

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.

»
10 months ago, # |
Rev. 3   Vote: I like it +35 Vote: I do not like it

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.

  • »
    »
    10 months ago, # ^ |
      Vote: I like it +17 Vote: I do not like it

    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

»
10 months ago, # |
  Vote: I like it +9 Vote: I do not like it

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 !

»
10 months ago, # |
  Vote: I like it -11 Vote: I do not like it

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

»
10 months ago, # |
  Vote: I like it +3 Vote: I do not like it

Strongly agree.

»
10 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

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.

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
10 months ago, # |
  Vote: I like it +74 Vote: I do not like it

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.

  • »
    »
    10 months ago, # ^ |
      Vote: I like it +13 Vote: I do not like it

    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.

  • »
    »
    10 months ago, # ^ |
    Rev. 2   Vote: I like it +45 Vote: I do not like it

    +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, # ^ |
        Vote: I like it +8 Vote: I do not like it

      Today I found out that Codeforces guidelines say that the problem names should be related to the problem statement (e.g., you cannot name a problem Miss Punyverse if there is no Miss Punyverse in the statement).

»
10 months ago, # |
  Vote: I like it +13 Vote: I do not like it

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.

»
10 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

This also might be a right place to share the best problem stories, for me it's 1407E - Egor in the Republic of Dagestan for sure :D

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

ya