-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Change format of `sinol_expected_scores` * Fix tests * Add icpc contest type * Add test for version change * Add icpc package * Add icpc package * Refactor * Add unit tests for icpc contest type * Refactor * Add description of `sinol_contest_type: icpc` * Update examples/config.yml Co-authored-by: Tomasz Nowak <[email protected]> * Lower version * Remove printing of expected scores * Fix tests --------- Co-authored-by: Tomasz Nowak <[email protected]>
- Loading branch information
1 parent
11900e8
commit 25fe31e
Showing
38 changed files
with
617 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from typing import List, Dict | ||
|
||
from sinol_make.structs.status_structs import ExecutionResult | ||
from sinol_make.contest_types import DefaultContest | ||
from sinol_make.structs.status_structs import Status | ||
|
||
|
||
class ICPCContest(DefaultContest): | ||
""" | ||
Contest type for ACM ICPC type contest. | ||
The possible score for one solution is 1 or 0. | ||
The score is 0 if any of the tests fail. | ||
""" | ||
|
||
def assign_scores(self, groups: List[int]) -> Dict[int, int]: | ||
return {group: 1 for group in groups} | ||
|
||
def get_possible_score(self, groups: List[int], scores: Dict[int, int]) -> int: | ||
return 1 | ||
|
||
def get_test_score(self, result: ExecutionResult, time_limit, memory_limit): | ||
if result.Status == Status.OK: | ||
return 1 | ||
else: | ||
return 0 | ||
|
||
def get_group_score(self, test_scores, group_max_score): | ||
return min(test_scores) | ||
|
||
def get_global_score(self, groups_scores: Dict[int, Dict], global_max_score): | ||
return min(group["points"] for group in groups_scores.values()) |
Oops, something went wrong.