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

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

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
  • Проголосовать: не нравится

»
17 месяцев назад, # |
  Проголосовать: нравится +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.

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

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

»
17 месяцев назад, # |
Rev. 2   Проголосовать: нравится +126 Проголосовать: не нравится
The reason why statement was longer
»
17 месяцев назад, # |
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.

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

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

»
17 месяцев назад, # |
  Проголосовать: нравится +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 that

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

  • »
    »
    17 месяцев назад, # ^ |
    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

»
17 месяцев назад, # |
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.

  • »
    »
    17 месяцев назад, # ^ |
      Проголосовать: нравится +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"?

    • »
      »
      »
      17 месяцев назад, # ^ |
      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.

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

Problems without stories are the best. Change my mind.

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

    I will not, in fact, I agree

  • »
    »
    17 месяцев назад, # ^ |
      Проголосовать: нравится -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...

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

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

      • »
        »
        »
        »
        17 месяцев назад, # ^ |
        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.

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

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

»
17 месяцев назад, # |
  Проголосовать: нравится +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.

  • »
    »
    17 месяцев назад, # ^ |
    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.

    • »
      »
      »
      17 месяцев назад, # ^ |
        Проголосовать: нравится +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.

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

To diskoteka: Girls never love verbose boys!

»
17 месяцев назад, # |
  Проголосовать: нравится +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.

»
17 месяцев назад, # |
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.

»
17 месяцев назад, # |
  Проголосовать: нравится +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.

»
17 месяцев назад, # |
  Проголосовать: нравится +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.

»
17 месяцев назад, # |
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.

  • »
    »
    17 месяцев назад, # ^ |
      Проголосовать: нравится +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

»
17 месяцев назад, # |
  Проголосовать: нравится +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 !

»
17 месяцев назад, # |
  Проголосовать: нравится -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

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

Strongly agree.

»
17 месяцев назад, # |
  Проголосовать: нравится 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

»
17 месяцев назад, # |
  Проголосовать: нравится +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.

  • »
    »
    17 месяцев назад, # ^ |
      Проголосовать: нравится +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.

  • »
    »
    17 месяцев назад, # ^ |
    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".

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

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

»
17 месяцев назад, # |
  Проголосовать: нравится +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.

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

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