Luogu No More Difficulties

把洛谷所有题目的难度标签改成入门

目前為 2019-11-08 提交的版本,檢視 最新版本

// ==UserScript==
// @name     Luogu No More Difficulties
// @description 把洛谷所有题目的难度标签改成入门
// @version  1
// @match    *://www.luogu.org/problem/*
// @grant    none
// @run-at   document-idle
// @namespace https://greasyfork.org/users/396032
// ==/UserScript==
/*jshint esversion: 6 */

(() => {
  //thx @sjx233
  const data = _feInjection.currentData;
  const dif = problem => problem.difficulty = 1;
  if (data.problem) dif(data.problem);
  if (data.problems) data.problems.result.forEach(dif);
})();