输入验证码___[LUOGU CAPTCHA]
洛谷优化
网速加速器
内卷监视器
var userlist =
["__luo2031__","__Ganlai__","meng_xiong","zhujvnhan","__slch__","xl_lsq630"];
<!-- 观察成员列表 -->
var pages = 1; <!-- 初始检查做题记录页数,建议设置为 1-2 -->
var cd = 10000; <!-- 自动检查每个人时间间隔,建议保持为 10000,以免 GG-->
function onSearch(obj)
{
var storeId=document.getElementById('store');
var rowsLength=storeId.rows.length;
var key=document.getElementById('key').value;
for(var i=1;i < rowsLength;i++)
{
var searchText=storeId.rows[i].cells[0].innerHTML;
if(key=="*"||searchText.match(key))
storeId.rows[i].style.display='';
else
storeId.rows[i].style.display='none';
}
};
str='<div><select onchange="onSearch()" name="key" id="key"><option value="*">*</option>';
for(var i=0;i < userlist.length;i++)
str+='<option value="'+userlist[i]+'">'+userlist[i]+'</option>';
str+='</select></div><table id="store" style="white-space: nowrap;"><tr><th>用户</th><th>题号</th><th>标题</th></tr></table>';
document.body.innerHTML = "<h1 style='text-align:center;color:red;font-family:Microsoft Yahei'>内卷监视工具</h1>";
document.body.innerHTML += "<b style='text-align:center;font-family:FangSong'>运筹首页之中,偷袭千里之外😅</b><hr>" + str;
<!-- Output Emoji & Option -->
var colors=['rgb(191, 191, 191)','rgb(254, 76, 97)','rgb(243, 156, 17)','rgb(255, 193, 22)','rgb(82, 196, 26)','rgb(52, 152, 219)','rgb(157, 61, 207)','rgb(14, 29, 105)'];
var name="灰红橙黄绿蓝紫黑";
var lst=Array();
var cnt=0;
function PARSE(First=false)
{
cnt=(cnt+1)%userlist.length;
var user=userlist[cnt];
var Pagenum=1;if(First)Pagenum=pages;
for(;Pagenum>0;Pagenum--)
{
var httpRequest=new XMLHttpRequest();
httpRequest.open('GET','https://www.luogu.com.cn/record/list?user='+user+'&page='+Pagenum,false);
httpRequest.send();
if(httpRequest.readyState==4&&httpRequest.status==200)
{
var content=httpRequest.responseText;
var patten=/decodeURIComponent\(".*?"\)/;
content=patten.exec(content)[0];
content=content.substr(20,content.length-22);
content=JSON.parse(decodeURIComponent(content));
var prob,col,pid,title;
for(var i=Math.min(content.currentData.records.result.length-1,19);i>=0;i--)
if(content.currentData.records.result[i].status==12&&content.currentData.records.result[i].id>lst[cnt])
{
prob=content.currentData.records.result[i].problem;
col=colors[prob.difficulty];
pid=prob.pid;
title=prob.title;
document.getElementById('store').childNodes[0].innerHTML
+='<tr><td>'+user+'</td><td>'+pid+'</td><td>'+
"<a style='color:"+col+"' href='https://www.luogu.com.cn/problem/"+pid+"' target='_blank'>"
+title+"</a>"+'</td></tr>';
if(!First)
alert(user+" 刚刚卷了"+name[prob.difficulty]+"题 "+pid+" "+title);
lst[cnt]=content.currentData.records.result[i].id
}
}
}
}
for(var i=0;i < userlist.length;i++)lst[i]=0;
for(var i=0;i < userlist.length;i++)PARSE(true);
window.setInterval(PARSE,cd);
欧拉函数
#include <iostream>
using namespace std;
int euler_phi(int n) {
int ans = n;
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) {
ans = ans / i * (i - 1); // 去掉质因子影响
while (n % i == 0) n /= i;
}
}
if (n > 1) ans = ans / n * (n - 1); // 最后剩余质因子
return ans;
}
int main() {
int n;
cin >> n;
cout << euler_phi(n) << endl;
}exGCD
int exgcd(int a, int b, int &x, int &y) {
if (b == 0) {
x = 1, y = 0;
return a;
}
int d = exgcd(b, a % b, x, y);
int temp = y;
y = x - (a / b) * y;
x = temp;
return d;
}CRT
int exgcd(int a, int b, int &x, int &y) {
if (b == 0) {
x = 1, y = 0;
return a;
}
int d = exgcd(b, a % b, x, y);
int temp = y;
y = x - (a / b) * y;
x = temp;
return d;
}
int crt(int k, int a[], int m[]) {
int tot = 1, res = 0;
for (int i = 1; i <= k; i++) tot *= m[i];
for (int i = 1; i <= k; i++) {
int Mi = tot / m[i];
int ti, y;
exgcd(Mi, m[i], ti, y);
res = (res + a[i] * Mi % tot * ti) % tot;
}
return (res % tot + tot) % tot;
}https://developer.mozilla.org/zh-CN/docs/Learn_web_development/Getting_started/Your_first_website
洛谷界面优化(油猴)
// ==UserScript==
// @name 洛谷增强·圆润笔锋+白色代码
// @namespace http://tampermonkey.net/
// @version 4.6
// @description 中文瘦长有笔锋,保留拉满效果,代码区白色背景
// @match https://www.luogu.com.cn/*
// @grant GM_addStyle
// ==/UserScript==
(function() {
'use strict';
GM_addStyle(`
/* ===== 全局字体 ===== */
body {
font-family:
"Source Han Serif CN",
"思源宋体",
"STFangsong",
"PingFang SC",
"Microsoft YaHei",
"Segoe UI",
"SF Pro Display",
sans-serif !important;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
letter-spacing: 0.5px;
background: linear-gradient(135deg,#f4f7ff,#f9fbff);
}
/* ===== 卡片立体浮层 ===== */
.card, .am-panel, .lg-article {
border-radius: 16px !important;
background: #ffffff !important;
box-shadow: 0 8px 24px rgba(0,0,0,0.06);
transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover, .am-panel:hover {
transform: translateY(-6px);
box-shadow: 0 18px 40px rgba(0,0,0,0.12);
}
/* ===== 按钮高级渐变 ===== */
button, .am-btn {
border-radius: 12px !important;
background: linear-gradient(135deg,#5a7cff,#7aa2ff) !important;
color: white !important;
border: none !important;
transition: box-shadow 0.2s ease, transform 0.1s ease;
box-shadow: 0 6px 18px rgba(90,124,255,0.3);
}
button:hover, .am-btn:hover {
box-shadow: 0 10px 26px rgba(90,124,255,0.5);
}
button:active, .am-btn:active {
transform: translateY(2px);
}
/* ===== 表格行高亮 ===== */
tr:hover {
background-color: #eef3ff !important;
}
/* ===== 输入框光晕 ===== */
input, textarea {
border-radius: 10px !important;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus, textarea:focus {
border-color: #5a7cff !important;
box-shadow: 0 0 8px rgba(90,124,255,0.35);
}
/* ===== 链接高级下划线动画 ===== */
a {
position: relative;
transition: color 0.2s ease;
}
a::after {
content: "";
position: absolute;
left: 0;
bottom: -2px;
width: 0;
height: 2px;
background: #5a7cff;
transition: width 0.25s ease;
}
a:hover {
color: #5a7cff !important;
}
a:hover::after {
width: 100%;
}
/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
width: 9px;
}
::-webkit-scrollbar-thumb {
background: #5a7cff;
border-radius: 20px;
}
::-webkit-scrollbar-track {
background: transparent;
}
/* ===== 标题更优雅 ===== */
h1,h2,h3,h4,h5,h6 {
font-weight: 600 !important;
letter-spacing: 0.5px;
}
/* ===== 表格数字更整齐 ===== */
table {
font-variant-numeric: tabular-nums;
}
`);
})();
