|
1 | 1 | # Python Standard Library Imports
|
2 | 2 | import copy
|
3 | 3 | import heapq
|
4 |
| -import math |
5 |
| -import re |
6 |
| -import typing as T |
7 |
| -from collections import defaultdict |
8 |
| -from dataclasses import dataclass |
9 | 4 |
|
10 | 5 | from utils import (
|
11 | 6 | BaseSolution,
|
12 |
| - InputConfig, |
| 7 | + config, |
| 8 | + main, |
| 9 | + solution, |
13 | 10 | )
|
14 | 11 |
|
15 | 12 |
|
16 |
| -PROBLEM_NUM = '01' |
17 |
| - |
18 |
| -TEST_MODE = False |
19 |
| -# TEST_MODE = True |
20 |
| - |
21 |
| -EXPECTED_ANSWERS = (69912, 208180) |
22 |
| -TEST_VARIANT = '' # '', 'b', 'c', 'd', ... |
23 |
| -TEST_EXPECTED_ANSWERS = { |
| 13 | +config.EXPECTED_ANSWERS = (69912, 208180) |
| 14 | +config.TEST_CASES = { |
24 | 15 | '': (24000, 45000),
|
25 |
| - 'b': (None, None), |
26 |
| - 'c': (None, None), |
27 | 16 | }
|
28 | 17 |
|
29 |
| -DEBUGGING = False |
30 |
| -DEBUGGING = True |
31 |
| - |
32 |
| - |
33 |
| -def debug(s): |
34 |
| - if DEBUGGING: |
35 |
| - print(s) |
36 |
| - else: |
37 |
| - pass |
38 |
| - |
39 |
| - |
40 |
| -def main(): |
41 |
| - input_config = InputConfig( |
42 |
| - as_integers=False, |
43 |
| - as_comma_separated_integers=False, |
44 |
| - as_json=False, |
45 |
| - as_groups=True, |
46 |
| - as_oneline=False, |
47 |
| - as_coordinates=False, |
48 |
| - coordinate_delimeter=None, |
49 |
| - as_table=False, |
50 |
| - row_func=None, |
51 |
| - cell_func=None, |
52 |
| - ) |
53 |
| - |
54 |
| - if TEST_MODE: |
55 |
| - input_filename = f'{PROBLEM_NUM}{TEST_VARIANT}.test.in' |
56 |
| - expected_answers = TEST_EXPECTED_ANSWERS[TEST_VARIANT] |
57 |
| - else: |
58 |
| - input_filename = f'{PROBLEM_NUM}.in' |
59 |
| - expected_answers = EXPECTED_ANSWERS |
60 |
| - |
61 |
| - solution = Solution(input_filename, input_config, expected_answers) |
62 |
| - |
63 |
| - solution.solve() |
64 |
| - solution.report() |
| 18 | +config.INPUT_CONFIG.as_integers = False |
| 19 | +config.INPUT_CONFIG.as_comma_separated_integers = False |
| 20 | +config.INPUT_CONFIG.as_json = False |
| 21 | +config.INPUT_CONFIG.as_groups = True |
| 22 | +config.INPUT_CONFIG.strip_lines = True |
| 23 | +config.INPUT_CONFIG.as_oneline = False |
| 24 | +config.INPUT_CONFIG.as_coordinates = False |
| 25 | +config.INPUT_CONFIG.coordinate_delimeter = None |
| 26 | +config.INPUT_CONFIG.as_table = False |
| 27 | +config.INPUT_CONFIG.row_func = None |
| 28 | +config.INPUT_CONFIG.cell_func = None |
65 | 29 |
|
66 | 30 |
|
| 31 | +@solution |
67 | 32 | class Solution(BaseSolution):
|
68 | 33 | def process_data(self):
|
69 | 34 | data = self.data
|
|
0 commit comments