Help Guidelines


Please ask for help in the DMOJ Discord #help channel and not in the comments since the latter is basically spam.

There are typically two reasons people ask for help on problems: one is asking for hints on how to get started with a problem, and another is asking for help debugging one's incorrect submission on a problem. There are commonalities on how to best ask for help in both situations.

General Principles

  • Try to use #help only to get unstuck after you've put in some effort yourself to fix your problems.
  • Make it as easy as possible for someone else to help you.
  • Communicate what you've done or what you think so that other people don't have to speculate.
  • Be specific with your help request.

Asking for Hints

We'll cover some examples of how to and how not to ask for help.

Bad Request 1: How do you solve this problem?

Why it's bad: Asking for the solution to a problem outright will not result in someone telling you how to solve the problem.

Bad Request 2: Can I get a hint to this problem?

Why it's bad: This request doesn't give any context regarding how much you've thought about the problem. Someone may give you a hint that is a good starting point, but if you've already made a couple of observations on the problem, you may find the hint useless and then you need to explain what you've already figured out. Another problem may be that someone gives you a hint that is too big and spoils the problem for you.

Okay Request: This problem seems like a dynamic programming problem. Am I on the right track?

Why it's good: The request is asking a yes/no question, so it's easy for someone offering help to answer since they can usually say yes or no.
Why it could be better: The request lacks a lot of details - for example, dynamic programming might be a correct approach, but there may also be a much simpler approach.

Good Request: I think this problem is a dynamic programming problem, but the idea I have needs \mathcal O(NK) memory, which does not fit within the memory limit. The idea I have is a two-dimensional DP. Is this along the right track, or should I try something completely different?

Why it's good: The question describes a specific idea that the person asking for help has thought of and also identifies an issue with the approach. A person asking for help can give a specific response - whether the stated approach is likely to work with some adjustments or a different approach is needed altogether.

Asking for Debugging Help

Bad Request 1: Can someone debug my code for me? <pastes code in Discord>

Why it's bad: Pasting code in Discord pollutes the channel and makes it difficult to read through the history. Instead of pasting code in Discord, one should post a link to the submission that is incorrect, along with the problem link. This makes it possible for people who have solved the problem to look at your code without spoiling it for anyone who hasn't solved the problem yet. To post a link to your submission, go to the page that lists the verdicts for your submission and copy the URL. It should look something like https://dmoj.ca/submission/1029, except the number at the end will be different.

Bad Request 2: Can someone debug my code for me? <pastes submission link in Discord>

Why it's bad: People who haven't solved the problem will click the link and see nothing because they haven't solved the problem, which makes it unpleasant for people who want to help but can't. This is why it's important to also paste a link to the problem that you're stuck on, so people can see what problem it is and waste less time on help requests they can't answer. Please paste the URL to the problem and not just the title or short code for the problem so that people can go directly to the problem with a single click.

Bad Request 3: Can someone debug my code for me? <pastes submission link and problem link in Discord>

Why it's bad: Even if someone feels qualified to help with the problem, they now need to spend time reading your code and trying to understand what you've done. If it's hard to follow your code, or you've taken an unconventional approach, you may not get timely responses because people need to put in more time to help than they would otherwise.

Okay Request: Can someone help see what's wrong with my code? <pastes submission link and problem link in Discord>. My approach is to use Dijkstra's, but it's getting TLE.

Why it's good: Without needing to read the code itself, by giving a little context on your high-level approach, you've made it possible for people helping you to understand how you've decided to approach the problem. If they've made similar mistakes, they can anticipate what you've done, and if they've predicted correctly, they can help you quickly.
Why it could be better: One thing lacking in this question is understanding what might be causing the TLE. Is it an implementation bug or a missing optimization you must do? The request is still relatively vague and could be more focused.

Good Request: Can someone help me see what's wrong with my code? <pastes submission link and problem link in Discord>. My approach is to use Dijkstra's, but it's getting TLE. I'm concerned that the graph having one million vertices and edges means that Dijkstra will be too slow, but I haven't been able to construct a big test case where my code gets TLE.

Why it's good: The request shows the effort the person asking for help has put in - they've tried to diagnose the reason for the TLE but have not succeeded in doing so. The mere act of typing out this thought process is akin to rubber duck debugging, which can help someone resolve their own issues. Rubber duck debugging is an underappreciated way of debugging code, as seen in the following example.

Good Request 2 (which never gets posted to Discord): Can someone help me debug my code? <pastes submission link and problem link into Discord>. I'm approaching this problem as a dynamic programming problem, where I'm trying to maximize the value of my knapsack. The state I'm storing uses the number of items seen so far and the current capacity of the knapsack which I have filled… (the person asking for help realizes they have an issue, which they debug and then solve the problem).

Why it's good: A frequent source of issues for people is between the thought process for approaching the problem and the actual code used to solve the problem. Typing out an explanation for the code forces the person writing the code to understand what they've written so they can describe it to someone else. In trying to come up with this explanation, they find an issue in their understanding of the problem or the code and, therefore, fix their code without ever explicitly submitting a help request to Discord.