oioioi.acm.score

Module Contents

Classes

BinaryScore

Score representing binary grading: accepted or rejected.

ACMScore

ACM style score consisting of number of solved problems, total time

Functions

format_time(seconds)

oioioi.acm.score.format_time(seconds)[source]
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.

symbol = bool[source]
accepted = False[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.

__hash__()[source]

Return hash(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.

__unicode__()[source]

Returns string representing score, suitable to display to the user.

Must be overridden in all subclasses.

to_int()[source]
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 adding time_passed or penalties_count when problems_solved equals zero. That’s because ACM ICPC rules states that team doesn’t obtain any penalty for nonsolved problems.

property total_time[source]
symbol = ACM[source]
problems_solved = 0[source]
time_passed = 0[source]
penalties_count = 0[source]
penalty_time[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.

__hash__()[source]

Return hash(self).

__unicode__()[source]

Returns string representing score, suitable to display to the user.

Must be overridden in all subclasses.

csv_repr()[source]
penalty_repr()[source]
total_time_repr()[source]
time_passed_repr()[source]
classmethod _from_repr(value)[source]

Creates an instance based on data from _to_repr().

Must be overridden in all subclasses.

_to_repr()[source]

Store score as string "ACM:problems_solved:total_time:penalties_count" where:

problems_solved is number of problems solved,

total_time is total number of seconds needed to solve problems,

penalties_count is number of unsuccessful submissions.

to_int()[source]