Greasy Fork 支持简体中文。

Codeforces to Luogu

在 CF 题目界面显示两个通往洛谷该题目的题面 / 题解的按钮

// ==UserScript==
// @name         Codeforces to Luogu
// @namespace    Perfect-Izayoi-Sakuya
// @version      0.4
// @description  在 CF 题目界面显示两个通往洛谷该题目的题面 / 题解的按钮
// @author       LaoMang
// @license      MIT
// @match        https://codeforces.com/problemset/problem/*
// @match        https://codeforces.com/contest/*/problem/*
// @icon         https://codeforces.com/favicon.ico
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    let hrf = window.location.href.split('/')
    let idx = 'CF' + hrf[4 + (hrf[3] == 'problemset')] + hrf[6]
    let lst = document.querySelector('ul.second-level-menu-list')
    let node1 = document.createElement('li'), node2 = document.createElement('li')
    node1.innerHTML = '<a href="https://www.luogu.com.cn/problem/' + idx + '">Luogu statement</a>'
    node2.innerHTML = '<a href="https://www.luogu.com.cn/problem/solution/' + idx + '">Luogu solution</a>'
    lst.appendChild(node1)
    lst.appendChild(node2)
})();