Greasy Fork is available in English.

Atcoder to Luogu

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

  1. // ==UserScript==
  2. // @name Atcoder to Luogu
  3. // @namespace Perfect-Izayoi-Sakuya
  4. // @version 0.4
  5. // @description 在 AT 题目界面显示两个通往洛谷该题目的题面 / 题解的按钮
  6. // @author LaoMang
  7. // @license MIT
  8. // @match https://atcoder.jp/contests/*/tasks/*
  9. // @icon https://atcoder.jp/favicon.ico
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. if (window.location.href.split('/').slice(-1) == 'editorial') return
  16. let t = document.querySelector('span.h2')
  17. let ele1 = t.childNodes[1].cloneNode(), ele2 = t.childNodes[1].cloneNode()
  18. ele1.innerHTML = 'Luogu statement'
  19. ele1.href = '//www.luogu.com.cn/problem/AT_' + window.location.href.split('/').slice(-1)
  20. ele2.innerHTML = 'Luogu solution'
  21. ele2.href = '//www.luogu.com.cn/problem/solution/AT_' + window.location.href.split('/').slice(-1)
  22. t.appendChild(ele1)
  23. t.innerHTML += '\n'
  24. t.appendChild(ele2)
  25. })();