my cf

CF插件,可以跳转洛谷

  1. // ==UserScript==
  2. // @name my cf
  3. // @namespace xay5421
  4. // @author xay5421
  5. // @match *://codeforces.com/problemset/problem/*
  6. // @match *://codeforces.com/contest/*/problem/*
  7. // @match *://codeforces.ml/problemset/problem/*
  8. // @match *://codeforces.ml/contest/*/problem/*
  9. // @match *://codeforces.com/*
  10. // @version 0.1
  11. // @description CF插件,可以跳转洛谷
  12. // @require https://code.jquery.com/jquery-3.4.1.min.js
  13. // ==/UserScript==
  14.  
  15. const pathname=location.pathname
  16.  
  17. if(/\/problemset\/problem\/(\d*)\/([A-Z][1-9]?)$/.test(pathname)){
  18. location.href=`/contest/${RegExp.$1}/problem/${RegExp.$2}`;
  19. }
  20. else if(/\/contest\/(\d*)\/problem\/([A-Z][1-9]?)$/.test(pathname)){
  21. let x=$('.header>.title'),y=x.html();
  22. x.html(`<a href="https://www.luogu.com.cn/problem/CF${RegExp.$1+RegExp.$2}" target="_blank">${y}</a>`);
  23. }
  24.  
  25. if(0){
  26. var stateObject = {};
  27. var title = "Wow Title";
  28. var newUrl = "/my/awesome/url";
  29. history.pushState(stateObject,title,newUrl);
  30. }

QingJ © 2025

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