Блог пользователя variety-jones

Автор variety-jones, 3 года назад, По-английски

TL;DR: I've created a tool using which you can get additional sample input/output (for recent problems), which you can then analyze on paper to help you get closer to the solution. Check it out at cfstress.com

  1. You come up with an approach, and since you are too impatient, start implementing it. Your code passes the sample testcase, but it gets WA on Pretest 2. However, if you'd have 2 or 3 more sample test cases, you would've either abandoned the implementation after spotting the flaw, or you would've been more careful while coding, keeping those extra samples in mind.
  2. You are at a loss of idea, and you turn to the editorial for hints. But not all editorials have hints, and the comment section has spoilers. If you work out more sample testcases on paper, it'd get you a bit closer to the solution idea. (Not true for all problems, but it's a good strategy in general). You just need to have patience.
  3. You read an editorial and instantly comment

    I could not get the editorial of X, can someone explain?

    What helps in this situation, I believe, is to pick up a small testcase, and on paper, go through each step of the editorial. (If it has linked code, dry run that code on the input). Repeat this 3 to 4 times, and you might have a better understanding of the editorial.

To help with the above, I've created a tool which can give you small testcases to work with. It's highly customizable, i.e, you can ask for as specific test case as you want. For example,

Give me a sample where the number of testcases is 3, the array size should be 7, the array elements should be between 3 to 9 and so on...

You can check it out at cfstress.com. Oh, and did I tell you? It can also give you a small failing test case for your WA solution.

Note: It only works for contests that were conducted on or after 22nd January, 2022.

Contribution: I'm planning to make the generator repo for this project open-sourced in a couple of days. If you ever use this tool, and it proves to be helpful, do contribute to the project by adding generators for at least one problem. It'd hardly take you 5 to 10 minutes if you've solved/upsolved the problem.

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

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

Can you add Problem 154B?