Compare commits

..

No commits in common. "afda9290fa8b119b18068132930877b2ecb2150a" and "d627490c67a7e894a6d2c896696ec6f0fb2ffc05" have entirely different histories.

View File

@ -10,23 +10,23 @@ const logger = new Logger('remote/atcoder');
const LANGS_MAP = {
C: {
name: 'C (GCC 12.2.0)',
id: 5017,
name: 'C (GCC 9.2.1)',
id: 4001,
comment: '//',
},
'C++': {
name: 'C++ 20 (GCC 12.2.0)',
id: 5001,
name: 'C++ (GCC 9.2.1)',
id: 4003,
comment: '//',
},
Pascal: {
name: 'Pascal (FPC 3.2.2)',
id: 5041,
name: 'Pascal (FPC 3.0.4)',
id: 4041,
comment: '//',
},
Python3: {
name: 'Python (CPython 3.11.4)',
id: 5055,
name: 'Python (3.8.2)',
id: 4006,
comment: '#',
},
};
@ -193,8 +193,9 @@ export default class AtcoderProvider implements IBasicProvider {
}
const [contestId, problemId] = parseProblemId(id);
const referer = `/contests/${contestId}/tasks/${problemId}`;
const csrf = await this.getCsrfToken(referer);
const csrf = await this.getCsrfToken(
`/contests/${contestId}/tasks/${problemId}`
);
logger.debug(
'Submitting',
@ -207,14 +208,12 @@ export default class AtcoderProvider implements IBasicProvider {
await next({ status: 'Submitting to AtCoder...' });
// TODO: check submit time to ensure submission
const res = await this.post(`/contests/${contestId}/submit`)
.set('Referer', referer)
.send({
'data.TaskScreenName': problemId,
'data.LanguageId': programType.id,
sourceCode: code,
csrf_token: csrf,
});
const res = await this.post(`/contests/${contestId}/submit`).send({
csrf_token: csrf,
'data.TaskScreenName': problemId,
'data.LanguageId': programType.id,
sourceCode: code,
});
if (res.error) {
await end({
@ -234,9 +233,7 @@ export default class AtcoderProvider implements IBasicProvider {
const { text: status, header: status_header } = await this.get(
`/contests/${contestId}/submissions/me`
)
.set('Referer', referer)
.retry(3);
).retry(3);
if (status_header['set-cookie']) {
this.cookie = status_header['set-cookie'];