Codeforces to Luogu

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

  1. // ==UserScript==
  2. // @name Codeforces to Luogu
  3. // @namespace Perfect-Izayoi-Sakuya
  4. // @version 0.4
  5. // @description 在 CF 题目界面显示两个通往洛谷该题目的题面 / 题解的按钮
  6. // @author LaoMang
  7. // @license MIT
  8. // @match https://codeforces.com/problemset/problem/*
  9. // @match https://codeforces.com/contest/*/problem/*
  10. // @icon https://codeforces.com/favicon.ico
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. let hrf = window.location.href.split('/')
  17. let idx = 'CF' + hrf[4 + (hrf[3] == 'problemset')] + hrf[6]
  18. let lst = document.querySelector('ul.second-level-menu-list')
  19. let node1 = document.createElement('li'), node2 = document.createElement('li')
  20. node1.innerHTML = '<a href="https://www.luogu.com.cn/problem/' + idx + '">Luogu statement</a>'
  21. node2.innerHTML = '<a href="https://www.luogu.com.cn/problem/solution/' + idx + '">Luogu solution</a>'
  22. lst.appendChild(node1)
  23. lst.appendChild(node2)
  24. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址