oioioi.pa.score

Module Contents

Classes

ScoreDistribution

PAScore

PA style score.

class oioioi.pa.score.ScoreDistribution(scores=None)[source]

Bases: object

__add__(other)[source]
__eq__(other)[source]

Return self==value.

__lt__(other)[source]

Return self<value.

update(score)[source]
__repr__()[source]

Return repr(self).

_to_repr()[source]
classmethod _from_repr(value)[source]
class oioioi.pa.score.PAScore(points=None, distribution=None)[source]

Bases: oioioi.contests.scores.ScoreValue

PA style score.

It consists of a number of points scored, together with their distribution. When two users get the same number of points, then the number of tasks for which they got 10pts (maximal score) is taken into consideration. If this still does not break the tie, number of 9 point scores is considered, then 8 point scores etc.

symbol = PA[source]
__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.

__repr__()[source]

Return repr(self).

__str__()[source]

Return str(self).

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.

to_int()[source]