An Animal Contest 5

Welcome to An Animal Contest 5! This contest will be themed around pandas!

The problem setters are dxke02, andrewtam, ThingExplainer, julian33, and rickyqin005.

The contest organizers are Riolku, hewmatt10, danielz1000, WilliamWu277, sjay05, and Nils_Emmenegger.

Special thanks to Dan13llljws, wleung_bvg, Averesoft, Josh, RandomLB, and TechnobladeNeverDies for testing and feedback on problems!

The contest will be rated for all participants with a rating under 2400.

Before the contest date, you may wish to check out the tips and help pages.

You will have 3 hours to complete the contest. After the contest window begins, you may begin at any time. Once you enter the contest, your personal timer will start counting down and you will be able to submit until 3 hours from when you started, or until the hard deadline (00:00:00 EST of January 25th), whichever comes first.

After joining the contest, you proceed to the Problems tab to begin.

Here are the parameters of the contest:

  • Some problems offer partial marks in the form of subtasks.
  • Number of problems: 6, full feedback (you will see the results of your submissions instantly).
  • Scoreboard will be hidden, until your window is over. Divulging the contents of the scoreboard to participants who have not finished their window is an offense, the punishments of which are listed below.
  • Number of submissions allowed per problem: 50.
  • Ties will be broken by the maximum submission time that increased score with no penalties.
  • Problems will be approximately increasing in difficulty. Reading all of the statements is recommended.
  • Rated for opening the contest. Being able to read the problems will cause the contest to be rated.
  • Checkers: unless otherwise specified, identical. The contest will follow the standard convention of having all lines terminate in a \n character, with no trailing whitespace.
  • It is guaranteed that all problems will be solvable with C++.

We have listed below some advice as well as contest strategies:

  • Remove all extra debugging code and/or input prompts from your code before submitting. The judge is very strict — most of the time, it requires your output to match exactly.
  • Do not pause program execution at the end. The judging process is automated. You should use stdin / stdout to perform input / output, respectively.
  • Python users are recommended to use PyPy 2/3 over Python 2/3 when submitting.

Clarification requests for the contest must be routed through the clarification system provided on DMOJ, and not through other channels including but not limited to Discord and Slack. Furthermore, all clarification requests will be handled the way they normally are in IOI. Note that, in particular, clarification requests must come in the form of yes/no questions.

Due to rampant issues with cheating on contests that has happened recently, any suspicious behavior during the contest window may result in your rating being impacted negatively. Such behavior includes, but is not limited to:

  • Divulging the contents of the scoreboard to participants who have not finished their window.
  • Registering for the contest with at least two accounts.
  • Participating in the contest with an account that is not your primary account.
  • During the contest window, talking about the contest in more detail than answering a yes/no question about whether one participated in the contest. This includes, but is not limited to, posting spoilers about the contest and public speculation of the contest.
  • Attempting to exploit bugs in the platform to subvert the constraints of the contest.
  • Attacking the judge infrastructure, other contestants, or contest personnel within or after your window.

Punishments may include performance being unrated or, for more serious infractions, being forcibly ranked at the bottom of the scoreboard.

At the end of the contest, you may comment below to appeal a judging verdict. In the case of appeals, the decision(s) of DMOJ staff is final.


  • 4
    Badmode  commented on Jan. 22, 2022, 6:34 p.m.

    The contest page says no submission limit, but there is a 50 submission limit

    • 1
      maxcruickshanks  commented on Jan. 22, 2022, 6:55 p.m.

      The submission limit has been updated on the contest page. We apologize for any inconvenience this caused.

  • 4
    ayay9  commented on Jan. 21, 2022, 9:37 p.m.


  • 28
    andrewtam  commented on Jan. 21, 2022, 8:14 p.m. edit 5

    larry the panda!!!

    • 13
      Victor_Chan  commented on Jan. 22, 2022, 10:32 p.m.

      The average DMOJ user ^

  • 9
    Spitfire720  commented on Jan. 21, 2022, 6:58 p.m.

    DMOPC: I sleep(it's expected)

    Any other contest: AYO FR

  • 8
    vishnus  commented on Jan. 21, 2022, 6:51 p.m.

    AAC again! :blobaww:

    • 4
      andy_zhu23  commented on Jan. 22, 2022, 3:26 a.m. edited

      yeah AAC! Highlight of the week!

    • 6
      dawangk  commented on Jan. 21, 2022, 10:41 p.m.

      Another Animal Contest!