Greasy Fork

Greasy Fork is available in English.

Codeforces显示problemSet页面的题目数量统计

一款可以显示当前页面的题目数量和已解决题目数量和待解决题目数量的Codeforces插件。

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Codeforces显示problemSet页面的题目数量统计
// @namespace    http://tampermonkey.net/
// @version      1.5
// @description  一款可以显示当前页面的题目数量和已解决题目数量和待解决题目数量的Codeforces插件。
// @author       turgen
// @match        https://codeforces.com/problemset*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=codeforces.com
// @license        GPL
// ==/UserScript==

(function() {
 window.onload=function(){
   var table = document.querySelector("table.problems");
    if (table) {
        var tbody = table.querySelector("tbody");
        if (tbody) {
            var problemCount = tbody.querySelectorAll("tr").length-1;
            var AcceptedCount= tbody.querySelectorAll("tr.accepted-problem").length;
        }
        var org=table.getElementsByClassName("top")[1]
        if(problemCount>0)org.innerHTML="<strong>题目</strong>"+"<strong>(本页面总共<span style='color: red'>"+problemCount+"</span>道题目,</strong>"+"<strong>已解决<span style='color: green'>"+AcceptedCount+"</span>道,</strong>"+"<strong>剩余<span style='color: red'>"+(problemCount-AcceptedCount)+"</span>道未解决)</strong>"
    }
 }
})();