Sort Me API
  • 👋Sort Me Documentation
  • API Methods
    • ⚰️Problems
    • 🚲Submissions
    • 🏆Contests
    • 📚Archives
    • ❤️Users
    • 🛰️Websocket
      • /listenSubmission
      • /contestEvents
    • 👾Miscellaneous
  • Tricky moments
    • 🛂Account limits
    • 🔑Authorization
    • 🗃️Pagination
    • 🈂️Localization
    • 🖼️Images
Powered by GitBook
On this page
  • Get contest by ID
  • Register to contest
  • Get available
  • Get history of contests participation
  • Get contests you are admin in
  1. API Methods

Contests

API Methods at /contests route

Last updated 1 year ago

Under construction.

Get contest by ID

GET https://api.sort-me.org/contests/getByID

.

Query Parameters

Name
Type
Description

id*

int

ID of the contest

code

string

Secret code to access contest. Required only for link-access contests, if you are not registered and not an admin

{
    "id": 54,
    "name": "Sort Me Round №8",
    "description": "What an interesting contest it will be, you can't imagine!",
    "organizer": "Sort Me Team",

    "timings": {
        "now": 1671382401,
        "start": 1673382400,
        "end": 1673384800,
        "registration_start": 1671380000,
        "registration_end": 1673382400
    },

    "features": {
        : false,
        : true,
        : false,
    },

    "rules": "icpc",

    "participants_count": 541,
    "task_count": 1,

    "registered": true,

    : [
        {
            "id": 1,
            "name": "A+B",
            "statement": {
                "legend": "Your mission is to add two integers $A$ and $B$.",
                "input": "The only line of input contains two space-separated integers. The values of the numbers do not exceed $$10^9$$.",
                "output": "Print a single integer - the sum of the numbers $$A$$ and $$B$$.",
                "scoring": "We will run your solution on two subtasks.\nIn the first subtask, you will only receive points for passing all tests.\nThe second subtask has 10 tests, for each of which your solution will receive 5 points.",
                "note": "Adding is not subtracting..."
            },
            "samples": [
                {"stdin": "2 3", "stdout": "5"},
                {"stdin": "8 1", "stdout": "9"}
            ],
            "subtasks": [
                {
                    "points": 50,
                    "depends": [],
                    "description": "$$A, B \\le 1000$$"
                },
                {
                    "points": 50,
                    "depends": [1],
                    "description": "$$A, B \\le 10^9$$"
                }
            ],
            "limits": {
                "time": 1000,
                "memory": 256
            },
            "can_edit": false
        }
    ]

    : [
        {
            "name": "Python 3.11",
            "highlight": "python",
            "api": "python",
            "ext": "py"
        },
        {
            "name": "PyPy 3.9",
            "highlight": "python",
            "api": "pypy",
            "ext": "py"
        },
        {
            "name": "GNU C++20",
            "highlight": "cpp",
            "api": "c++",
            "ext": "cpp:cc:C"
        }
    ]
}
{
    "id": 54,
    "name": "Sort Me Round №8",
    "description": "What an interesting contest it will be, you can't imagine!",
    "organizer": "Sort Me Team",

    "timings": {
        "now": 1671382335,
        "start": 1673382400,
        "end": 1673384800,
        "registration_start": 1671380000,
        "registration_end": 1673382400
    },

    "features": {
        "practice": false,
        "table_visible": true,
        "jury_chat": false
    },

    "rules": "icpc",

    "participants_count": 541,
    "task_count": 1,

    "registered": false,
}
{
    "id": 54,
    "name": "Sort Me Round №8",
    "description": "What an interesting contest it will be, you can't imagine!",
    "organizer": "Sort Me Team",

    "timings": {
        "now": 1671382355,
        "start": 1673382400,
        "end": 1673384800,
        "registration_start": 1671380000,
        "registration_end": 1673382400
    },

    "features": {
        "practice": false,
        "table_visible": true,
        "jury_chat": false
    },

    "rules": "icpc",

    "participants_count": 541,
    "task_count": 1,

    "registered": false,
    
    : [
        , 
        , 
        , 
        , 
        , 
        ,
        ,
        
    ],

    : [
        {
            "id": 1,
            "name": "A+B",
            "statement": {
                "legend": "Your mission is to add two integers $A$ and $B$.",
                "input": "The only line of input contains two space-separated integers. The values of the numbers do not exceed $$10^9$$.",
                "output": "Print a single integer - the sum of the numbers $$A$$ and $$B$$.",
                "scoring": "We will run your solution on two subtasks.\nIn the first subtask, you will only receive points for passing all tests.\nThe second subtask has 10 tests, for each of which your solution will receive 5 points.",
                "note": "Adding is not subtracting..."
            },
            "samples": [
                {"stdin": "2 3", "stdout": "5"},
                {"stdin": "8 1", "stdout": "9"}
            ],
            "subtasks": [
                {
                    "points": 50,
                    "depends": [],
                    "description": "$$A, B \\le 1000$$"
                },
                {
                    "points": 50,
                    "depends": [1],
                    "description": "$$A, B \\le 10^9$$"
                }
            ],
            "limits": {
                "time": 1000,
                "memory": 256
            },
            "category": 6,
            "difficulty": 2,
            "can_edit": false
        }
    ]

        
    "languages": [
        {
            "name": "Python 3.11",
            "highlight": "python",
            "api": "python",
            "ext": "py"
        },
        {
            "name": "PyPy 3.9",
            "highlight": "python",
            "api": "pypy",
            "ext": "py"
        },
        {
            "name": "GNU C++20",
            "highlight": "cpp",
            "api": "c++",
            "ext": "cpp:cc:C"
        }
    ]
}

