版本比较
find cheat
正文
增加 48 行删除 8 行
12345678591011121376 行未改动90919293909495969798991001011021039910410510110610710810410911011111211376 行未改动19019119219319419519619719819919420020120220319820420520620720836 行未改动2452462472482432492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912 行未改动请在发工单时加入如下内容:```markdown使用 [工具](https://www.luogu.com.cn/article/92py95rq) 辅助检查,均经过人工复核。``````js// ==UserScript==// @name Luogu Find Cheater// @namespace https://www.luogu.com.cn/user/841039// @version 2026-1-21// @version 2026-2-9// @author wanganze// @description luogu helper// @icon https://fecdn.luogu.com.cn/favicon.ico// @match *://*.luogu.com.cn/*76 行未改动 }); return data; } catch (error) { console.error('Error geting context:', error); console.log("error on",location.pathname); console.log("error on",url); return; }}unsafeWindow.get_context = get_context;function get_code(markdown){ let codes = []; let lst = 0,flag = 0; let mkd = markdown + '```'; while(markdown.indexOf("```",lst) != -1) while(mkd.indexOf("```",lst) != -1) { let cur = markdown.indexOf("```",lst); let cur = mkd.indexOf("```",lst); if(flag) { let res = markdown.slice(markdown.indexOf("\n",lst),cur - 1); let res = mkd.slice(mkd.indexOf("\n",lst),cur - 1); codes.push(res) } lst = cur + 3; flag ^= 1;76 行未改动 } return matrix[b.length][a.length];}unsafeWindow.cmp = similar;let dis;async function similar(code,std){ let lim = Math.min(200,0.1 * Math.max(code.length,std.length)); let code1 = await change(code); let std1 = await change(std); console.log("len",code.length,std.length); //console.log("len",code.length,std.length); if(Math.abs(code1.length - std1.length) > lim) return; //console.log(code1); //console.log(std1); let dis = await levenshtein(code1,std1); dis = await levenshtein(code1,std1); console.log(dis,lim); if(dis <= lim) return 1; return 0;}36 行未改动 { if((await similar(code,y)) == 1) { flag = 1; console.log(pid,x.lid); console.log(code,y); console.log(dis); console.log(pid,"https://www.luogu.com.cn/article/"+x.lid,location.href); } } }}unsafeWindow.find = get_userasync function get_user(l,r){ if(l == null && r == null) { let intro = (await get_context(location.href)); if(intro == null) return; let list = intro.data.dailyCounts; console.log(list); for(let x in list) { if(list.hasOwnProperty(x)) { if(list[x][0]>30 && list[x][1] > 2) alert(' '+x + ' ' + list[x]); } } } for(let i = l; i <= r; i ++) { let intro = (await get_context("https://www.luogu.com.cn/user/"+i)); if(intro == null) continue; let list = intro.data.dailyCounts; console.log(list); for(let x in list) { if(list.hasOwnProperty(x)) { if(list[x][0]>30 && list[x][1] > 2) alert(i+' '+x + ' ' + list[x]); } } }}(function() { 'use strict';
//getsolutions("P1001");2 行未改动