@@ -1734,8 +1721,7 @@ async function main() {
localStorage.setItem("UserScript-Contest-" + Temp[i].childNodes[0].innerText + "-Name", Temp[i].childNodes[1].innerText);
}
} else {
- document.getElementsByTagName("h3")[0].innerHTML =
- "比赛" + document.getElementsByTagName("h3")[0].innerHTML.substring(7);
+ document.getElementsByTagName("h3")[0].innerHTML = "比赛" + document.getElementsByTagName("h3")[0].innerHTML.substring(7);
if (document.querySelector("#time_left") != null) {
let EndTime = document.querySelector("body > div > div.mt-3 > center").childNodes[3].data;
EndTime = EndTime.substring(EndTime.indexOf("结束时间是:") + 6, EndTime.lastIndexOf("。"));
@@ -1754,8 +1740,7 @@ async function main() {
HTMLData = HTMLData.replaceAll("\n状态:", " 状态:")
document.querySelector("body > div > div.mt-3 > center > div").innerHTML = HTMLData;
if (UtilityEnabled("RemoveAlerts") && document.querySelector("body > div > div.mt-3 > center").innerHTML.indexOf("尚未开始比赛") != -1) {
- document.querySelector("body > div > div.mt-3 > center > a").setAttribute("href",
- "start_contest.php?cid=" + SearchParams.get("cid"));
+ document.querySelector("body > div > div.mt-3 > center > a").setAttribute("href", "start_contest.php?cid=" + SearchParams.get("cid"));
} else if (UtilityEnabled("AutoRefresh")) {
addEventListener("focus", async () => {
await fetch(location.href)
@@ -1781,8 +1766,7 @@ async function main() {
});
document.querySelector("body > div > div.mt-3 > center > br:nth-child(2)").remove();
document.querySelector("body > div > div.mt-3 > center > br:nth-child(2)").remove();
- document.querySelector("body > div > div.mt-3 > center > div > .red").innerHTML =
- String(document.querySelector("body > div > div.mt-3 > center > div > .red").innerHTML).replaceAll(" ", "
");
+ document.querySelector("body > div > div.mt-3 > center > div > .red").innerHTML = String(document.querySelector("body > div > div.mt-3 > center > div > .red").innerHTML).replaceAll(" ", "
");
let StaticButton = document.createElement("button");
document.querySelectorAll("body > div > div.mt-3 > center > div > .red")[1].appendChild(StaticButton);
StaticButton.className = "btn btn-outline-secondary";
@@ -1791,15 +1775,9 @@ async function main() {
location.href = "https://www.xmoj.tech/conteststatistics.php?cid=" + SearchParams.get("cid");
});
- document.querySelector("#problemset > tbody").innerHTML =
- String(document.querySelector("#problemset > tbody").innerHTML).replaceAll(
- /\t ([0-9]*) 问题 ([^<]*)/g,
- "$2. $1");
+ document.querySelector("#problemset > tbody").innerHTML = String(document.querySelector("#problemset > tbody").innerHTML).replaceAll(/\t ([0-9]*) 问题 ([^<]*)/g, "$2. $1");
- document.querySelector("#problemset > tbody").innerHTML =
- String(document.querySelector("#problemset > tbody").innerHTML).replaceAll(
- /\t\*([0-9]*) 问题 ([^<]*)/g,
- "拓展$2. $1");
+ document.querySelector("#problemset > tbody").innerHTML = String(document.querySelector("#problemset > tbody").innerHTML).replaceAll(/\t\*([0-9]*) 问题 ([^<]*)/g, "拓展$2. $1");
if (UtilityEnabled("MoreSTD") && document.querySelector("#problemset > thead > tr").innerHTML.indexOf("标程") != -1) {
let Temp = document.querySelector("#problemset > thead > tr").children;
@@ -1831,10 +1809,8 @@ async function main() {
PID = PID.substring(2);
}
Temp[i].children[2].children[0].target = "_blank";
- localStorage.setItem("UserScript-Contest-" + SearchParams.get("cid") + "-Problem-" + i + "-PID",
- PID.substring(3));
- localStorage.setItem("UserScript-Problem-" + PID.substring(3) + "-Name",
- Temp[i].childNodes[2].innerText);
+ localStorage.setItem("UserScript-Contest-" + SearchParams.get("cid") + "-Problem-" + i + "-PID", PID.substring(3));
+ localStorage.setItem("UserScript-Problem-" + PID.substring(3) + "-Name", Temp[i].childNodes[2].innerText);
}
let CheatDiv = document.createElement("div");
CheatDiv.style.marginTop = "20px";
@@ -1902,10 +1878,7 @@ async function main() {
},
"referrer": "https://www.xmoj.tech/submitpage.php?id=" + PID,
"method": "POST",
- "body": "cid=" + CID + "&pid=" + i + "&" +
- "language=1&" +
- "source=" + encodeURIComponent(Code) + "&" +
- "enable_O2=on"
+ "body": "cid=" + CID + "&pid=" + i + "&" + "language=1&" + "source=" + encodeURIComponent(Code) + "&" + "enable_O2=on"
});
//sleep for one second
await new Promise(r => setTimeout(r, 500));
@@ -1915,8 +1888,7 @@ async function main() {
await new Promise(r => setTimeout(r, 1000));
}
AutoCheatButton.disabled = false;
- if (Submitted) location.reload();
- else AutoCheatButton.innerHTML = "自动提交当年代码";
+ if (Submitted) location.reload(); else AutoCheatButton.innerHTML = "自动提交当年代码";
});
}
@@ -1949,8 +1921,7 @@ async function main() {
if (UtilityEnabled("ResetType")) {
document.querySelector("#problemset > thead > tr > th:nth-child(1)").style.width = "5%";
}
- localStorage.setItem("UserScript-Contest-" + SearchParams.get("cid") + "-ProblemCount",
- document.querySelector("#problemset > tbody").rows.length);
+ localStorage.setItem("UserScript-Contest-" + SearchParams.get("cid") + "-ProblemCount", document.querySelector("#problemset > tbody").rows.length);
}
}
} else if (location.pathname == "/contestrank-oi.php") {
@@ -1961,10 +1932,7 @@ async function main() {
if (document.querySelector("body > div > div.mt-3 > center > h3").innerText == "比赛排名") {
document.querySelector("#rank").innerText = "比赛暂时还没有排名";
} else {
- document.querySelector("body > div > div.mt-3 > center > h3").innerText =
- document.querySelector("body > div > div.mt-3 > center > h3").innerText.substring(
- document.querySelector("body > div > div.mt-3 > center > h3").innerText.indexOf(" -- ") + 4)
- + "(OI排名)";
+ document.querySelector("body > div > div.mt-3 > center > h3").innerText = document.querySelector("body > div > div.mt-3 > center > h3").innerText.substring(document.querySelector("body > div > div.mt-3 > center > h3").innerText.indexOf(" -- ") + 4) + "(OI排名)";
document.querySelector("#rank > thead > tr > :nth-child(1)").innerText = "排名";
document.querySelector("#rank > thead > tr > :nth-child(2)").innerText = "用户";
document.querySelector("#rank > thead > tr > :nth-child(3)").innerText = "昵称";
@@ -2034,10 +2002,7 @@ async function main() {
}
} else if (UtilityEnabled("ACMRank")) {
if (document.querySelector("body > div > div.mt-3 > center > h3").innerText != "比赛排名") {
- document.querySelector("body > div > div.mt-3 > center > h3").innerText =
- document.querySelector("body > div > div.mt-3 > center > h3").innerText.substring(
- document.querySelector("body > div > div.mt-3 > center > h3").innerText.indexOf(" -- ") + 4)
- + "(ACM排名)";
+ document.querySelector("body > div > div.mt-3 > center > h3").innerText = document.querySelector("body > div > div.mt-3 > center > h3").innerText.substring(document.querySelector("body > div > div.mt-3 > center > h3").innerText.indexOf(" -- ") + 4) + "(ACM排名)";
}
let RankData = [];
let RefreshACMRank = async (ProblemCount) => {
@@ -2086,9 +2051,7 @@ async function main() {
});
if (CurrentProblem == null) {
CurrentProblem = {
- Index: CurrentSubmission.num,
- Attempts: [],
- SolveTime: 0
+ Index: CurrentSubmission.num, Attempts: [], SolveTime: 0
};
CurrentRow.Problem.push(CurrentProblem);
}
@@ -2098,16 +2061,14 @@ async function main() {
CurrentRow.Penalty += parseInt(CurrentSubmission.in_date) + CurrentProblem.Attempts.length * 20 * 60;
}
CurrentProblem.Attempts.push({
- Time: CurrentSubmission.in_date,
- Result: CurrentSubmission.result
+ Time: CurrentSubmission.in_date, Result: CurrentSubmission.result
});
}
for (let i = 0; i < RankData.length; i++) {
for (let j = 0; j < RankData[i].Problem.length; j++) {
for (let k = 0; k < RankData[i].Problem.length; k++) {
- if (j != k && RankData[i].Problem[j].SolveTime != 0 && RankData[i].Problem[k].SolveTime != 0 &&
- Math.abs(RankData[i].Problem[j].SolveTime - RankData[i].Problem[k].SolveTime) < 60) {
+ if (j != k && RankData[i].Problem[j].SolveTime != 0 && RankData[i].Problem[k].SolveTime != 0 && Math.abs(RankData[i].Problem[j].SolveTime - RankData[i].Problem[k].SolveTime) < 60) {
RankData[i].QuickSubmitCount++;
}
}
@@ -2366,9 +2327,7 @@ async function main() {
TidyTable(Table);
scrollTo({
- left: LastPositionX,
- top: LastPositionY,
- behavior: "instant"
+ left: LastPositionX, top: LastPositionY, behavior: "instant"
});
}
});
@@ -2403,10 +2362,7 @@ async function main() {
document.querySelector("#rank").innerText = "比赛暂时还没有排名";
} else {
if (UtilityEnabled("ResetType")) {
- document.querySelector("body > div > div.mt-3 > center > h3").innerText =
- document.querySelector("body > div > div.mt-3 > center > h3").innerText.substring(
- document.querySelector("body > div > div.mt-3 > center > h3").innerText.indexOf(" -- ") + 4)
- + "(订正排名)";
+ document.querySelector("body > div > div.mt-3 > center > h3").innerText = document.querySelector("body > div > div.mt-3 > center > h3").innerText.substring(document.querySelector("body > div > div.mt-3 > center > h3").innerText.indexOf(" -- ") + 4) + "(订正排名)";
document.querySelector("body > div > div.mt-3 > center > a").remove();
}
document.querySelector("#rank > thead > tr > :nth-child(1)").innerText = "排名";
@@ -2476,12 +2432,7 @@ async function main() {
}
}
} else if (location.pathname == "/submitpage.php") {
- document.querySelector("body > div > div.mt-3").innerHTML = `