AtCoder Custom Default Submissions

AtCoderのすべての提出の絞り込み、並び替え設定のデフォルトを設定します。本スクリプトのデフォルトは言語C++, 結果AC, コード長の昇順に並び替えです。

  1. // ==UserScript==
  2. // @name AtCoder Custom Default Submissions
  3. // @namespace https://github.com/ktny
  4. // @version 1.5
  5. // @description AtCoderのすべての提出の絞り込み、並び替え設定のデフォルトを設定します。本スクリプトのデフォルトは言語C++, 結果AC, コード長の昇順に並び替えです。
  6. // @author ktnyori
  7. // @license MIT
  8. // @include https://atcoder.jp/contests/*
  9. // ==/UserScript==
  10. (function () {
  11. 'use strict';
  12. /**********************************************
  13. * langsの中から自分が使用する言語に変更してください
  14. * ex) C#, Python3, Rust, Java
  15. ***********************************************/
  16. const lang = 'C++';
  17. // 問題ページにいるときは問題番号での絞り込みも追加
  18. const taskPage = location.href.match(/tasks\/(.+?)$/);
  19. let task = '';
  20. if (taskPage && taskPage[1]) {
  21. task = taskPage[1];
  22. }
  23. const params = {
  24. 'f.Task': task,
  25. 'f.LanguageName': lang,
  26. // AC, WA, TLE, MLE, RE, CE, QLE, OLE, IE, WJ, WR, Judging
  27. 'f.Status': 'AC',
  28. // source_length, time_consumption, memory_consumption, score
  29. 'orderBy': 'source_length',
  30. };
  31. const esc = encodeURIComponent;
  32. const querystring = Object.keys(params).map(k => esc(k) + '=' + esc(params[k])).join('&');
  33. const links = document.querySelectorAll('#contest-nav-tabs a');
  34. for (let i = 0; i < links.length; i++) {
  35. const href = links[i].getAttribute('href');
  36. if (href && href.endsWith('submissions')) {
  37. links[i].setAttribute('href', `${href}?${querystring}`);
  38. }
  39. }
  40. })();

QingJ © 2025

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