CodeForces Solution Opener

Quickly find fastest solution.

当前为 2022-02-08 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name CodeForces Solution Opener
  3. // @namespace slbtty.codeforces.solution
  4. // @match https://codeforces.*/problemset/problem/*/*
  5. // @match https://codeforces.*/contest/*/problem/*
  6. // @grant none
  7. // @license GPLv3
  8. // @version 1.1.1
  9. // @home-url https://github.com/shenlebantongying
  10. // @author slbtty
  11. // @description Quickly find fastest solution.
  12. // ==/UserScript==
  13.  
  14. const url = document.URL
  15. url_parts=url.split("/")
  16.  
  17. if(url_parts.includes('contest')){
  18. var new_url = "https://codeforces.com/problemset/status/"
  19. +url_parts[url_parts.length-3]
  20. +"/problem/"
  21. +url_parts[url_parts.length-1]
  22. +"?order=BY_CONSUMED_TIME_ASC"
  23. } else {
  24. var new_url = "https://codeforces.com/problemset/status/"
  25. +url_parts[url_parts.length-2]
  26. +"/problem/"
  27. +url_parts[url_parts.length-1]
  28. +"?order=BY_CONSUMED_TIME_ASC"
  29. }
  30.  
  31. var mainMenu = document.querySelector(".main-menu-list");
  32.  
  33. var solution_li = document.createElement("li");
  34.  
  35. var btn = document.createElement('a');
  36. btn.setAttribute('href',new_url);
  37. btn.innerHTML = "Solution";
  38.  
  39. solution_li.appendChild(btn);
  40. mainMenu.appendChild(solution_li);

QingJ © 2025

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