Get Time
Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings
View: Flat (newest first)  | Threaded  | Tree
Previous Thread  |  Next Thread
3.1. Submitting Your Solution (MM) | Reply

Once you've figured out how you're going to solve the problem, you have to actually code it and submit the code. Same as SRMs, Marathons require a specific format of submitted code.


Same as in SRMs, you must submit implementation of one class. Definition part of problem statement contains its description - the name and the list of public methods the class must have. Unlike SRMs, the implementation might require multiple public methods to function properly. In this case, problem statement will specify the order in which they will be called. Your code can also contain any accessory classes, but all code must be submitted in a single file, so, for example, in Java they can not be declared as public. Your code can also contain any accessory data structures you need - either as global variables (if your language allows them) or as class variables. All method calls within one test case are done to one instance of your class, so you will be able to use variables for storing data between calls, but not between different tests.

Another difference from SRMs is that in some problems you have to use "libraries" provided by the problem environment - methods which give you extra information about the problem. Their signature is also given in problem statement, in section "Available libraries".

You can submit for a Marathon (as well as register for the match and check current standings) both on the web-site (Competitions -> Marathon Match -> Active Contests) and in Arena (Active Contests -> current match).

In Marathons, you can choose one of the 5 languages: C++, Java, C# and VB.NET, which are available in SRMs, are accompanied with Python. For some ideas on which language to choose, see sidebar "Choosing Right Programming Language". If you're using Arena, Definition and Available Libraries will change accordingly to your chosen language, so you will be able to see what data types to use and how the declare the required methods. On the site problem statement is always given in C++.


Here are skeleton submissions for problem CellularAutomaton in all available languages. The simplest solution is to return the original grid unaltered.

#include <string>
#include <vector>
using namespace std;
class CellularAutomaton {
    vector<string> configure(vector<string> grid, string rules, int N, int K) {
        return grid;

public class CellularAutomaton {
    public String[] configure(String[] grid, String rules, int N, int K) {
        return grid;

using System;
public class CellularAutomaton {
    public string[] configure(string[] grid, string rules, int N, int K) {
        return grid;

Public Class CellularAutomaton
    Public Function configure(ByVal grid As String(), ByVal rules As String, ByVal N As Integer, ByVal K As Integer) As String()
        Return grid
    End Function
End Class

class CellularAutomaton:
    def configure(self, grid, rules, N, K):
        return grid