Skip to content

Commit

Permalink
yet another limit
Browse files Browse the repository at this point in the history
  • Loading branch information
mzuenni committed Jan 24, 2025
1 parent edec146 commit bdbdb21
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
16 changes: 8 additions & 8 deletions bin/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ def _read_settings(self):
'time_multiplier': 2,
'time_safety_margin': 1.5,
'time_resolution': 1.0,
'memory': 2048,
# 'output': 8MiB,
# 'code': 128KiB,
# 'compilation_time': 60s,
# 'compilation_memory': 2048MiB,
'validation_time': 60,
'validation_memory': 2048,
# 'validation_output': 8MiB,
'memory': 2048, # in MiB
# 'output': 8, # in MiB
'code': 128, # in KiB
# 'compilation_time': 60, # in seconds
# 'compilation_memory': 2048, # in MiB
'validation_time': 60, # in seconds
'validation_memory': 2048, # in MiB
# 'validation_output': 8, # in MiB
}

yaml_path = self.path / 'problem.yaml'
Expand Down
8 changes: 8 additions & 0 deletions bin/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,14 @@ def __init__(self, problem, path, skip_double_build_warning=False):
self.expected_verdicts += wrong_verdicts
break

def build(self, bar: ProgressBar):
ok = super().build(bar)
if ok:
size = sum(f.stat().st_size for f in self.source_files)
if size > self.problem.limits.code * 1024:
bar.warn(f'Code limit exceeded ({size // 1024}KiB)')
return ok

def _get_expected_verdicts(self) -> list[Verdict]:
expected_verdicts = []

Expand Down

0 comments on commit bdbdb21

Please sign in to comment.