oioioi.acm.score
¶
Module Contents¶
Classes¶
Score representing binary grading: accepted or rejected. |
|
ACM style score consisting of number of solved problems, total time |
Functions¶
|
- class oioioi.acm.score.BinaryScore(solved=False)[source]¶
Bases:
oioioi.contests.scores.ScoreValue
Score representing binary grading: accepted or rejected.
Sum of binary scores is accepted only when every single score were accepted.
- __add__(other)[source]¶
Implementation of operator
+
.Used for example when creating user result for round based on scores from all problems of the round.
Must be overridden in all subclasses.
- __eq__(other)[source]¶
Implementation of operator
==
. Used to produce ranking, being greater means better result.Must be overridden in all subclasses.
- __lt__(other)[source]¶
Implementation of operator
<
. Used to produce ranking, being greater means better result.Must be overridden in all subclasses.
- classmethod _from_repr(value)[source]¶
Creates an instance based on data from
_to_repr()
.Must be overridden in all subclasses.
- _to_repr()[source]¶
Returns score data serialized to string, without the class’s symbol.
Must be overridden in all subclasses.
Lexicographical order of serialized data has to correspond to the given by
__eq__()
and__lt__()
, it will be used for sorting at db level.
- class oioioi.acm.score.ACMScore(problems_solved=0, time_passed=0, penalties_count=0)[source]¶
Bases:
oioioi.contests.scores.ScoreValue
ACM style score consisting of number of solved problems, total time needed for solving problems and time penalty for each unsuccessful submission.
NOTE: When adding
ACMScore`s only scores with positive :attr:`problems_solved
are considered to avoid addingtime_passed
orpenalties_count
whenproblems_solved
equals zero. That’s because ACM ICPC rules states that team doesn’t obtain any penalty for nonsolved problems.- __add__(other)[source]¶
Implementation of operator
+
.Used for example when creating user result for round based on scores from all problems of the round.
Must be overridden in all subclasses.
- __eq__(other)[source]¶
Implementation of operator
==
. Used to produce ranking, being greater means better result.Must be overridden in all subclasses.
- __lt__(other)[source]¶
Implementation of operator
<
. Used to produce ranking, being greater means better result.Must be overridden in all subclasses.
- __unicode__()[source]¶
Returns string representing score, suitable to display to the user.
Must be overridden in all subclasses.
- classmethod _from_repr(value)[source]¶
Creates an instance based on data from
_to_repr()
.Must be overridden in all subclasses.