AtCoder Participants Display

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل 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);
    }
})();