Skip to content

Commit

Permalink
Merge pull request #394 from kmyk/issue/391
Browse files Browse the repository at this point in the history
#391: fix a bug of `AtCoderContest.list_problems()`
  • Loading branch information
kmyk authored Mar 17, 2019
2 parents 5ae5618 + 899eeef commit c49f0c1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions onlinejudge/service/atcoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,16 @@ def __init__(self, contest_id: str, problem_id: str):
@classmethod
def _from_table_row(cls, tr: bs4.Tag) -> 'AtCoderProblem':
tds = tr.find_all('td')
assert len(tds) == 5
assert 4 <= len(tds) <= 5
path = tds[1].find('a')['href']
self = cls.from_url('https://atcoder.jp' + path)
assert self is not None
self._alphabet = tds[0].text
self._task_name = tds[1].text
self._time_limit_msec = int(float(utils.remove_suffix(tds[2].text, ' sec')) * 1000)
self._memory_limit_byte = int(utils.remove_suffix(tds[3].text, ' MB')) * 1000 * 1000 # TODO: confirm this is MB truly, not MiB
assert tds[4].text.strip() in ('', 'Submit')
if len(tds) == 5:
assert tds[4].text.strip() in ('', 'Submit', '提出')
return self

def download_sample_cases(self, session: Optional[requests.Session] = None) -> List[onlinejudge.type.TestCase]:
Expand Down

0 comments on commit c49f0c1

Please sign in to comment.