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