-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypings.py
39 lines (33 loc) · 1.02 KB
/
typings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from __future__ import annotations
from dataclasses import dataclass
from typing import Any
@dataclass
class ElanProblem:
problem_id: int
problem_short_name: str
time_limit: int # milliseconds
memory_limit: int # bytes
variants: dict[str, ElanProblemLocalized]
@dataclass
class ElanProblemLocalized:
problem_id: int
problem_short_name: str
name: str
statements: ElanProblemStatements
@dataclass
class ElanProblemStatements:
input: str # path to input.mdx
output: str # path to output.mdx
tests: list[ElanProblemExampleTest]
name: str | None = None # path to name.mdx
legend: str | None = None # path to legend.mdx
scoring: str | None = None # path to scoring.mdx
notes: str | None = None # path to notes.mdx
tutorial: str | None = None # path to tutorial.mdx
@dataclass
class ElanProblemExampleTest:
input: str
output: str
class InvalidProblem(Exception):
def __call__(self, *args: Any, **kwds: Any) -> Any:
return super().__call__(*args, **kwds)