Greasy Fork镜像 还支持 简体中文。

Luogu Solutions for Codeforces

Add a button to your Codeforces tool bar.

  1. // ==UserScript==
  2. // @name Luogu Solutions for Codeforces
  3. // @namespace https://subc.rip
  4. // @version 2024-02-17
  5. // @description Add a button to your Codeforces tool bar.
  6. // @author subcrip
  7. // @match https://codeforces.com/problemset/problem/*
  8. // @match https://codeforces.com/contest/*/problem/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=codeforces.com
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. const url = window.location.pathname.split('/');
  17. let contest, problem;
  18. if (url.includes('contest')) {
  19. contest = url[2];
  20. problem = url[4];
  21. } else {
  22. contest = url[3];
  23. problem = url[4];
  24. }
  25. let button = document.createElement('li');
  26. let inner = document.createElement('a');
  27. inner.target = '_blank';
  28. inner.href = `https://www.luogu.com.cn/problem/solution/CF${contest}${problem}`;
  29. inner.innerText = 'SOLUTIONS';
  30. button.appendChild(inner);
  31. let menu = document.getElementsByClassName('second-level-menu-list')[0];
  32. menu.insertBefore(button, menu.children[2])
  33. })();

QingJ © 2025

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