Asia-Pacific Informatics Olympiad 2017

These Competition Rules cover Problems, Competition Procedures and Grading Procedures in APIO 2017. Delegation Leaders have the responsibility of ensuring that all members of their delegation fully understand these rules and abide by them.


All problems in APIO 2017 are designed to be algorithmic in nature, and they are all of the traditional programming type.

  • In APIO 2017 competition, there are 3 problems to solve.
  • Solution comprises a single source file of a computer program which either reads data from the standard input (stdin) and writes its answer to the standard output (stdout) or implement functions.
  • The problem statement will define:
    • The problem description
    • Input and output data formats
    • The input value ranges / constraints
    • The resource limitations for the computations (e.g. CPU time, memory limitations)
    • Subtasks description:
      • Point for completion of this subtask
      • The input value ranges / constraints for this subtask
    • Any other constraints on the problem

Input and Output Data

  • In all problems, input and output data consist of one or more lines.
  • Each line ends with an end-of-line character, including the last line.
  • The end-of-line character in Linux is represented by the single character '\n' (ASCII code 10).
  • Each line contains one or more space-separated items.
    • An item is a string of printable non-white-space characters (ASCII code from 33 through 126, inclusive).
    • An item may represent an integer or a general string; the meaning of each item will be given in the problem description.
  • The format and limits for input and output data will be specified in the problem description. The output data should be formatted strictly according to the problem-specific instructions.

Stack Limitations

Whenever any submitted program is executed through the contest system, the stack size will only be limited by the memory limit for the corresponding problem.

Competition Procedures

  • Contest runs for 5 hours.
  • You can submit clarification requests in the first 2 hours.
    • You can submit it in English or your native language.
    • If you submit in native language, your leader needs to translate it to English, then we can answer it only in English.
  • If there need to be announcements, the announcement will be sent to the leaders. The leader of each country is responsible for making sure that the contestants are informed of the announcements, translated into local language if necessary.
  • Do not attempt to break or hack the system. We track every activity in the system. Any deliberate attempt will be considered as cheating.
  • Please do not share the problems after the contest within 2 days, because competition is not held within a same time range.


  • You can only submit at most 30 submissions for a problem, unless otherwise stated.
  • You will have to wait two minutes between submissions to the same problem.
  • For each problem, there are several subtasks:
    • For each subtask, there are points assigned to it.
    • Each subtask contains several test cases.
    • Every testcase will be judged and receive a score.
    • Your score for each subtask will be the minimum score it receives on any testcase in that subtask.
  • The score of a submission is the sum of all the points that you get from completing subtasks.
  • The final score for a problem is the maximum of all the submission scores for that problem.
  • You will get full feedback on your score for each submission.
    • The score for each subtask will be given.
    • Only one test case's information will be listed in each subtask. This will be for the lowest scoring test case in the subtask, if there are multiple lowest scoring cases, only the first will be listed.