AtCoder Participants Display

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

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