vjudge: codeforces: ignore 1510G

pull/162/head
undefined 3 years ago
parent df5682333c
commit 43b248009f

@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/vjudge", "name": "@hydrooj/vjudge",
"version": "1.0.2", "version": "1.0.3",
"description": "Submit problems to remote oj", "description": "Submit problems to remote oj",
"main": "package.json", "main": "package.json",
"repository": "https://github.com/hydro-dev/Hydro.git", "repository": "https://github.com/hydro-dev/Hydro.git",

@ -39,6 +39,7 @@ class Service {
for (const pid of pids) { for (const pid of pids) {
if (await ProblemModel.get(domainId, pid)) continue; if (await ProblemModel.get(domainId, pid)) continue;
const res = await this.api.getProblem(pid); const res = await this.api.getProblem(pid);
if (!res) continue;
const id = await ProblemModel.add(domainId, pid, res.title, res.content, 1, res.tag, false); const id = await ProblemModel.add(domainId, pid, res.title, res.content, 1, res.tag, false);
for (const key in res.files) { for (const key in res.files) {
await ProblemModel.addAdditionalFile(domainId, id, key, res.files[key]); await ProblemModel.addAdditionalFile(domainId, id, key, res.files[key]);

@ -99,6 +99,7 @@ export default class CodeforcesProvider implements IBasicProvider {
logger.info(id); logger.info(id);
const [, contestId, problemId] = /^P(\d+)([A-Z][0-9]?)$/.exec(id); const [, contestId, problemId] = /^P(\d+)([A-Z][0-9]?)$/.exec(id);
const res = await this.get(`/problemset/problem/${contestId}/${problemId}`); const res = await this.get(`/problemset/problem/${contestId}/${problemId}`);
if (!res.text) return null;
const $dom = new JSDOM(res.text.replace(/\$\$\$/g, '$')); const $dom = new JSDOM(res.text.replace(/\$\$\$/g, '$'));
const tag = Array.from($dom.window.document.querySelectorAll('.tag-box')).map((i) => i.textContent.trim()); const tag = Array.from($dom.window.document.querySelectorAll('.tag-box')).map((i) => i.textContent.trim());
const text = $dom.window.document.querySelector('.problem-statement').innerHTML; const text = $dom.window.document.querySelector('.problem-statement').innerHTML;
@ -113,7 +114,7 @@ export default class CodeforcesProvider implements IBasicProvider {
files[`${fid}.png`] = file; files[`${fid}.png`] = file;
ele.setAttribute('src', `%file%://${fid}.png`); ele.setAttribute('src', `%file%://${fid}.png`);
}); });
const title = document.querySelector('.title').innerHTML.trim().substr(3, 100); const title = document.querySelector('.title').innerHTML.trim().split('. ')[1];
const time = parseInt(document.querySelector('.time-limit').innerHTML.substr(53, 2), 10); const time = parseInt(document.querySelector('.time-limit').innerHTML.substr(53, 2), 10);
const memory = parseInt(document.querySelector('.memory-limit').innerHTML.substr(55, 4), 10); const memory = parseInt(document.querySelector('.memory-limit').innerHTML.substr(55, 4), 10);
document.body.firstChild.remove(); document.body.firstChild.remove();

Loading…
Cancel
Save