Greasy Fork 支持简体中文。

牛客网 竞赛题目 显示通过百分比

try to take over the world!

// ==UserScript==
// @name         牛客网 竞赛题目 显示通过百分比
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://ac.nowcoder.com/acm/contest/**
// @grant        none
// ==/UserScript==

(function(window) {

    const change = ()=>{
         if(location.hash==='#question')
             setTimeout(()=>{
                 var ps =  $('.link-green').parent()
                 console.log(111)
                 var i,c,p;
                 for(i =0;i<ps.length;i++){
                     c  = $(ps[i]).next()[0]
                     if(c){
                         let [pp,t] = c.innerText.split('/')
                         if(t && pp){
                             p = pp/t*100;
                             c.innerHTML += ' <span style="color:#f00">'+p.toFixed(2)+'%</span>';
                         }
                     }
                 }},500)

    }
    window.addEventListener('hashchange',change)
    change()
    // Your code here...
})(window);