Standard Ranklist (srk)

website·Indexed 32 days ago

https://srk.algoux.org

A static data format designed to describe ICPC, OI, and other contest rankings in a unified way. The srk ecosystem includes a specification for ranklists, participants, and problems, as well as a toolchain featuring a CLI tool, a renderer component, a utils library, and format conversion tools.

Tokens
8.7K
Snippets
59
Records
79
Agent score
60%

What's inside Standard Ranklist

  1. Overview of Standard Ranklist Renderer Component

    The Standard Ranklist Renderer Component is a set of web rendering components designed to transform SRK data into interactive ranking tables. It provides framework-specific implementations for React, Vue, Angular, Solid, and Svelte, supported by shared core logic and styles.
  2. Overview of Standard Ranklist (srk) data format

    Standard Ranklist (srk) is a static, extensible data format used to standardize the description of competitive programming ranklist data. It is designed to act as a universal interchange standard, allowing developers to mirror contest ranklists, migrate data between systems (e.g., DOMjudge, Codeforces), perform unified analysis, and archive contest results without writing custom scrapers for every platform. It is compatible with ICPC, OI, and extended contest formats.
  3. Overview of the srk ecosystem toolchain

    The srk ecosystem provides a suite of tools for managing the data format specification, covering the entire workflow from data production to display and distribution. The core projects include:

    • Standard Ranklist: Spec definition, types, and Schema (@algoux/standard-ranklist).
    • Renderer Component: Web rendering components for displaying ranklists.
    • CLI: Command-line tools for operating on srk files (@algoux/standard-ranklist-cli).
    • Utils: Utility libraries for JavaScript/TypeScript, Python, and Go.
    • Convert-to: A tool for converting srk data into other formats (@algoux/standard-ranklist-convert-to).
  4. Render srk ranklists using the Renderer Component

    The standard-ranklist-renderer-component provides web rendering components for displaying srk ranklists. It supports multiple frontend frameworks: React, Vue, Angular, Solid, and Svelte.
  5. Understand the srk static ranklist data format

    srk is a static ranklist data format designed to describe a ranklist snapshot at a specific point in time. Unlike traditional systems that store individual submissions and compute rankings dynamically, srk stores the final state. This makes it highly compatible with data converted from HTML archives, PDFs, or screenshots, and allows it to handle incomplete data (e.g., scores without detailed submission records).
  6. Define independent ranking dimensions with RankSeries

    RankSeries allows a ranklist to have multiple independent ranking dimensions. Each series computes rankings separately and can have its own title, segment definitions, and computation rules. Common examples include an 'Official Rank' with medal segments, an 'Overall Rank' for all participants, and a 'School Rank' that deduplicates by organization.
    {
      "series": [
        {
          "title": "Official Rank",
          "segments": [],
          "rule": { "preset": "ICPC" }
        },
        {
          "title": "Overall Rank",
          "rule": { "preset": "Normal" }
        },
        {
          "title": "School Rank",
          "rule": { "preset": "UniqByUserField" }
        }
      ]
    }
  7. Process ranklist data with the Utils library

    The standard-ranklist-utils library provides data processing functions for JavaScript/TypeScript, Python, and Go. It supports data validation, sorting, computation, and bidirectional conversion between static ranklists and submission record lists.
  8. Distribute and debug ranklists via RankLand

    RankLand (https://rl.algoux.cn/) is a data distribution platform built on srk. It allows users to:

    • Browse community and official contest ranklist data.
    • Debug srk data online using the Playground.
    • Connect managed contests for live external ranklist distribution and archiving.
    • Use the Kessoku Series suite for live broadcast directing.
  9. Use cases for Standard Ranklist Utils

    Standard Ranklist Utils is designed for the following developer tasks:

    • Converting raw submission data into srk format for ecosystem integration.
    • Batch processing and analyzing srk data.
    • Bidirectionally converting between srk and time-series submission records to build high-performance, incrementally-updated ranklist models.
  10. Configure participant data and ranking in srk

    To add ranking data, populate the rows array with participant details and the series array with ranking rules.

    Critical Constraint: Each row's statuses array must have the exact same length as the problems array, as they correspond by index. Unsubmitted problems should be represented as null in the statuses array.

    {
      "type": "general",
      "version": "0.3.13",
      "contest": {
        "title": "My First Contest",
        "startAt": "2019-01-01T09:00:00+08:00",
        "duration": [5, "h"]
      },
      "problems": [
        { "alias": "A", "title": "Easy Problem" },
        { "alias": "B", "title": "Hard Problem" },
        { "alias": "C", "title": "Preventing AK Problem" }
      ],
      "series": [
        {
          "title": "Rank",
          "segments": [
            { "title": "Gold", "style": "gold" },
            { "title": "Silver", "style": "silver" },
            { "title": "Bronze", "style": "bronze" }
          ],
          "rule": {
            "preset": "ICPC",
            "options": {
              "count": { "value": [1, 1, 1] }
            }
          }
        }
      ],
      "rows": [
        {
          "user": { "id": "team-alpha", "name": "Team Alpha" },
          "score": { "value": 2, "time": [238, "min"] },
          "statuses": [
            { "result": "AC", "time": [128, "min"], "tries": 1 },
            { "result": "FB", "time": [90, "min"], "tries": 2 },
            { "result": "RJ", "tries": 3 }
          ]
        },
        {
          "user": { "id": "team-beta", "name": "Team Beta" },
          "score": { "value": 1, "time": [160, "min"] },
          "statuses": [
            { "result": "FB", "time": [120, "min"], "tries": 3 },
            { "result": "RJ", "tries": 5 },
            { "result": null }
          ]
        }
      ],
      "sorter": {
        "algorithm": "ICPC",
        "config": {}
      }
    }
  11. Use srk TypeScript type definitions

    For TypeScript projects producing or consuming srk data, use the @algoux/standard-ranklist package to get full type hints and validation for the Ranklist object.
    npm install -D @algoux/standard-ranklist
    import type * as srk from '@algoux/standard-ranklist'
    
    const ranklist: srk.Ranklist = {
      type: 'general',
      version: '0.3.13',
      contest: {
        title: 'My Contest',
        startAt: '2019-01-01T09:00:00+08:00',
        duration: [5, 'h'],
      },
      problems: [{ alias: 'A' }],
      series: [],
      rows: [],
    }
  12. Install Standard Ranklist Utils for JavaScript, Python, or Go

    The Standard Ranklist Utils library provides common srk data processing functions, including sorting computation, data transformation, and utility helpers (e.g., time conversion and result evaluation). It is available across multiple languages via the following packages:
    # JavaScript / TypeScript (npm)
    npm install @algoux/standard-ranklist-utils
    
    # Python (PyPI)
    pip install algoux-standard-ranklist-utils
    
    # Go (Go modules)
    go get github.com/algoux/standard-ranklist-utils/go