Register to contest

POST https://api.sort-me.org/contests/register

Register to contest as participant.

This method is idempotent: if you are already registered, it will return status OK.

Query Parameters

Name
Type
Description

contest_id*

int

ID of the contest

code

string

Secret code to access contest. Required only for link-access contests

{
    "status": "ok"
}

Get available

GET https://api.sort-me.org/contests/getAvailable

Returns previews of contests, which is shown on top on "Contests" tab. These are contests to which you are registered and contests for which any Sort Me user can register.

[
    {
        "id": 54,
        "name": "Sort Me Round №8",
        "description": "What an interesting contest it will be, you can't imagine!",
        "organizer": "Sort Me Team",

        "timings": {
            "now": 1671382401,
            "start": 1673382400,
            "end": 1673384800,
            "registration_start": 1671380000,
            "registration_end": 1673382400
        },

        "rules": "icpc",

        "participants_count": 541,
        "task_count": 1,

        "registered": false,
    }
]

Get history of contests participation

GET https://api.sort-me.org/contests/getParticipated

Get contests in which you participated and which are already finished.

Query Parameters

Name
Type
Description

offset

int

Pagination parameter. Use id field.

{
    "count": 4
    "contests": [
        {
            "id": 54,
            "name": "Sort Me Round №8",
            "description": "What an interesting contest it will be, you can't imagine!",
            "organizer": "Sort Me Team",

            "timings": {
            "now": 1671382401,
            "start": 1673382400,
            "end": 1673384800,
            "registration_start": 1671380000,
            "registration_end": 1673382400
            },

            "rules": "acm",
    
            "participants_count": 541,
            "task_count": 1,

            "registered": false,
        }
    ]
}

Get contests you are admin in

GET https://api.sort-me.org/contests/getManaged

Query Parameters

Name
Type
Description

offset

int

Pagination parameter. Use id field.

{
    "remaining_quota": 10,
    
    "count": 4,
    "contests": [
        {
            "id": 54,
            "name": "Sort Me Round №8",
            "description": "What an interesting contest it will be, you can't imagine!",
            "organizer": "Sort Me Team",

            "timings": {
                "now": 1671382401,
                "start": 1673382400,
                "end": 1673384800,
                "registration_start": 1671380000,
                "registration_end": 1673382400
            },

            "rules": "acm",
    
            "participants_count": 541,
            "task_count": 1,

            "registered": false,
        }
    ]
}

.

.

.

with N = 24.

.

.

with N = 24.

🏆
🈂️
Localization applies
🈂️
Localization applies
🔑
Authorization required
🈂️
Localization applies
🗃️
Pagination applies
🔑
Authorization required
🈂️
Localization applies
🗃️
Pagination applies