DSL Strikes Back

As you may remember from the qualification round, Midnight Cloud Computing (MCC) manufactures the JB (Junction Board) chip. To program it, MCC designed a specific virtual machine.

You can download the implementation and the specification of the virtual machine here. Or you can download a compiled version (equivalent to custom runner from sources) here. You can run the compiled version by java -jar inet.jar <path-to-your-code> command.

To test the virtual machine, you need to solve four problems:

  1. Add two numbers;
  2. Add two long numbers;
  3. Sort an array;
  4. Multiply two permutations.

The provided implementation has test runners for each of the four problems. They contain a solution written in a regular programming language, which you can use as a reference for each problem.

In each test runner, there are two sets of tests. One is used for correctness testing, and the other is used for solution quality testing.

Also, there are three quality metrics described in the specification. Your goal is to write not only correct solutions but also try to minimize the metrics.

Output data

You should submit files 01.inet, 02.inet, 03.inet, 04.inet with solutions to the corresponding problems. Some of the files may be missing.

Scoring

For Problem 1, only correctness is tested. If your program is correct, you will receive score 300300.

For each of the other three problems, if your program is correct, you will receive score 350350. Also, if it is correct you will get score up to 250250 for each of the three metrics.

For each problem, the score for a metric will be proportional to the lowest value among all participants divided by your best achieved value: 250best_metricyour_metric250 \cdot \frac{\texttt{best\_metric}}{\texttt{your\_metric}}.

Note that the scoreboard will show your best score for each problem and each metric among all your submissions.

Problem by JetBrains