Atcoder to Luogu

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

17.11.2022 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Atcoder to Luogu
// @namespace    Perfect-Izayoi-Sakuya
// @version      0.2
// @description  在 AT 题目界面显示两个通往洛谷该题目的题面 / 题解的按钮
// @author       LaoMang
// @license      MIT
// @match        https://atcoder.jp/contests/*/tasks/*
// @icon         https://img.atcoder.jp/assets/logo.png
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    if (window.location.href.split('/').slice(-1) == 'editorial') return;
    let t = document.querySelector('span.h2')
    let ele1 = t.childNodes[1].cloneNode(), ele2 = t.childNodes[1].cloneNode()
    ele1.innerHTML = 'Luogu statement'
    ele1.href = '//www.luogu.com.cn/problem/AT_' + window.location.href.split('/').slice(-1)
    ele2.innerHTML = 'Luogu solution'
    ele2.href = '//www.luogu.com.cn/problem/solution/AT_' + window.location.href.split('/').slice(-1)
    t.appendChild(ele1)
    t.innerHTML += '\n'
    t.appendChild(ele2)
})();