Skip to content

Commit

Permalink
judge: pass full result to checkers
Browse files Browse the repository at this point in the history
  • Loading branch information
Riolku committed Mar 12, 2022
1 parent 9551b06 commit 587a3c7
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions dmoj/graders/standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def check_result(self, case, result):
binary_data=case.has_binary_data,
execution_time=result.execution_time,
problem_id=self.problem.id,
result=result,
)
except UnicodeDecodeError:
# Don't rely on problemsetters to do sane things when it comes to Unicode handling, so
Expand Down
9 changes: 9 additions & 0 deletions testsuite/check_memory_limit/checker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from dmoj.checkers import standard
from dmoj.result import Result


def check(process_output: bytes, judge_output: bytes, *, result: Result, **kwargs) -> bool:
if result.max_memory > 16384:
return False

return standard.check(process_output, judge_output, result=result, **kwargs)
4 changes: 4 additions & 0 deletions testsuite/check_memory_limit/init.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
checker: checker.py
points: 1
test_cases:
- {}
1 change: 1 addition & 0 deletions testsuite/check_memory_limit/tests/cpp_blank/empty.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
int main() {}
5 changes: 5 additions & 0 deletions testsuite/check_memory_limit/tests/cpp_blank/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: CPP11
time: 2
memory: 65536
source: empty.cpp
expect: AC
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma GCC optimize "O0"

const int MN = 25 * 1024 * 1024;
char arr[MN];
int main() {
for (int i = 0; i < MN; ++i)
arr[i] = ' ';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: CPP11
time: 2
memory: 65536
source: bloat.cpp
expect: WA

0 comments on commit 587a3c7

Please sign in to comment.