AtCoder Participants Display

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

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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);
    }
})();