onlinejudge.service.atcoder module¶
the module for AtCoder (https://atcoder.jp/)
- note
There are some useful endpoints:
- note
There is an unofficial API https://github.com/kenkoooo/AtCoderProblems
- note
Some methods not inherited from classes
onlinejudge.typemay be modified in future, because the specification is not fixed yet.
-
class
onlinejudge.service.atcoder.AtCoderContest(*, contest_id)[source]¶ Bases:
onlinejudge.type.Contest- Variables
contest_id –
str
-
iterate_submission_data_where(*, me=False, problem_id=None, language_id=None, status=None, user_glob=None, order=None, desc=False, lang=None, pages=None, session=None)[source]¶ - Note
If you use certain combination of options, then the results may not correct when there are new submissions while crawling.
- Parameters
status (
Optional[str]) – must be one of AC, WA, TLE, MLE, RE, CLE, OLE, IE, WJ, WR, or Judgingorder (
Optional[str]) – must be one of created, score, source_length, time_consumption, or memory_consumptionme (
bool) – use the …/submissions/me page instead of …/submissionuser_glob (
Optional[str]) – is used as the value of f.User query parameterlanguage_id (
Optional[NewType()(LanguageId,str)]) – is used as the value of f.Language query parameterpages (
Optional[Iterator[int]]) – is an iterator to list the page numbers to GET
- Return type
-
iterate_submissions(*, session=None)[source]¶ - Note
in implementation, use “ORDER BY created DESC” to list all submissions even when there are new submissions
- Return type
-
class
onlinejudge.service.atcoder.AtCoderContestData(*, contest, duration, lang, name, rated_range, response, session, start_time, timestamp)[source]¶ Bases:
onlinejudge.type.ContestData- Variables
duration –
datetime.timedeltalang –
strrated_range –
strstart_time –
datetime.datetime
-
property
contest¶ - Return type
-
property
response¶ - Return type
Response
-
property
session¶ - Return type
Session
-
class
onlinejudge.service.atcoder.AtCoderContestDetailedData(*, can_participate, penalty, **kwargs)[source]¶ Bases:
onlinejudge.service.atcoder.AtCoderContestData- Variables
can_participate –
strpenalty –
datetime.timedelta
-
class
onlinejudge.service.atcoder.AtCoderProblem(*, contest_id, problem_id)[source]¶ Bases:
onlinejudge.type.Problem- Variables
- Note
AtCoder has problems independently from contests. Therefore the notions contest_id, alphabet, and url don’t belong to problems itself.
-
download_sample_cases(*, session=None)[source]¶ - Raises
requests.exceptions.HTTPError – if no such problem exists
SampleParseError – if parsing failed
- Return type
-
iterate_submissions(*, session=None)[source]¶ - Note
in implementation, use “ORDER BY created DESC” to list all submissions even when there are new submissions
- Return type
-
class
onlinejudge.service.atcoder.AtCoderProblemData(*, alphabet, memory_limit_byte, name, problem, response, session, time_limit_msec, timestamp, html=None)[source]¶ Bases:
onlinejudge.type.ProblemData- Note
AtCoderProblemDatais obtained the list page (e.g. https://atcoder.jp/contests/agc001/tasks )- Variables
-
property
name¶ for example of
Problem:器物損壊!高橋君
AtCoDeerくんと変なじゃんけん / AtCoDeer and Rock-Paper
Xor Sum
- Return type
-
property
problem¶ - Return type
-
class
onlinejudge.service.atcoder.AtCoderProblemDetailedData(*, available_languages, input_format, sample_cases, score, **kwargs)[source]¶ Bases:
onlinejudge.service.atcoder.AtCoderProblemData- Note
AtCoderProblemDetailedDatais obtained the problem page (e.g. https://atcoder.jp/contests/agc001/tasks/agc001_a )- Variables
available_languages –
Optional[List[Language] ]input_format –
Optional[str]sample_cases –
Optional[List[TestCase] ]
-
class
onlinejudge.service.atcoder.AtCoderService[source]¶ Bases:
onlinejudge.type.Service-
iterate_contest_data(*, lang='ja', session=None)[source]¶ - Parameters
lang (
str) – must be ja (default) or en.- Note
lang=ja is required to see some Japanese-local contests.
- Note
You can use lang=en to see the English names of contests.
- Return type
-
-
class
onlinejudge.service.atcoder.AtCoderSubmission(*, contest_id, submission_id)[source]¶ Bases:
onlinejudge.type.Submission-
download_data(*, session=None)[source]¶ - Note
Exec Time is undefined when the status is RE or TLE
- Note
Memory is undefined when the status is RE or TLE
- Return type
-
get_problem()[source]¶ - Raises
- Note
There is no way to reconstruct problem_id without networking
- Return type
-
-
class
onlinejudge.service.atcoder.AtCoderSubmissionData(*, code_size, exec_time_msec, language_name, memory_byte, problem, problem_id, response, score, session, status, submission, submission_time, timestamp, user_id)[source]¶ Bases:
onlinejudge.type.SubmissionData- Variables
-
property
problem¶ - Return type
-
property
submission¶ - Return type
-
class
onlinejudge.service.atcoder.AtCoderSubmissionDetailedData(*, source_code, compile_error, test_sets, test_cases, **kwargs)[source]¶