AtCoder Participants Display

AtCoderの順位表に種類別の参加人数を表示する。

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         AtCoder Participants Display
// @namespace    http://tampermonkey.net/
// @version      2025-08-11-2
// @description  AtCoderの順位表に種類別の参加人数を表示する。
// @author       Tamiji153
// @match        https://atcoder.jp/*
// @license      MIT
// @grant        none
// ==/UserScript==

(async () => {
    'use strict';
    let url = location.pathname;
    if (url[url.length - 1] != '/') {
        url += '/';
    }
    let urls = url.split('/');
    if (urls[1] == 'contests' && urls[3] == 'standings') {
        let data = (await (await fetch(url + 'json')).json()).StandingsData;
        let team = 0;
        let rated = 0;
        let unr = 0;
        data.forEach((e) => {
            if (e.IsTeam) {
                team++;
            } else if (e.IsRated) {
                rated++;
            } else {
                unr++;
            }
        })
        let dis = document.createElement('h4');
        dis.innerHTML = `Participants: ${data.length} (Teams: ${team}, Rated: ${rated}, Unrated: ${unr})`;
        document.querySelector('#vue-standings>div>.text-center').after(dis);
    }
})();