版本比较
洛谷增强插件
正文
增加 137 行删除 128 行
39 行未改动40414243444546474849505152535455565758596061626364656667686970715 行未改动77787980818283848586200 行未改动全部展开2872882892902912922932946 行未改动3013023033043053063073083093103113123133143153163173183193203213223233243 行未改动3283293303313323333343359 行未改动34534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542612 行未改动43944044144244344444544644744844945045145245345445545645745845946046146227 行未改动49049149249349449549649749849950050150250350450550650750850951051151251351451520 行未改动53653753853954054154254354454554654754854955055155255355455555655755855956056156256339 行未改动60360460560660760860961061161261361461561661761861962062162262362462562662762862963063163219 行未改动65265365465565665765865943 行未改动70370470570670770870971014 行未改动7257267277287297307317327337347357367377387397407417427434 行未改动39 行未改动**用户颜色**:通过洛谷官方 API `https://www.luogu.com.cn/api/user/search?keyword={uid}` 获取用户信息,将 `color` 字段映射为 CSS 颜色。## 安装### 方法一:Chrome 扩展(crx 文件)由于非官方扩展无法直接拖拽安装,需要通过组策略强制安装。插件已打包为 `crx` 文件,点击下方链接下载:- **插件下载**:[洛谷增强插件.crx](https://www.luogu.com.cn/fe/api/problem/downloadAttachment/mubd4r28)- **组策略模板**:[chrome.adm](https://www.luogu.com.cn/fe/api/problem/downloadAttachment/9melhw1x)安装步骤:1. 打开 Chrome,在地址栏输入 `chrome://extensions/` 并回车。2. 开启右上角的「开发者模式」。3. 将 `crx` 文件拖入页面,Chrome 会提示无法安装,此时在页面上可以看到该扩展的 ID(一串字母),复制下来。4. 按下 `Win+R`,输入 `gpedit.msc` 打开本地组策略编辑器。5. 依次点击「计算机配置 → 管理模板」,右键选择「添加/删除模板」,导入 `chrome.adm` 文件。6. 找到路径「经典管理模板(ADM) → Google → Google Chrome → 扩展程序」。7. 双击「配置扩展程序安装许可名单」,选择「已启用」,点击「显示」。8. 将刚才复制的 ID 填入白名单列表,点击「应用」并按「确定」键关闭。9. 点击浏览器右上角的洛谷增强插件图标,点击「打开插件设置」,即可选择需要的功能(默认全开),点击保存并刷新页面即可。> 如需更新插件,只需直接将crx文件拖入即可,无需进入本地组策略编辑器### 方法二:Tampermonkey(油猴)1. 安装 [Tampermonkey](https://www.tampermonkey.net/) 浏览器扩展。2. 点击 Tampermonkey 图标 →「添加新脚本」。3. 将下方代码粘贴进去,按 `Ctrl+S` 保存。4. 点击油猴图标,点击「打开插件设置」,保存并刷新页面即可生效。5 行未改动```javascript// ==UserScript==// @name 洛谷增强插件// @namespace http://tampermonkey.net/// @version 3.0.0// @description 洛谷增强插件:广告屏蔽、题目颜色、用户颜色、保存站跳转// @author realskc (modified) & linch & Vitamin_B// @match *://*.luogu.com/*// @match *://*.luogu.com.cn/*// @grant GM_registerMenuCommand200 行未改动全部展开if (difficulty > 8) difficulty = 8;return `rgb(${problemDifficultyToColor[difficulty].join(',')})`;}function colorizePracticePageFromLabels() {const groups = document.querySelectorAll('.difficulty');let count = 0;groups.forEach(group => {6 行未改动}if (!problems) return;const links = problems.querySelectorAll('a[href^="/problem/"]');links.forEach(link => {const pidSpan = link.querySelector('.pid');if (pidSpan && pidSpan.dataset.lgbotProblemColored !== '1') {pidSpan.style.color = bgColor;pidSpan.dataset.lgbotProblemColored = '1';count++;} else if (!pidSpan) {const text = link.innerText.trim();const match = text.match(/^([A-Z]+\d+)/);if (match) {const pid = match[1];if (link.dataset.lgbotProblemColored !== '1') {link.innerHTML = text.replace(pid, `<span style="color:${bgColor};">${pid}</span>`);link.dataset.lgbotProblemColored = '1';count++;}}}});});if (count > 0) console.log(`洛谷增强插件: 练习页已为 ${count} 个题目编号着色(从难度标签)`);3 行未改动async function colorizePracticePageWithoutLabels() {const problemBlocks = document.querySelectorAll('.problems');let count = 0;let submittedMap = new Map();try {const feData = window._feInjection || window._feInstance;if (feData && feData.currentData) {const data = feData.currentData;9 行未改动}}} catch(e) {}for (const block of problemBlocks) {const prev = block.previousElementSibling;if (prev && prev.matches('.difficulty')) continue;const links = block.querySelectorAll('a[href^="/problem/"]:not([data-lgbot-problem-colored="1"])');if (links.length === 0) continue;for (const link of links) {let problemid = link.href.split('/problem/')[1].split('?')[0].split('/')[0];if (!problemid || !/[a-zA-Z]/.test(problemid) || !/[0-9]/.test(problemid)) continue;let color = submittedMap.get(problemid);if (!color) color = await fetchProblemColorForLink(problemid);if (!color) continue;const pidSpan = link.querySelector('.pid');if (pidSpan) {pidSpan.style.color = color;pidSpan.dataset.lgbotProblemColored = '1';count++;} else {const text = link.innerText.trim();const match = text.match(/^([A-Z]+\d+)/);if (match && match[1] === problemid) {link.innerHTML = text.replace(problemid, `<span style="color:${color};">${problemid}</span>`);link.dataset.lgbotProblemColored = '1';count++;}}}}if (count > 0) console.log(`洛谷增强插件: 练习页已为 ${count} 个题目编号着色(通过缓存/请求)`);}async function colorizeRecordPage() {const links = document.querySelectorAll('a[href^="/problem/"]:not([data-lgbot-problem-colored="1"])');if (links.length === 0) return;let recordMap = new Map();try {const feData = window._feInjection || window._feInstance;if (feData && feData.currentData && feData.currentData.records) {const records = feData.currentData.records.result;if (records && records.length > 0) {for (const item of records) {if (item.problem && item.problem.pid) {recordMap.set(item.problem.pid, getDifficultyColor(item.problem.difficulty));}}}}} catch(e) {}let count = 0;for (const link of links) {let problemid = link.href.split('/problem/')[1].split('?')[0].split('/')[0];if (!problemid || !/[a-zA-Z]/.test(problemid) || !/[0-9]/.test(problemid)) continue;let color = recordMap.get(problemid);if (!color) color = await fetchProblemColorForLink(problemid);if (!color) continue;const pidSpan = link.querySelector('.pid');if (pidSpan) {pidSpan.style.color = color;pidSpan.dataset.lgbotProblemColored = '1';count++;} else {const text = link.innerText.trim();const match = text.match(/^([A-Z]+\d+)/);if (match && match[1] === problemid) {link.innerHTML = text.replace(problemid, `<span style="color:${color};">${problemid}</span>`);link.dataset.lgbotProblemColored = '1';count++;}}}if (count > 0) console.log(`洛谷增强插件: 记录页已为 ${count} 个题目编号着色`);}async function fetchProblemColorForLink(problemid) {if (problemToColorMap.has(problemid)) return problemToColorMap.get(problemid);12 行未改动const doc = parser.parseFromString(html, 'text/html');let scriptText = '';for (const i of doc.querySelectorAll("script")) scriptText += i.textContent;const match = scriptText.match(/"difficulty":\d/);if (!match) return null;const difficulty = Number(match[0].match(/\d/)[0]);const color = getDifficultyColor(difficulty);problemToColorMap.set(problemid, color);return color;} catch (error) {console.warn(`获取题目 ${problemid} 颜色失败:`, error.message);return null;}}function isProblemId(problemid) {if (problemid.startsWith('AT_')) return true;if (!/[a-zA-Z]/.test(problemid) || !/[0-9]/.test(problemid)) return false;if (problemid.includes('html') || problemid.includes('void') || problemid.length > 20) return false;return true;}let scanTimer = null;27 行未改动if (pidSpan && pidSpan.dataset.lgbotProblemColored === '1') continue;if (!pidSpan && link.dataset.lgbotProblemColored === '1') continue;const text = link.innerText.trim();if (!pidSpan && !text.startsWith(problemid)) continue;toProcess.push({ link, pidSpan, problemid });}if (toProcess.length > 0) {for (const { link, pidSpan, problemid } of toProcess) {const color = await fetchProblemColorForLink(problemid);if (!color) continue;if (pidSpan) {pidSpan.style.color = color;pidSpan.dataset.lgbotProblemColored = '1';} else {const text = link.innerText.trim();if (text.startsWith(problemid)) {link.innerHTML = text.replace(problemid, `<span style="color:${color};">${problemid}</span>`);link.dataset.lgbotProblemColored = '1';}}}console.log(`洛谷增强插件: 已处理 ${toProcess.length} 个题目编号`);}20 行未改动colorizePracticePageWithoutLabels();}, 200);return;}if (path.startsWith('/record/list')) {await colorizeRecordPage();const observer = new MutationObserver(() => {colorizeRecordPage();});observer.observe(document.body, { childList: true, subtree: true });window.__lgbotProblemObserver = observer;startPeriodicScan(colorizeRecordPage, 200);return;}await scanAllLinks();startPeriodicScan(scanAllLinks, 200);const observer = new MutationObserver(() => {scanAllLinks();});observer.observe(document, { childList: true, subtree: true, characterData: true });window.__lgbotProblemObserver = observer;}const userColorCache = new Map();const userFetcher = new ConcurrencyLimiter(3, 200);function mapApiColorToCss(apiColor) {39 行未改动}async function colorizeUserLink(link) {const href = link.getAttribute('href');if (!/^\/user\/\d+$/.test(href)) return;const text = link.innerText.trim();const navTexts = ['个人中心', '主页', '用户设置', '练习情况', '练习', '专栏', '我/TA 关注的人', '个人设置', '我的收藏', '我的团队', '我的比赛', '我的题库'];if (navTexts.some(t => text === t || text.includes(t))) return;if (!/^[\w\u4e00-\u9fa5.]+$/.test(text)) return;const match = href.match(/\/user\/(\d+)/);if (!match) return;const uid = match[1];const info = await userFetcher.push(() => fetchUserInfo(uid));if (info) {link.style.setProperty('color', info.color, 'important');}link.dataset.lgbotColored = '1';}async function colorizeAllUserLinks() {const allLinks = document.querySelectorAll('a[href^="/user/"]');const promises = [];for (const link of allLinks) {if (link.dataset.lgbotColored === '1') continue;const href = link.getAttribute('href');if (/^\/user\/\d+$/.test(href)) {promises.push(colorizeUserLink(link));}}await Promise.all(promises);19 行未改动});window.__lgbotUserColorObserver = observer;}function saveSiteJump() {const url = window.location.href;const title = document.title;const html = document.documentElement.outerHTML;43 行未改动return;}}if (localStorage.getItem('lgbot1SaveSiteJump') !== 'false') {if (window.location.pathname.match(/^\/(paste|article|discuss)\//)) {saveSiteJump();}14 行未改动::::## 更新日志**v3.0.0(2026-08-04)**- 修复棕名用户(作弊者)显示为灰色的问题。- 题目颜色优先从 `_feInstance` 缓存读取,减少请求。## 附件| 文件 | 链接 ||------|------|| 洛谷增强插件.crx | [下载](https://www.luogu.com.cn/fe/api/problem/downloadAttachment/mubd4r28) || chrome.adm | [下载](https://www.luogu.com.cn/fe/api/problem/downloadAttachment/9melhw1x) |## 说明本文在写作过程中使用了 DeepSeek AI 进行代码生成、文字辅助润色和格式修改。所有代码均经过手工测试与验证,保证作者对文章的贡献大于AI。4 行未改动39 行未改动40414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091925 行未改动9899100101102103104105106107200 行未改动全部展开3083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483496 行未改动3563573583593603613623633643653663 行未改动3703713723733743753763773783799 行未改动38939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343412 行未改动44744844945045145245345445545645745845946046146246346446546646746846947047147247347447547627 行未改动50450550650750850951051151251351451551651751851952020 行未改动54154254354454554654754854955055155255355455555655739 行未改动59759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663719 行未改动65765865966066166266366466543 行未改动70971071171271371471571671714 行未改动7327337347357367377387397407417427437447457467477487497507517524 行未改动39 行未改动**用户颜色**:通过洛谷官方 API `https://www.luogu.com.cn/api/user/search?keyword={uid}` 获取用户信息,将 `color` 字段映射为 CSS 颜色。## 安装### 方法一:Chrome/Edge 扩展(crx 文件)由于非官方扩展无法直接拖拽安装,需要通过组策略强制安装。插件已打包为 `crx` 文件,点击下方链接下载:- **插件下载**:[洛谷增强插件.crx](https://www.luogu.com.cn/fe/api/problem/downloadAttachment/r73mtxte)- **Chrome组策略模板**:[chrome.adm](https://www.luogu.com.cn/fe/api/problem/downloadAttachment/9melhw1x)- **Edge组策略模板**:[msedge.adm](https://www.luogu.com.cn/fe/api/problem/downloadAttachment/d5iigel7)安装步骤:1. 打开浏览器,进入扩展管理页面:- Chrome:`chrome://extensions/`- Edge:`edge://extensions/`2. 开启开发者/开发人员模式:- Chrome:开启右上角的 「开发者模式」- Edge:开启左下角的 「开发人员模式」3. 将 `crx` 文件拖入页面,浏览器会提示无法安装,此时在页面上可以看到该扩展的 ID(一串字母),复制下来。4. 按下 `Win+R`,输入 `gpedit.msc` 打开本地组策略编辑器。5. 依次点击「计算机配置 → 管理模板」,右键选择「添加/删除模板」,导入 `chrome.adm`或 `msedge.adm` 文件。6. 找到路径「经典管理模板(ADM) → Google → Google Chrome → 扩展程序」 或「经典管理模板(ADM) → Microsoft Edge → 扩展」。7. 双击「配置扩展程序安装许可名单」或「允许安装特定扩展」,选择「已启用」,点击「显示」。8. 将刚才复制的 ID 填入白名单列表,点击「应用」并按「确定」键关闭。9. 点击浏览器右上角的洛谷增强插件图标,点击「打开插件设置」,即可选择需要的功能(默认全开),点击保存并刷新页面即可。> 如需更新插件,只需直接将crx文件拖入即可,无需进入本地组策略编辑器如果你的电脑没有本地组策略管理器,可尝试注册表法:1. 按下 `Win + R`,输入 `regedit` 打开注册表编辑器,定位到路径:- **Chrome**:`计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallAllowlist`- **Edge**:`计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\ExtensionInstallAllowlist`> 如果 `ExtensionInstallAllowlist` 文件夹不存在,在 `Chrome` 或 `Edge` 项下右键 → 新建 → 项,命名为 `ExtensionInstallAllowlist`。>2. 在右侧空白处,右键 → 新建 → 字符串值,名称命名为 `1`(如果已经有其他白名单,则继续用 `2`、`3`……)。3. 双击新建的字符串值,在「数值数据」中填入你刚才复制的扩展 ID,点击确定。4. 关闭注册表编辑器,**重启浏览器**。5. 在地址栏输入 `chrome://policy/`(或 `edge://policy/`),点击「重新加载策略」,确认「ExtensionInstallAllowlist」策略已生效。6. 再次将 `crx` 文件拖入扩展管理页面,即可成功安装。### 方法二:Tampermonkey(支持火狐等大部分浏览器)1. 安装 [Tampermonkey](https://www.tampermonkey.net/) 浏览器扩展。2. 点击 Tampermonkey 图标 →「添加新脚本」。3. 将下方代码粘贴进去,按 `Ctrl+S` 保存。4. 点击油猴图标,点击「打开插件设置」,保存并刷新页面即可生效。5 行未改动```javascript// ==UserScript==// @name 洛谷增强插件// @namespace http://tampermonkey.net/// @version 3.0.1// @description 洛谷增强插件:广告屏蔽、题目颜色、用户颜色、保存站跳转(题号规则:字母数字下划线,空格结束)// @author realskc (modified) & linch & Vitamin_B// @match *://*.luogu.com/*// @match *://*.luogu.com.cn/*// @grant GM_registerMenuCommand200 行未改动全部展开if (difficulty > 8) difficulty = 8;return `rgb(${problemDifficultyToColor[difficulty].join(',')})`;}// ========== 统一题号着色函数(按空格提取) ==========function colorizeLinkElement(link, color) {if (link.dataset.lgbotProblemColored === '1') return;// 如果有 .pid 元素(官方结构),直接染它const pidSpan = link.querySelector('.pid');if (pidSpan) {pidSpan.style.color = color;pidSpan.dataset.lgbotProblemColored = '1';return;}const text = link.textContent.trim();// 取第一个空格前的内容作为题号let problemId = text;const spaceIndex = text.indexOf(' ');if (spaceIndex > 0) {problemId = text.substring(0, spaceIndex);}// 验证是否由字母/数字/下划线组成(长度1~20)if (!/^[A-Za-z0-9_]{1,20}$/.test(problemId)) {// 回退:整链着色link.style.setProperty('color', color, 'important');link.dataset.lgbotProblemColored = '1';return;}// 将题号部分用带颜色的 span 包裹(只替换第一次出现的题号)const newHtml = text.replace(problemId, `<span style="color:${color} !important;">${problemId}</span>`);link.innerHTML = newHtml;link.dataset.lgbotProblemColored = '1';}function colorizePracticePageFromLabels() {const groups = document.querySelectorAll('.difficulty');let count = 0;groups.forEach(group => {6 行未改动}if (!problems) return;const links = problems.querySelectorAll('a[href^="/problem/"]');links.forEach(link => {if (link.dataset.lgbotProblemColored !== '1') {colorizeLinkElement(link, bgColor);count++;}});});if (count > 0) console.log(`洛谷增强插件: 练习页已为 ${count} 个题目编号着色(从难度标签)`);3 行未改动async function colorizePracticePageWithoutLabels() {const problemBlocks = document.querySelectorAll('.problems');let count = 0;let submittedMap = new Map();// 从 _feInjection / _feInstance 读取try {const feData = window._feInjection || window._feInstance;if (feData && feData.currentData) {const data = feData.currentData;9 行未改动}}} catch(e) {}// 从 lentille-context 读取try {const scriptEl = document.querySelector('script#lentille-context');if (scriptEl) {const jsonData = JSON.parse(scriptEl.textContent);const data = jsonData.data;if (data && data.passed) {for (const p of data.passed) {submittedMap.set(p.pid, getDifficultyColor(p.difficulty));}}if (data && data.submitted) {for (const p of data.submitted) {submittedMap.set(p.pid, getDifficultyColor(p.difficulty));}}}} catch(e) {console.warn('洛谷增强插件: 解析 lentille-context 失败', e);}for (const block of problemBlocks) {const links = block.querySelectorAll('a[href^="/problem/"]:not([data-lgbot-problem-colored="1"])');if (links.length === 0) continue;for (const link of links) {let problemid = link.href.split('/problem/')[1].split('?')[0].split('/')[0];if (!problemid || !/[a-zA-Z]/.test(problemid) || !/[0-9]/.test(problemid)) continue;let color = submittedMap.get(problemid);if (!color) color = await fetchProblemColorForLink(problemid);if (!color) continue;colorizeLinkElement(link, color);count++;}}if (count > 0) console.log(`洛谷增强插件: 练习页已为 ${count} 个题目编号着色(通过缓存/请求)`);}async function fetchProblemColorForLink(problemid) {if (problemToColorMap.has(problemid)) return problemToColorMap.get(problemid);12 行未改动const doc = parser.parseFromString(html, 'text/html');let scriptText = '';for (const i of doc.querySelectorAll("script")) scriptText += i.textContent;const match = scriptText.match(/"difficulty":\d/);let color;if (match) {const difficulty = Number(match[0].match(/\d/)[0]);color = getDifficultyColor(difficulty);} else {color = getDifficultyColor(0);console.log(`洛谷增强插件: 题目 ${problemid} 未找到难度,使用默认灰色`);}problemToColorMap.set(problemid, color);return color;} catch (error) {console.warn(`获取题目 ${problemid} 颜色失败:`, error.message);const defaultColor = getDifficultyColor(0);problemToColorMap.set(problemid, defaultColor);return defaultColor;}}// ========== 修改:新题号规则 ==========function isProblemId(problemid) {// 只允许字母、数字、下划线,长度 1~20return /^[A-Za-z0-9_]{1,20}$/.test(problemid);}let scanTimer = null;27 行未改动if (pidSpan && pidSpan.dataset.lgbotProblemColored === '1') continue;if (!pidSpan && link.dataset.lgbotProblemColored === '1') continue;const text = link.innerText.trim();if (!pidSpan && !text.includes(problemid)) continue;toProcess.push({ link, pidSpan, problemid });}if (toProcess.length > 0) {for (const { link, pidSpan, problemid } of toProcess) {const color = await fetchProblemColorForLink(problemid);if (!color) continue;colorizeLinkElement(link, color);}console.log(`洛谷增强插件: 已处理 ${toProcess.length} 个题目编号`);}20 行未改动colorizePracticePageWithoutLabels();}, 200);return;}// 所有其他页面(包括记录页、讨论区、犇犇等)统一处理await scanAllLinks();startPeriodicScan(scanAllLinks, 200);const observer = new MutationObserver(() => { scanAllLinks(); });observer.observe(document, { childList: true, subtree: true, characterData: true });window.__lgbotProblemObserver = observer;}// ========== 用户颜色相关 ==========const userColorCache = new Map();const userFetcher = new ConcurrencyLimiter(3, 200);function mapApiColorToCss(apiColor) {39 行未改动}async function colorizeUserLink(link) {const href = link.getAttribute('href');const path = href.replace(/^https?:\/\/[^\/]+/, '');if (!/^\/user\/\d+$/.test(path)) return;const text = link.innerText.trim();const navTexts = ['个人中心', '主页', '用户设置', '练习情况', '练习', '专栏', '我/TA 关注的人', '个人设置', '我的收藏', '我的团队', '我的比赛', '我的题库'];if (navTexts.some(t => text === t || text.includes(t))) return;const match = path.match(/\/user\/(\d+)/);if (!match) return;const uid = match[1];const info = await userFetcher.push(() => fetchUserInfo(uid));if (!info) {link.dataset.lgbotColored = '1';return;}if (text.startsWith('@')) {const username = text.substring(1);link.innerHTML = `<span style="color:inherit;">@</span><span style="color:${info.color} !important;">${username}</span>`;} else {link.style.setProperty('color', info.color, 'important');}link.dataset.lgbotColored = '1';}async function colorizeAllUserLinks() {const allLinks = document.querySelectorAll('a[href^="/user/"], a[href*="luogu.com/user/"], a[href*="luogu.com.cn/user/"]');const promises = [];for (const link of allLinks) {if (link.dataset.lgbotColored === '1') continue;const href = link.getAttribute('href');const path = href.replace(/^https?:\/\/[^\/]+/, '');if (/^\/user\/\d+$/.test(path)) {promises.push(colorizeUserLink(link));}}await Promise.all(promises);19 行未改动});window.__lgbotUserColorObserver = observer;}// ========== 保存站跳转 ==========function saveSiteJump() {const url = window.location.href;const title = document.title;const html = document.documentElement.outerHTML;43 行未改动return;}}// ========== 启动逻辑 ==========if (localStorage.getItem('lgbot1SaveSiteJump') !== 'false') {if (window.location.pathname.match(/^\/(paste|article|discuss)\//)) {saveSiteJump();}14 行未改动::::## 更新日志**v3.0.0(2026-08-05)**- 修复棕名用户(作弊者)显示为灰色的问题。- 题目颜色优先从 `_feInstance` 缓存读取,减少请求。- 修复日文用户名或用户链接采用绝对路径无法上色的问题。## 附件| 文件 | 链接 ||------|------|| 洛谷增强插件.crx | [下载](https://www.luogu.com.cn/fe/api/problem/downloadAttachment/r73mtxte) || chrome.adm | [下载](https://www.luogu.com.cn/fe/api/problem/downloadAttachment/9melhw1x) || msedge.adm | [下载](https://www.luogu.com.cn/fe/api/problem/downloadAttachment/d5iigel7) |## 说明本文在写作过程中使用了 DeepSeek AI 进行代码生成、文字辅助润色和格式修改。所有代码均经过手工测试与验证,保证作者对文章的贡献大于AI。4 行未改动