Compare commits
8 commits
72d0bbea61
...
23382011e6
| Author | SHA1 | Date | |
|---|---|---|---|
| 23382011e6 | |||
| 3c5735cfb2 | |||
| d3b224688a | |||
| 22d38c2de2 | |||
| db802844bd | |||
| 5becead2c8 | |||
| a41265e6a4 | |||
| 65846ddac7 |
8 changed files with 2807 additions and 0 deletions
43
2025/d04/ex1/ex1.py
Executable file
43
2025/d04/ex1/ex1.py
Executable file
|
|
@ -0,0 +1,43 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import itertools
|
||||
import sys
|
||||
from typing import NamedTuple
|
||||
|
||||
|
||||
class Point(NamedTuple):
|
||||
x: int
|
||||
y: int
|
||||
|
||||
|
||||
def solve(input: list[str]) -> int:
|
||||
def parse(input: list[str]) -> set[Point]:
|
||||
return {
|
||||
Point(x, y)
|
||||
for x, line in enumerate(input)
|
||||
for y, c in enumerate(line)
|
||||
if c == "@"
|
||||
}
|
||||
|
||||
def is_accessible(point: Point, rolls: set[Point]) -> bool:
|
||||
assert point in rolls # Sanity check
|
||||
return (
|
||||
sum(
|
||||
Point(point.x + dx, point.y + dy) in rolls
|
||||
for dx, dy in itertools.product(range(-1, 1 + 1), repeat=2)
|
||||
if dx != 0 or dy != 0
|
||||
)
|
||||
< 4
|
||||
)
|
||||
|
||||
rolls = parse(input)
|
||||
return sum(is_accessible(p, rolls) for p in rolls)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
input = sys.stdin.read().splitlines()
|
||||
print(solve(input))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
137
2025/d04/ex1/input
Normal file
137
2025/d04/ex1/input
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
@@@@@.@@@@@@@.@.@@@.@@@..@@@@@@...@...@@...@@@@@@@@.@@@@@@@@@@@@@@@@@...@@@..@@@.....@..@@@@@.@@@@...@@@@@@@@@@@@.@@@@@@.@..@@@@@..@.@@..
|
||||
...@@@.@@@..@@@@..@.@..@@....@@.@@@.@...@.@@@...@@.@@@..@@@.@@@..@.@@.@.@.@@..@@@@@..@@@@.@@@@.@@.@@@@..@@.@@.@@.@@@@.@@.@@@@@@@@.@.@..@@
|
||||
@@.@@@@@@..@@..@@@@@@.@@@@@.@..@@@@@@@.@.@@.@..@..@@@@.@@.@@@..@@.@@.@@.@.@@@.@@@.@@@@@@@@.@.@@@@..@@@..@@@.@.@.@@@@.@@@@@@@@@@..@...@@.@
|
||||
.@@@@.@@.@@@.@@@@@@@@@..@.@@@.@@@.@@@@@@.@@@@.@...@@@..@@....@@@@.@.@.@@...@.@@@..@@@.@@@@@@@@@@@......@.@@@@.@@@@@@.@..@@@@.@.@.@.@@@@@.
|
||||
@@@@@@@.@@..@@@@@@.@@@@@.@@@..@.@@@@.@@@@@..@@@@@@@@@@@@.@@@.@@@.@@@.@@@.@.@.@@.@..@@..@@@@..@.@@.@.@@......@@@.@.@.@@...@@@@@.@@@@@@@.@.
|
||||
.@...@..@@@..@@@@@@@@.@.@.@.@.@@.@.@.@@.@.@@...@..@.@.@@@.@@@..@@@@@@.@@@@..@@.@.@@.@..@.@@@@@.@@.@..@@@@..@@@@@.@@@@@.@.@@.@@@..@...@@.@
|
||||
.@.@@.@..@.@.@.@@@@@.@.@@@@.@.@@@@..@@..@..@.@@@.@@@.@@@.@.@@@.@..@@@@@@@@@.@@@@@@.@@@@@@..@.@@@@...@.@@@@@@.@.@@@@@@@@@@@@@@@.@@..@@@@@.
|
||||
@@@...@.@@@.@@@@@@.@@@@..@@..@@.@.@@.@..@@.@...@@@.@@@.@@@.@.@@@@..@@@@.@@.@@@.@@@.@.@..@@.@@..@@@@@@@....@@@@@@@@@@@.@..@@.@.@@@@@.@@@..
|
||||
@@@.@@.@@...@@@@@@@@@@@.@...@.@...@@@@...@@@@@@@.@@....@.@@.@..@@.@.@.@.@...@@.@....@@..@..@.@@@@@..@@@@.@@@@@@..@@.@@.@..@@@@@@@@@.@@.@@
|
||||
@@...@@@@@@.@.....@@@.@@@@@@..@.@.@.@@@.@..@@@@@@.@@@@@@@@.@@@@@.@@.@.@..@...@....@@@.@@@..@@@@@@@@...@..@@@@@@.@@@@@@.@@@..@@@@@@..@.@@.
|
||||
@@...@@..@@@@@...@@@@@.@..@.@..@@.@.@...@.@@@@@@@@@@.@...@@..@@@.@@@@..@@..@...@@@...@...@.@.@.@@..@@@.@@.@@@@@@@@.@@@@@@@@...@.@.@@.@@@@
|
||||
.@@...@@.@.@@.@@@.@.@@@..@@@@@@.@.@@..@@...@@.@..@@..@.@@@.@@@@@@@@.@@.@@.@@@@@@@..@@@.@@..@@@@.@.@.@.@@@@.@@.@.@@@@@@@@..@@@@.@@@@..@.@@
|
||||
@.@.@@@@@.@..@@.@@....@.@@.@@@@@@@@@@.@.@@@.......@@@@.@@..@@.@@.@@@.@@@@@@@@.@.@.@.@@@.@@@@..@....@.@@@@....@...@.@@.@@@@..@......@@..@.
|
||||
@....@@@@@@@@@@@@@@@@@@.@...@@.@@.@@@@@@@@.@.@@@@@@@.@@@@@@.@@@@@@..@..@@..@....@..@@@@..@@@..@@@@.@.@@@.@.@....@@.@@...@@.@.@.@@@@.@@@.@
|
||||
@.@@@@@.@@@@..@@..@@@@...@@.@@@@@..@@.@@@@@@@@@@.@@@@@@@.@..@.@@.@@..@@@@.@@@@.@@@.@.@..@@@.@..@@@.@.@@@.@@.@@.@@..@@@@@.@..@@@@@@@@@@@@.
|
||||
@@@@.@@@@@.@@.@@@@@.@@@.@@@.@@..@@@@.@@@..@.@.@@@@...@@.@@@.@@.@.@@@@@@.@.@@@@@@@..@@@@@@..@@@.....@.@.@@@@@....@.@@..@.@@..@@@@@@.@@@@..
|
||||
@.@@.@@@@.@@@@@.@@.@@@@@.@...@@@.@@@@.@.@.@@@@@.@.@@.@@@@...@...@..@.@.@@@.@@@@@.@@@@.@.@@@.@@@@@@.@@@.@.@@@.@@@@..@@@.@@.@@@@@@@.@@@@@@@
|
||||
...@.@@.@@@@.@@.@@@.@@@.@..@..@@..@@@.@@@.@.@.@.@@@..@.@@@@.@@.@@@@@@@@@..@@.@@@@@..@@@@..@@..@.@@.@@.@@.@@@..@.@@@@.@@@@@..@@.@@.@@@@.@@
|
||||
.@@@....@...@@@@.@.@.@.@@@..@..@@@@@.@@@..@.@@.@@@@@@.@@@@@@@@@@@..@.@@...@@.@..@....@.@@.@@@..@..@@@@@.@.@.@.@.....@@.@@.@@@@.@.@@@@@@@.
|
||||
.@@.@.@..@@.@..@..@@@.@@@@@@.@@@@@@.@.@.@@.@@@.@..@..@@..@@.....@@@....@@@@@..@@@@@@....@@@...@@.@...@@@.@@@@.@.@@@@.@@@@@.@.@@..@.@@@.@.
|
||||
.@@@@.@@.@.@......@@@@@@@.@@.@@..@@@@.@@.@@@@@@..@@@.@@@..@@..@.@@@@@..@......@..@.@.@..@@.@@@.@.@@@.@@@.@@@..@@@@@@..@@@@@@...@@@@@@@.@@
|
||||
..@@.@@..@@@..@...@@.@@@@...@@@.@@@@.@@@..@@@.@@@.@@@@.@.@...@@@@@.@@...@@.@@@.@@@@.@@@@@..@.@@@@@@@@@@@..@@@@@@..@@@.@@.@.@.@@@@..@..@@@
|
||||
.@@@@.@..@.@@@..@@.@..@.@@@.@@.@@.@.@..@@.@..@@.@.@@..@@@@...@.@@@..@.@.@.@@@.@@.@@.@@@..@@@@@@@@@@@@.@@.@@@@.@@.@@@@@.@@.@..@@....@@@@..
|
||||
@..@@.@@@@@.@@@@.@.@@@@@...@@@@..@@@@@.@.@@@..@@@@....@@@@.@@..@@@.@.@@.@@@@@@@@@.@..@..@@.@@@.@@@.@@..@.@@.@@..@@..@@@@@.@..@@.@@@@@@.@.
|
||||
@@@@@@@@....@.@.@@@.@....@@@..@.@....@@@...@@.@.@@...@@...@.@.@@@@@@....@@@@.@@..@@@@@@.@@@@..@.@@@@@@@@@.@@.@@@.@.@@@..@.@@..@@@@..@@.@@
|
||||
@...@@@@@@@@.@@@@@@@..@.@.@@@@@...@@.@..@.@@@@...@@@...@@@@@@@@@@@.@@@@.@@@@@@.@@.@@@@@@@.@@@.@.@@.@@.@@@@@@.@..@@@.@.@.@...@@@........@.
|
||||
@@@.@@.@.@.@@.@@@@..@@.@@.@@@..@@@...@@@@..@.@@@@.@.@.@.@@@.@@@@.@@...@@@@@.@.@@.@.@@@.@.@@.@@@.@@@.@@.@@@@.@...@..@@@.....@@@.@@@.@@.@.@
|
||||
@.@.@@..@@.@@@@@@.@@@@@@@@.@..@@@@..@@.@@..@@@@@@..@...@@.@@.@.@.@.@@@@..@..@..@@@.@..@..@@@@@.@.@.@@@@@.@@@@@.@.@@..@@@@@.@@@..@@@@@.@.@
|
||||
@@..@@@.@..@..@@..@@@@.@@@@.@.@@@..@.@@..@@@.@.@@..@.@@.@@@.@.@@@@.@..@@..@@@..@@@..@@@...@@.@@@@..@@@@@@@@.@@..@...@@@..@@@.@.@@.@@...@@
|
||||
@...@@@.....@@@@@.@.@.@@..@@....@@@@@.@@@..@.@@@@@@@@.@@@.@@@.@@@@@.@.@.@@.@@.@.@..@..@@.@.@@@@@@@@.@@.@@@@..@@@@.@@@@...@...@@@@@..@@@@@
|
||||
@@@.@.@@...@.@.@.@@@@@@@....@@@@@@@.@@@@.@@.@@.@.@...@..@@.@.@@@@@@@@@@@.@.@.@@@@@@.@....@@@.@@@@@@@@@@..@@@.@@.@@..@.@@.@.@..@.@@@@@@@@.
|
||||
.@....@@@.@.@@@@@.@..@.@@@.....@.@@@.@.@.@@@.@@@.@..@...@.@.@@@@@@.@@.@.@..@.@@..@@@@.@@@.@@@@@..@..@@@@@..@@@@@.@..@@.@@@@......@@@.@@.@
|
||||
@.@...@@@@@@@.@..@....@@@@..@@..@@@@.@.@@@@@@@@@.@.@.@.@@.@@@.@..@@@@@@...@@..@@@.@.@@@@.@@@@..@@.@.@...@..@..@.@@@...@@@@@@.@..@@@@@@...
|
||||
@@@@@..@..@.@.@@.@@@@@.@@@..@.@@@..@@..@@.@@.@@@@.@@.@...@@@..@.@@@.@@@.@@@@@@@@@.@@.@@.@@@@..@@@@@..@@@@@..@..@@.@@@@@@@..@@.@@.@@..@.@.
|
||||
@@@@@..@@@@@.@@@@@.@@@@@@@.@@@@@@@@@@@.@.@@@@@.@.@@@....@@@@.@.@..@.@@..@.@..@@.@@@..@@@@@.@@@.@.@.@@@@.@@@.@@@@...@.@@@.@.@@.@@.@.@...@@
|
||||
@@@.@.@@.@@@@@.@.@.@...@@@.@@@..@@@@@@@@@.@@@@@@@@@@@@@@@@...@..@..@.@@.@..@@.@@@...@..@.@@.@@@@.@@@@@..@.@@@.@@@..@@@..@@.@@.@@@..@..@@@
|
||||
.@@@.@.@@@@@@.@@.@@.@@...@.@.@@@@...@.@.@@...@@.@@..@.@.@@....@@@.@..@@.@@@.@.@..@..@@@@@.@@..@....@@@@@@.@@@@@.@@@@@@.@@..@@@@@..@@@.@@@
|
||||
..@.@@@@.@@@..@@@@.@@@.@@@..@@@.@..@@@@@@.@@..@..@@.@@..@.@@.@@@@@@.@@@.@...@@@@.@..@.@@@.@@.@@.@..@@@.@..@.@@.@..@@@@@.@.@@.@@@@@@@.@@..
|
||||
@@@@.@@@@@..@..@@@.@..@@@@@.@@@.@@@@..@.@@.@@@@.@@@@@.@.@.@@@@@.@@@@..@@.@@..@@@..@@..@@@@@@.@.@.@...@..@@.@.@@.@..@@@@@@.@..@@.@.@@@@@..
|
||||
@@@.@@@@@.@@@.@@@@@@@@@@@@@@@@..@@..@@..@@@@@@@@..@@@.@@@@...@..@.@@@@@.@.@@...@.@..@.@@@@@@.@@@@..@...@@@.@.@..@@@@.@@@@@@@@@@.@@.@@.@@@
|
||||
@.@@@@.@.....@@@@@.@@......@@@.@@...@.@@@@@.@.@@@@..@...@..@@..@@.@.@@..@..@..@.@@@.@@@@@@.@@@.@@@.@@..@.@@.@.@@....@.@..@...@@.@.@@@@@.@
|
||||
@@@@.@@@@@@..@@.@.@@.@@.@....@@@...@.@@@@@.@..@@@.@@@@@@@@@@@@@@.@.@@@.@.@@@.@.@@.@@.@@@@..@@@@.@@..@@@..@...@..@@.@@@@@@@@.@@@@@.@@@@@@.
|
||||
.@@...@.@....@@@@..@@.@@@@@@..@@@@@.@@@@@@@...@....@@@@@.@@.@@.@..@@@@@@.@...@@@@.@@@.@@@@..@@.@.@.@.@@@.@..@@@...@@@@@@.@@@@..@...@@..@@
|
||||
.@...@@@@..@@@@@..@@@..@@@@@@@.@.@@..@..@@.@..@@@@@.@.@@.@..@@@@@..@...@@.@@@.@@.@@@@@@..@....@...@@@@@@@.@@@@@.@@@@@@.@......@@.@.@..@..
|
||||
@.@@.@.@@@@@@.@.@@@.@@...@.@..@@@@@.@@@.@.@@..@.@.@@@.@@.@@@@@@.@@@@@@..@@.@..@.@...@@.@@@@@.@@@@.@@.@@@@@..@@.@@@@@@@@@..@@@@.@@.@@@@@@.
|
||||
@@.@.@.@@@.@@@.@@@...@@@@@@.@.@@@@@.@@@@@.@..@@.@..@.@@.@@@.@@@@..@@@@...@..@@@..@@@@@.@@@@@@@.@...@@.@@.@@@@..@@@@....@@@.@.@.@@.@@..@@@
|
||||
.@.@@@@.@.@..@@@@.@@@@..@@@@@.@@.@...@@@@.@.@.@@@@.@.@@@.@@..@@.@@.@.@.@..@..@@@@@.@.@..@@@@.@@..@.@@.@..@.@@.@@@@@@@@@@@@@@@@@@..@@@@@@.
|
||||
@@@@@.@@.@@@@.@@@@@.@.@@@@.@..@@@@@.@@@.@@...@@.@@..@@@@.@@@@@.@@@.@@.@.@@@@@@.@@@.@@@@@.@@@@.@.@@@@@..@.@@@@@@@..@@...@@@.@...@@@...@..@
|
||||
@@@@@....@.@..@@@.@@@.@..@..@...@.@@.@@@@@@@.@@@@.@@@.@@@@@@...@@@@.@@.@..@@@@.....@@@.@.@@@...@@@.@@.@@@.@..@..@@@@.@@..@@...@@@....@@@.
|
||||
.@@@@@@@..@.@.@.@..@@@@@@@@@@.@@@@.@@@@@@@.@@@@@..@@@..@..@@..@@..@@@@@@..@@@.@@@@.@@...@..@.@.@@@@@@@@@@.@@@@.@@@@@.@@@@..@@..@@@@@@@@..
|
||||
@@@.....@@.@@@@@@..@@@...@@@@.@@..@@@@@@...@@@@@@..@.@@@@.@@@@.@@.@@..@@@@..@..@.@@.@...@@@@...@..@@@.@@.....@@@@@@@@@.@@@@.@.@@@@@.@@@@.
|
||||
@@@@..@@@@@@@@@..@@@@.@@@@@@@@.@@@@@@@@.@@@@@@@@@.@@.@.@@@.@@@.@@.@.@....@@@@.@...@.@@@.@.@.@.@@.@@@@.@@@@@@@@@@@@@.@.@@@.@@@@.@@@.@@@@..
|
||||
.@@@.@.@@..@@.@@@@..@@@@@..@.@.....@.@....@@@@@@@@.@.@@@@.@...@..@....@@@@@.@@@@@@.@.@@@.@....@@@@@@@@@.@.@@.@@@@@@.@@.@...@..@@@@@@@..@.
|
||||
@@@....@@.@@@@@@@@.@@@@.@@@@@@..@@.@@@@..@.@.@@@@@@...@@@.@@.@..@.@.@.@.@@.@.@@@@@.@@@@@...@.@.@@.@@@@@@@@.@@@..@@@.@.@@.@@@@@@@@@.@@@@@@
|
||||
.@@..@@.@..@@..@@.@@@@@@....@.@@@.@@.@@@@@@@.@...@@@@@@@@.@@@@@@.@@@@@@@@@...@@...@@@@.@.@@.@.@@...@@@@@@@@@@...@@@@.@@@@@@..@@@@@.@.@@..
|
||||
@.@@@..@...@@.@@@@@.@@@.@....@@@@@@..@@.@@@@@@@@@@.@@@.....@.@@@@@@@.@.@...@@@.@....@@@@@@@@@@.@@@@.@@.@@@.@.@.....@.@.@.@@@.@@@.@.@@@@@@
|
||||
@@.@.@@@...@@@@@@.@@...@.@.@.@@@@@@@@@@@@@@...@@@@@@@@@@.@.@@@..@.@@.@@@@@@@@@@@@.@.@.@@.@..@@@@@@@@@@..@.@@@@@.@@.@.@.@.@.@@@..@@.@@@@@.
|
||||
@@..@@.@@@.@@@@@@..@@@.@.@@.@@@.@.@@.@.@@@@@..@@@.@@@.@@.@@@.@@@@...@@@@@.@.@@@.@@@@@..@@@@.@@@@@@@@@.@@@@.@@..@@@@@.@@.@@@..@.@@@@@@@..@
|
||||
@@@@@@@@@@@@@@@.@@.@@@@.@.@.@@@...@@.@@@.@...@@@@@.@.@@.@@@@.@.@@@.@@.@.@@@.@.@@@.@@..@.@@.@@@.@@..@@@@..@@.@@@.@.@.@@.....@.@..@.@@@@@.@
|
||||
.@@@....@.@...@@@..@.@@@@.@.@@@@@@.@@@.@.@..@.@..@...@@.@@@@@@..@...@.@.@@@.@@.@.@.@.@@.@@@.@@@....@@@@.@@@..@..@@.@@..@..@@@@.@@.@..@@@@
|
||||
@@@.@...@@@@@.@@.@@.@..@.@...@@@.@@@@@@@..@@@@@.@@@.@@..@.@@@@@.@.@..@@@@@@..@@@@@@..@@@@.@@.@@.@.@@@.@@..@.@.@..@..@@@....@@@.@@..@.@.@.
|
||||
.@@@@@@@@@.@@@.@@@@....@@@@@..@@..@@@@@@@@@....@@@@@@@..@..@.@...@@@@@@@@@@@@@@.@@@@..@.@.@.@@@@@@@@@.@@@@@@...@@@@.@@.@.@..@.@.@.@.@.@@@
|
||||
.@@@@@..@@@@.@@@@.@@@@@@@@@@@@@..@...@@@@..@.@@.@@@@@@.@..@@@@..@@@@@@.@.@@@@@@@@@@@@.....@@@@@@.@@@@@@@@.@@@@@@@@@@@@.@.@@@..@@@@..@...@
|
||||
@.@...@@@......@@@.@@.@@.@.@@@..@@.@.@..@@@..@.@@@@@.@@@...@@...@..@.@..@@@@....@@..@.@@..@.@.@@..@@@@@.@@@@.@@@.@.@@.@.@@.....@@.@@@@@@@
|
||||
@@@@.@@@....@@@@@.@@@.@@@@@.@@@...@.@@@@.@.@@@.@@@@@@@@.@@@@@.@@@@@.@....@.@@@@..@.@..@@.@.@@.@@.@@.@.@..@@@@.@.@@.@@@@@@@@@@.@.@.@@.@.@@
|
||||
@@@@.@.@.@@@@...@@@.@.@@@@@@@@@@.@@.@@@@.@@@.@@@..@@@...@@@@@..@@@.@@@@@.@..@......@@..@.@@@@@@..@@.@.@@@.@@@@@@@@@@..@..@@@@@.@@.@@.@..@
|
||||
@@.@@@@@.@.@@@@@@@.@..@@@@@@.@.@.@@@.@@@@@@@.@@@@.@@@@.@.@@.@@@.@@@.@@@.@@@.@@@.@@@.@@@@.@@..@.@..@@@.@.@.@@@@@@@@...@@@@@@...@.@@@@@.@@.
|
||||
@@@@@..@@.@..@....@@@@@@@.@@@@@@.@@@@@@@@@.@@.@@@@.@@@@@.@..@@@@@@@@.@....@@@@.@@@@..@.@@..@@@@@@...@@.@@@@...@.@.@.@@@@@@@..@@@@@@@@@@@@
|
||||
@@.@@@...@@.@@.@.@@@@@@@@.@@.@@.@...@@@@@@..@@.@@@...@@@.@@@@@@.@@@@.@@@.@@..@@@@@@@@@@@@.....@..@@...@.@@@@@@@..@..@.@.@@@@@@.@.@@.@@..@
|
||||
.@@@@.@@.@@.@@@@.@@@@.@@.@.@...@.@@......@@.@@@@@@.@@@@@@@@@@@@@@..@@@@.@@@@@@.@@@@..@@.@@.@.@..@@@..@@..@@@.@@@@.@@@@.@@.@@.@....@@@..@.
|
||||
@@@@.@.@.@@@@@.@...@@@@@@.@@@.@@@..@@@@.@.@@@@@@@@.@..@@...@@.@.@@@@..@@@@@@...@..@@.@@@@...@@@.@@@@@.@@@.@@.@@.@@@@.@@@@...@@@@..@@..@@.
|
||||
@....@.@.@@@@@@@......@@..@.@..@@.@@...@.@.@@.@@@.@@@@..@@.@@@@@..@.@.@@@@@.@@@@@.@@@@@.@.@@@@..@...@..@.@@@@@@@@@@@.@@.@@.@@@@@@@@@.@@@.
|
||||
@@@@..@@@@@.@@@@.@.@@@.@.@...@@@@@.@@.@.@..@@.@@@.@@..@@.@@@@..@@.@@@.@@@.@@@@@@.@.@@@@@@.@..@.@..@@@@.@.@@@@@.@@.@.@@@@@@..@@@@.@@..@@@@
|
||||
@@@.@@@....@@.@@.@@@@@@@@@.@@@..@@@@.@.@.@@@.@.@@@@@@.@.@..@@.@@@@.@@@@@@@@@@@@.@@@.@@@@@.@@@@@@@.@.@@.....@@@@@..@...@@...@@@@@@..@@@@@.
|
||||
@.@@@@@...@@.@@@@@.@@@.@.@.@.@..@@@...@..@@@@.@@@...@..@@@.@..@.@...@@@@@@.@@@@@.@@@@@..@.@@...@@@@@.@.@.@.@@@@@@@@@@.@@.@@@.@.@.@@.@.@@@
|
||||
.@.@.@.@@.@@@.@@@.@@@@@.@@...@.@@.@@@@@@@@@@@@@@@@@.@@@@@@..@.@@@@@@@.@.@@@@@@@@.@@..@@@@.@.@.@@.@@.@@.@.@@@@@...@..@@@..@@@@@.@.@.@@@@@@
|
||||
.@@@@@..@@@@@@.@.@.@@@@@@@.@.@@@@@@@.@.@.@.@.@@@@.@@.@@@@@@@@.@@@@@@@.@@@@@@@@.@..@@@@.@@..@@@@.@@@.@@@.@@..@@@@.@@@@.@.@.@@@@..@@@@..@.@
|
||||
@@@@@@@@@@@@@.@.@@..@.....@.@@@.@.@...@....@.@@@@@@.@...@.@@@@@.@@@@@...@@@...@..@@..@@.....@@@.@@.@@@@@.@.@@.@@@.@@.@@@@@...@@.@@....@@.
|
||||
.@@@..@.@@@..@.@@.@..@@@@.@..@@@@..@@.@@@@@.@@@@.@.@...@@@@.@..@@@@@@.@@@.@@@.@.@......@@@@@@@@@.@.@@.@@@@@..@@.@@.@....@@@@@..@@@@.@@@@.
|
||||
@@@@@.@.@.@@..@@.@@@@@.@@@@@@.@@@@@@@@@..@@@@.@@.@@@.@.@@.@..@..@@@@.@@@@@.@@@@@@@@@@@.@@....@.@.@@@@.@@..@@@@....@.@@@..@@@.@.@@.@@.@.@@
|
||||
@.@@.@.@@@.@@@@.@@..@.@@@@@.@@.@@@@@@@@.@@@.@@..@@@@@@@@@..@@.@@@.@.@.@...@@..@@@....@....@@.@@@@.@.@@@.@@..@@@..@@@@.@@.@.@@@.@@@@@@@@.@
|
||||
@@@@.@@@@..@@.@.@@@..@@@@...@@@@.@@@@.@@@@..@@@@@@.@@@@@@.@@@@@@@.@@@.@.@@..@.@@@.@@@.@@.@..@@@.@..@@.@@@@@@@.@@@@@@@.@@..@@..@@@@..@@.@.
|
||||
.@.@@@@@@.....@.@.@@..@.@.@@@@.@@.@@...@.@..@@@.@..@@@@.@@@@@.@@@@..@@@@.@.@@@@..@@@@@@@@@.....@.@@@..@@.@@.@.@@...@@@@.@@.@@@.@@.@@.@.@@
|
||||
@@.@@.@@@...@.@.@@@@..@@@..@@.@@@..@.@@..@.@.@@@@@@@..@@@....@.@.@@@@@@@@.@.@.@@.@.@.@@@@@..@@.@@@..@@@@@...@@..@..@@@.@.@.@..@@@..@@@@@@
|
||||
@..@@.@.@.@.@.@.@@@@@@@@.@@@@@@@@@@@@@@@@@@.@@@@.@@@@..@.@..@.@..@@@..@@@@@@.@@@@..@@.@@.@@@@@@@@.@@@@@..@@@@@@.@.@....@@.@@@@.@@@@.@@...
|
||||
.@@@@@.....@@.@.@@.@@@@@.@.@@...@.@.@.@@@..@.@.@.@.@.@@@@@@@@.@@@@..@@@.@@@@@@@.@.@.@@@.@@..@@@@@.@@....@@@@.@@@.@.@@.@.@@..@.@.@@@.@@.@.
|
||||
@.@@..@@.@@@@@.@@@..@@@@@..@@..@@@.@@@@@@@.@@.@..@@@@.@@@@@.@@@@@@..@@@@@@@...@.@@..@.@@@.@@.@@.@@..@...@@.@@..@@.@...@..@@.@@.@@@@@.@@@.
|
||||
@@..@@@@.@@@@@@@@@@@@@@@.@@.@@@@@@@@@...@@@@...@@.@.@.@@@...@.@@@..@@@@.@@@@@@@@@@@@@@...@..@@.@@@@..@.@@@.@...@@@@@@.@@@@@..@..@@.@.@@@@
|
||||
@.@@@@.@@@@@..@@@.@@..@@@.@@@@@..@@.@@@...@..@.@.@.@@@.@@@.@@@@@.@@@@..@@@.@@@.@.@.@@@@..@@@@@@.@@@..@.@.@@@..@.@.@.@@@.@@@@@.@@@.@@...@@
|
||||
@.@@...@..@@@.@.@..@@@@@..@..@@@@@@@@.@..@.@@.@@@@.@...@.@@@@@..@.@@..@.@..@@@@@@.@.@.@@.@@@.@@@@@@@@@@@@@@@@@@@@@@@.@...@@@@@@@..@@..@@.
|
||||
@@@..@@.@..@@...@@.@@@@@@@...@@.@@@@@@@..@...@.@@@@.@@@@.@@@@@.@@.@@@...@@@.@...@...@@..@.@@@@.@.@.@@@..@@@@.@@@@..@@..@...@..@@@@..@@@@@
|
||||
@.@@@..@@...@@@@@@@@@@@@@.@@..@@@@...@@@@@@@...@@@@@.@..@@@@@.@@.@@.@@@@@@@@..@.@.@@@.@@@@@@@@@@@@@@@@.@.@..@@.@@.@.@@.@@.@@@.@@@.@.@.@.@
|
||||
..@.@@@@@@@.@.@@..@...@@@..@@@..@@@.@@@@@@.@.@@.@@.@@@@@@@.@@.@@@@@@..@.@@@@@@@.@@.@@@@@@@@@@@@@@.@@..@@@.@.@..@..@@@..@@@@@@@@@...@@@@@@
|
||||
@@@@@@@.@@@@@@.@..@..@@@@@@..@@@@.@@..@@@@.@.@.@@.@@@@@.@.@.@@@@@@@@...@@@@@.@@.@.@@@.@@@.@@.@.@@@@@@@@@@@.....@.....@.@@@@@.@@@@@@@....@
|
||||
@.@@@@@@.@@.@..@@@@.@@.@@.@@@.@.@@@@@.@..@@@@.@...@@..@.@.@@@@.@...@..@.@.@..@@@@.@@@.@@@.@@@@.......@@@.@.@@@...@@.@@.....@.@...@.@@@..@
|
||||
@@@@....@.@.@.@@.@@@.@@@@.@@@@@@@.@@@@@.@.@@@.@@@@.@@@@@@@.@@@@@@.@@@@.@..@@.@@@@...@@..@@.@..@.@..@.@@@@..@@.@@@..@.@@@@@@@@@.@@@@@.@@@@
|
||||
@@@@@@@@@@@@@....@@@@@..@@@.@.@@@@@@@@..@.@@.@@@@@@.@@@.@@.@....@..@@@@@@.@@@@..@@@@.@@@.@...@@@.@..@@.@.@@@..@@@.@@@@@.@..@@@@@.@@.@...@
|
||||
@.@@@@@..@@.@@.@@@@@.....@....@.@@@..@@.@@@@@.@@@@@@@@@@@@.@@@..@.@@.@@..@@@...@@..@.@@@@@@@@@@@..@@..@.@@...@@@@.@.@@@.@..@@..@@@.@@@@@.
|
||||
@@@.@@.@@@@@@@@..@.@..@@@@@.....@.@.@@@@@@.@@@@@.@.@@.@@@@.@.@.@@@@@@..@@@@.@@@@...@@@@....@@@.@@.@@@.@.@@@.@@@@.@@@....@@@@.@@@@@.@@@..@
|
||||
@.@@@...@@...@.@@@..@@@@@...@@.@@.@..@@@.@.@..@@.@@@@@@..@@...@@@@.@.@@..@..@..@@@.@.@@@@@..@.@@@.@..@.@@..@....@@@@@@@@@@@@@@.@@..@.@.@@
|
||||
@@@@@@.@@@...@.@.@@@@.@@@.@..@@@@@@.@.@@@@@@@@.@.@.@.@..@@@@..@@.@@..@@@.@@@@@.@@@@.@@@@@...@@...@@@..@@@@@.@@@.@@..@.@...@.@.@@..@..@@.@
|
||||
@...@@@@.@@@..@@@@.@@.@@.@....@.@...@@...@@.@@@.@.@.@@@...@..@.@@@.@@@@.@@@@..@@..@@@@.@.@@@..@@@.@..@....@@.@..@@@.@@@@@@.@@@@.@.@@@@@@.
|
||||
@.@@@.@@@@@@@.@@.@@@@@@@@@@@@@.@@@@@.@@@.@@.@.@@@.@.@.@.@.@@@@.@@.@..@@@@.@@@.@.@@@@@.@@@@...@.@...@.@.@@.@@@...@...@@.@.@.@@@@@...@@@.@.
|
||||
@@.@.@.@....@@..@...@@@.@@.@@@@..@@@@@@@.@@.@@...@..@..@....@@@@.@@@@@@..@.@..@@@@.@.@@@@@.@..@@@@@@@..@@.@...@@@@@.@@@@.@@..@@@.@@.@.@.@
|
||||
.@@@@@@@@.....@@@.@.@@@@.@.@@.@@.@@@.@@..@.@@@@@@@@....@@@@@@@@.@@.@@@.@.@....@..@.@@@@@@.@..@.@@.@..@.@.@@@@@..@@@..@.@@.@@@.@@@@@.@...@
|
||||
..@@.@@@..@@.@.@@@.@@@.@...@@@@@@.@..@@@.@..@@@@@.@@.@@@@@@@.@@@.@..@@..@@@@.@@@..@@@@..@.@@@@.@@@@@...@@....@@@@@.@@@...@@..@@@@.@@@@.@@
|
||||
@@@@@@..@.@@.@..@@.@@@@@@@..@@@@..@@@@@.@@@@@@.@@@@.@@@@@.@@@.@@...@@@@.@@@...@@@@@@.@.@@@..@@.@@@@....@@@@.@@@@.@@.@..@.@@@.@@@@.@@@...@
|
||||
......@@@@@@@@...@@@@@@@@...@@@@@.@@@@@.@@@@...@.@@@.@@.@...@@@.@...@.@@@@.@@@@..@...@@@......@@.@@@@@.@.@@@@.@.@@@@.@@@@.@..@@@.@@.@@..@
|
||||
....@...@@@.@@@@...@..@@@.@...@@@.@.@@..@@@@@@.@..@@@@@.@@@@@.@@@@@.@@.....@@@@@@...@@.@.@@@@@@@@..@@@@@@@@@.@@@..@.@...@@.@@@@@@..@@.@.@
|
||||
..@@@.@@@.@.@...@@@@.@@@@....@...@@@@@@.@@@@@@@@.@@.@@.@@@@@@@@@.@@@@@@..@@@@.@..@@.@@@.@@@.@@@@@....@...@@...@@.@..@@@@@@..@@...@@@.@.@.
|
||||
@@@@.@@@...@@.@.@@.@@.@@@@@@@.@@@@@.@@@..@...@.@.@.@.@@@@.@@....@@@@@.@@@@..@@@@@@@.@...@@@.@@..@..@.@..@@..@.@@@@@..@@.@@.@@@.@@@@.@@.@@
|
||||
.@.@@.@@@@@@..@@@@..@@..@@@.@..@@@@.@@@@..@@.@@@@@.@.@@.@@@@@@..@@@..@....@@@@@@@@@@@@@@.@@.@..@@@@..@@.@@@@@@.@.@.@.@@@@.@@.@....@.@@@@@
|
||||
@.@@@@@@.@@.@...@@.@@.@@@@@.@.@@@@@@.@@@...@@.@@@..@@..@..@@.@@@.@@.@@@..@@@..@..@.@@@.@@@.@....@.@@@@@..@@@.@@@.@.@@@@@@...@.@@..@@@@@@.
|
||||
.@@@.@@@@@@.@..@.@@@@@@.@@@@.@@@...@@@.@..@..@@.@.@...@.@@@@..@@@.@@@@...@@@.@@.@@@@@@.@@@.@@@.@.@..@..@..@...@@@@@@.@..@@..@@@@@@.@@.@@@
|
||||
.@@@@@.@@@.@.@.@@@.@..@.@...@@@@@..@@.@@@@.@.@@@.@@.@@@..@@@@..@@.@@@@@@@@.@@.@@@@..@@@.@@.@.@@.@.@.@@.@.@.@@.@.@@@.@@@.@@..@@@@..@..@.@@
|
||||
@@@@.@.@@.@@@..@@@@..@@@@@@@.@.@..@...@@..@.@@@.@@@@.@@..@.@@@@@...@.@..@.@.@@@.....@@.@@@@@@@.@@@@.@@.@@@@@@.@.@@..@@@@.@@..@@@.@@@.@@@.
|
||||
.@@....@@..@@@@@.@@@..@..@@@@@@@@@@.@@@.@@@@.@@@@@@@@..@@.@@@@..@@....@@..@.@@@@@..@@@@.@@@@@.@.@.@..@@@@..@@..@...@.@@...@.@.@@@@.@@..@.
|
||||
.@.@@@@.@@..@@@..@..@@.@@.@@@.@@.@...@..@.@.@@@@.@..@@..@.@@@..@@@...@@@@@.@@@@@@@.@@..@.@..@@@@@.@@@..@@@@@@@@@@@.@..@@@.@@..@..@@@...@@
|
||||
@...@.@.@@@@@@@@@@@@.@@.@.@.@@..@@@.@.@.@@...@@@@.@@.@@.@@@@@@...@@..@@@@.@@@@@..@@@@@@@.@@@@.@@..@@@@@@@@@@@@..@@..@.@@.@.@.@@@.@.@@@@@@
|
||||
@..@@@.@..@@@.@@@@@@.@@.@@.@@@..@@@..@@@.@.@@.@..@@@@@@.@...@@.@@...@@@@.@.@@@@.@@@@.@.@@@@@@@...@.@@@.@.....@.@.@@.@.@.@@@@@@@.@.@.@@@@.
|
||||
@.@@@.@@@.@@@@@@@@@@@.@@@@@@@@@..@@@@.@@..@@@@@...@@@....@@@@..@@..@@@@@.@@.@@.@.@.@@.@@@@.@.@..@@....@@..@.@@.@@@@..@.....@@@..@@.@..@..
|
||||
.@@...@...@.@@.@.@.@.@....@@@@@.@@..@.@..@@@..@@.@@@@@@...@.@@@.@.@@@@@@..@@.@.@...@.@@@..@@.@..@.@@.@....@@.@@.@@@...@@..@...@@@.@@.@@.@
|
||||
@@.@.@@@@...@@@@@@@@.@@....@.@...@.@.@.@@@@....@.@@.@@@..@@.@@@@@@@.@@@@@.@@.@@@.@.@@@.@.@..@@@.@@.@..@@.@@@.@@.@@@@@@@.@@@@@@..@..@@.@@.
|
||||
....@..@@@....@@@@.@@.@.@.@.@@@@.@.@@@.@..@@.@.@@@.@@@@..@@@.@..@...@@@..@@@@..@@@@@@..@@.@.@@@@@@@@...@@.@@..@...@.@.@@..@..@.@@.@@..@.@
|
||||
@@@@.@@@@@@@@@.@@@..@@..@..@.@..@@@.@.@.@@@@@...@@@@.@...@@@@@@@@.@.@..@@.@@@@@@@......@..@@@@.@@@..@.@@.@@.@.@@@...@@@@.@.@..@.@@@.@@@..
|
||||
@@.@@@@@.@@@.@@@@@..@...@@...@.@.@.@..@.@@@.@.@.@.@@.@@@@.@@@..@@@@...@@.@@.@@@@@@@.@@.@@.@@@.@@@.@@@@.@@@@@@.@.@@.@@@.@..@@.@@@@.@@@..@.
|
||||
@@@..@@.@.@.@@..@..@.@...@@@.@@@.@.@..@..@@@@@@@.@@.@@..@.@.@@@@.@.@..@.@.@@@...@.@.@@.@@@@..@.@@@@@.@@@..@@.@@@@@@@..@@@.@@@@@@@.@@@@@.@
|
||||
@@.@@...@@@.@@@@@@.@.@@.@@@@@@.@@@..@@.@@@.@@..@.@@.@..@@@@@@.@@@.....@.@@@@@.@@..@@..@@..@@.@.@@@@@@.@@.@.@@.@...@@@@@@.@.@@@...@@@.@@@@
|
||||
@@..@@@@.@.@.@@@@@@@@.@@.@.@@@.@@@@..@..@@@@@@.@@...@@.@@..@.@@..@@.@@@@.@@.@.@@@@@@@.@@@...@..@.@@...@@@@.@@..@.@@@@@@@@@.@@.@.@.@.@@@.@
|
||||
.@.@@..@@@@@....@@@.@@@.@@.@@...@.@@...@@@@@.@@@....@.@@.@@@@.@@@.@@@@@@..@@@@.@@@...@..@@@@@.@....@@@@.@.@.@.@@@@.@.@@@..@@.@@...@....@@
|
||||
@.@.@@...@@.@@...@.@..@..@@@...@.@@@.@@@@@@.@@@.@@@@@@@@...@@@.@..@...@..@@.@@@.@..@.@@@..@@@...@@@..@.@@@@@.@..@@.@..@@.@@@@@@@@.@..@.@@
|
||||
@@@..@.@..@.@@.@@@@@@.@@@.@@@....@@.@@@.@@@....@..@.@...@@..@@@@@@@@@@...@@.@@@.@@@.@@@@@@.@@.@...@.@@.@@@....@@.@@@.@.@@.@...@.@@@@.@@@@
|
||||
.@@@@..@@@.@.@.@@@.@..@@.@@.@.@@@@@@.@@@@.@@...@@@@.@@..@.@@.@@@@@@@@@..@@@@.@@@@.@.@@@....@@.@.@@.@@@@@@...@@@@@@@.@..@..@..@@.@.@.@....
|
||||
.@@@@@.@.@@.@.@@@@@@..@.@@.@@...@@.@@@@.@.@.@@@.@@@@....@.@@@@@@.@@@@.@@@@.@@.@@@@@@@@.@.@..@.@@@.@@@@@...@@.@..@.@@@.@.@@@@.....@.@.@@.@
|
||||
.@@.@@@.@@@.@@.@...@@...@@@@..@@.@@@..@.@@.@@.@.@@@@.@@@@.@..@@@@.@@@@@@.@.@@.@.@@..@@@@@@@@@.@@@@@.@@@@..@@@.@@.@@.@.@@@@@.@@@@@.@....@.
|
||||
@@.@@@.@@@@.....@@@.@.@@.@.@@.@@..@@@@@@..@@@@@@@@@@.@@@@@@@.@@..@@@@..@@..@@@.....@.@..@@@@.@@.@.@..@@..@@.@@..@.....@@.@@@...@.@.@.@@@@
|
||||
@..@@@@.@.@@@@.@.@.@.@.@..@.@..@@@@@.@@@.@@.@...@@@@.@@.@@@@@@@@..@@@@.@@@@.@@@@..@@@..@.@@.@@@@@@@@@.@.@@.@@@.@.@@@.@@.@@..@.@@@@@@..@.@
|
||||
47
2025/d04/ex2/ex2.py
Executable file
47
2025/d04/ex2/ex2.py
Executable file
|
|
@ -0,0 +1,47 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import itertools
|
||||
import sys
|
||||
from typing import NamedTuple
|
||||
|
||||
|
||||
class Point(NamedTuple):
|
||||
x: int
|
||||
y: int
|
||||
|
||||
|
||||
def solve(input: list[str]) -> int:
|
||||
def parse(input: list[str]) -> set[Point]:
|
||||
return {
|
||||
Point(x, y)
|
||||
for x, line in enumerate(input)
|
||||
for y, c in enumerate(line)
|
||||
if c == "@"
|
||||
}
|
||||
|
||||
def is_accessible(point: Point, rolls: set[Point]) -> bool:
|
||||
assert point in rolls # Sanity check
|
||||
return (
|
||||
sum(
|
||||
Point(point.x + dx, point.y + dy) in rolls
|
||||
for dx, dy in itertools.product(range(-1, 1 + 1), repeat=2)
|
||||
if dx != 0 or dy != 0
|
||||
)
|
||||
< 4
|
||||
)
|
||||
|
||||
rolls = parse(input)
|
||||
removed = 0
|
||||
while accessible := {p for p in rolls if is_accessible(p, rolls)}:
|
||||
removed += len(accessible)
|
||||
rolls -= accessible
|
||||
return removed
|
||||
|
||||
|
||||
def main() -> None:
|
||||
input = sys.stdin.read().splitlines()
|
||||
print(solve(input))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
137
2025/d04/ex2/input
Normal file
137
2025/d04/ex2/input
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
@@@@@.@@@@@@@.@.@@@.@@@..@@@@@@...@...@@...@@@@@@@@.@@@@@@@@@@@@@@@@@...@@@..@@@.....@..@@@@@.@@@@...@@@@@@@@@@@@.@@@@@@.@..@@@@@..@.@@..
|
||||
...@@@.@@@..@@@@..@.@..@@....@@.@@@.@...@.@@@...@@.@@@..@@@.@@@..@.@@.@.@.@@..@@@@@..@@@@.@@@@.@@.@@@@..@@.@@.@@.@@@@.@@.@@@@@@@@.@.@..@@
|
||||
@@.@@@@@@..@@..@@@@@@.@@@@@.@..@@@@@@@.@.@@.@..@..@@@@.@@.@@@..@@.@@.@@.@.@@@.@@@.@@@@@@@@.@.@@@@..@@@..@@@.@.@.@@@@.@@@@@@@@@@..@...@@.@
|
||||
.@@@@.@@.@@@.@@@@@@@@@..@.@@@.@@@.@@@@@@.@@@@.@...@@@..@@....@@@@.@.@.@@...@.@@@..@@@.@@@@@@@@@@@......@.@@@@.@@@@@@.@..@@@@.@.@.@.@@@@@.
|
||||
@@@@@@@.@@..@@@@@@.@@@@@.@@@..@.@@@@.@@@@@..@@@@@@@@@@@@.@@@.@@@.@@@.@@@.@.@.@@.@..@@..@@@@..@.@@.@.@@......@@@.@.@.@@...@@@@@.@@@@@@@.@.
|
||||
.@...@..@@@..@@@@@@@@.@.@.@.@.@@.@.@.@@.@.@@...@..@.@.@@@.@@@..@@@@@@.@@@@..@@.@.@@.@..@.@@@@@.@@.@..@@@@..@@@@@.@@@@@.@.@@.@@@..@...@@.@
|
||||
.@.@@.@..@.@.@.@@@@@.@.@@@@.@.@@@@..@@..@..@.@@@.@@@.@@@.@.@@@.@..@@@@@@@@@.@@@@@@.@@@@@@..@.@@@@...@.@@@@@@.@.@@@@@@@@@@@@@@@.@@..@@@@@.
|
||||
@@@...@.@@@.@@@@@@.@@@@..@@..@@.@.@@.@..@@.@...@@@.@@@.@@@.@.@@@@..@@@@.@@.@@@.@@@.@.@..@@.@@..@@@@@@@....@@@@@@@@@@@.@..@@.@.@@@@@.@@@..
|
||||
@@@.@@.@@...@@@@@@@@@@@.@...@.@...@@@@...@@@@@@@.@@....@.@@.@..@@.@.@.@.@...@@.@....@@..@..@.@@@@@..@@@@.@@@@@@..@@.@@.@..@@@@@@@@@.@@.@@
|
||||
@@...@@@@@@.@.....@@@.@@@@@@..@.@.@.@@@.@..@@@@@@.@@@@@@@@.@@@@@.@@.@.@..@...@....@@@.@@@..@@@@@@@@...@..@@@@@@.@@@@@@.@@@..@@@@@@..@.@@.
|
||||
@@...@@..@@@@@...@@@@@.@..@.@..@@.@.@...@.@@@@@@@@@@.@...@@..@@@.@@@@..@@..@...@@@...@...@.@.@.@@..@@@.@@.@@@@@@@@.@@@@@@@@...@.@.@@.@@@@
|
||||
.@@...@@.@.@@.@@@.@.@@@..@@@@@@.@.@@..@@...@@.@..@@..@.@@@.@@@@@@@@.@@.@@.@@@@@@@..@@@.@@..@@@@.@.@.@.@@@@.@@.@.@@@@@@@@..@@@@.@@@@..@.@@
|
||||
@.@.@@@@@.@..@@.@@....@.@@.@@@@@@@@@@.@.@@@.......@@@@.@@..@@.@@.@@@.@@@@@@@@.@.@.@.@@@.@@@@..@....@.@@@@....@...@.@@.@@@@..@......@@..@.
|
||||
@....@@@@@@@@@@@@@@@@@@.@...@@.@@.@@@@@@@@.@.@@@@@@@.@@@@@@.@@@@@@..@..@@..@....@..@@@@..@@@..@@@@.@.@@@.@.@....@@.@@...@@.@.@.@@@@.@@@.@
|
||||
@.@@@@@.@@@@..@@..@@@@...@@.@@@@@..@@.@@@@@@@@@@.@@@@@@@.@..@.@@.@@..@@@@.@@@@.@@@.@.@..@@@.@..@@@.@.@@@.@@.@@.@@..@@@@@.@..@@@@@@@@@@@@.
|
||||
@@@@.@@@@@.@@.@@@@@.@@@.@@@.@@..@@@@.@@@..@.@.@@@@...@@.@@@.@@.@.@@@@@@.@.@@@@@@@..@@@@@@..@@@.....@.@.@@@@@....@.@@..@.@@..@@@@@@.@@@@..
|
||||
@.@@.@@@@.@@@@@.@@.@@@@@.@...@@@.@@@@.@.@.@@@@@.@.@@.@@@@...@...@..@.@.@@@.@@@@@.@@@@.@.@@@.@@@@@@.@@@.@.@@@.@@@@..@@@.@@.@@@@@@@.@@@@@@@
|
||||
...@.@@.@@@@.@@.@@@.@@@.@..@..@@..@@@.@@@.@.@.@.@@@..@.@@@@.@@.@@@@@@@@@..@@.@@@@@..@@@@..@@..@.@@.@@.@@.@@@..@.@@@@.@@@@@..@@.@@.@@@@.@@
|
||||
.@@@....@...@@@@.@.@.@.@@@..@..@@@@@.@@@..@.@@.@@@@@@.@@@@@@@@@@@..@.@@...@@.@..@....@.@@.@@@..@..@@@@@.@.@.@.@.....@@.@@.@@@@.@.@@@@@@@.
|
||||
.@@.@.@..@@.@..@..@@@.@@@@@@.@@@@@@.@.@.@@.@@@.@..@..@@..@@.....@@@....@@@@@..@@@@@@....@@@...@@.@...@@@.@@@@.@.@@@@.@@@@@.@.@@..@.@@@.@.
|
||||
.@@@@.@@.@.@......@@@@@@@.@@.@@..@@@@.@@.@@@@@@..@@@.@@@..@@..@.@@@@@..@......@..@.@.@..@@.@@@.@.@@@.@@@.@@@..@@@@@@..@@@@@@...@@@@@@@.@@
|
||||
..@@.@@..@@@..@...@@.@@@@...@@@.@@@@.@@@..@@@.@@@.@@@@.@.@...@@@@@.@@...@@.@@@.@@@@.@@@@@..@.@@@@@@@@@@@..@@@@@@..@@@.@@.@.@.@@@@..@..@@@
|
||||
.@@@@.@..@.@@@..@@.@..@.@@@.@@.@@.@.@..@@.@..@@.@.@@..@@@@...@.@@@..@.@.@.@@@.@@.@@.@@@..@@@@@@@@@@@@.@@.@@@@.@@.@@@@@.@@.@..@@....@@@@..
|
||||
@..@@.@@@@@.@@@@.@.@@@@@...@@@@..@@@@@.@.@@@..@@@@....@@@@.@@..@@@.@.@@.@@@@@@@@@.@..@..@@.@@@.@@@.@@..@.@@.@@..@@..@@@@@.@..@@.@@@@@@.@.
|
||||
@@@@@@@@....@.@.@@@.@....@@@..@.@....@@@...@@.@.@@...@@...@.@.@@@@@@....@@@@.@@..@@@@@@.@@@@..@.@@@@@@@@@.@@.@@@.@.@@@..@.@@..@@@@..@@.@@
|
||||
@...@@@@@@@@.@@@@@@@..@.@.@@@@@...@@.@..@.@@@@...@@@...@@@@@@@@@@@.@@@@.@@@@@@.@@.@@@@@@@.@@@.@.@@.@@.@@@@@@.@..@@@.@.@.@...@@@........@.
|
||||
@@@.@@.@.@.@@.@@@@..@@.@@.@@@..@@@...@@@@..@.@@@@.@.@.@.@@@.@@@@.@@...@@@@@.@.@@.@.@@@.@.@@.@@@.@@@.@@.@@@@.@...@..@@@.....@@@.@@@.@@.@.@
|
||||
@.@.@@..@@.@@@@@@.@@@@@@@@.@..@@@@..@@.@@..@@@@@@..@...@@.@@.@.@.@.@@@@..@..@..@@@.@..@..@@@@@.@.@.@@@@@.@@@@@.@.@@..@@@@@.@@@..@@@@@.@.@
|
||||
@@..@@@.@..@..@@..@@@@.@@@@.@.@@@..@.@@..@@@.@.@@..@.@@.@@@.@.@@@@.@..@@..@@@..@@@..@@@...@@.@@@@..@@@@@@@@.@@..@...@@@..@@@.@.@@.@@...@@
|
||||
@...@@@.....@@@@@.@.@.@@..@@....@@@@@.@@@..@.@@@@@@@@.@@@.@@@.@@@@@.@.@.@@.@@.@.@..@..@@.@.@@@@@@@@.@@.@@@@..@@@@.@@@@...@...@@@@@..@@@@@
|
||||
@@@.@.@@...@.@.@.@@@@@@@....@@@@@@@.@@@@.@@.@@.@.@...@..@@.@.@@@@@@@@@@@.@.@.@@@@@@.@....@@@.@@@@@@@@@@..@@@.@@.@@..@.@@.@.@..@.@@@@@@@@.
|
||||
.@....@@@.@.@@@@@.@..@.@@@.....@.@@@.@.@.@@@.@@@.@..@...@.@.@@@@@@.@@.@.@..@.@@..@@@@.@@@.@@@@@..@..@@@@@..@@@@@.@..@@.@@@@......@@@.@@.@
|
||||
@.@...@@@@@@@.@..@....@@@@..@@..@@@@.@.@@@@@@@@@.@.@.@.@@.@@@.@..@@@@@@...@@..@@@.@.@@@@.@@@@..@@.@.@...@..@..@.@@@...@@@@@@.@..@@@@@@...
|
||||
@@@@@..@..@.@.@@.@@@@@.@@@..@.@@@..@@..@@.@@.@@@@.@@.@...@@@..@.@@@.@@@.@@@@@@@@@.@@.@@.@@@@..@@@@@..@@@@@..@..@@.@@@@@@@..@@.@@.@@..@.@.
|
||||
@@@@@..@@@@@.@@@@@.@@@@@@@.@@@@@@@@@@@.@.@@@@@.@.@@@....@@@@.@.@..@.@@..@.@..@@.@@@..@@@@@.@@@.@.@.@@@@.@@@.@@@@...@.@@@.@.@@.@@.@.@...@@
|
||||
@@@.@.@@.@@@@@.@.@.@...@@@.@@@..@@@@@@@@@.@@@@@@@@@@@@@@@@...@..@..@.@@.@..@@.@@@...@..@.@@.@@@@.@@@@@..@.@@@.@@@..@@@..@@.@@.@@@..@..@@@
|
||||
.@@@.@.@@@@@@.@@.@@.@@...@.@.@@@@...@.@.@@...@@.@@..@.@.@@....@@@.@..@@.@@@.@.@..@..@@@@@.@@..@....@@@@@@.@@@@@.@@@@@@.@@..@@@@@..@@@.@@@
|
||||
..@.@@@@.@@@..@@@@.@@@.@@@..@@@.@..@@@@@@.@@..@..@@.@@..@.@@.@@@@@@.@@@.@...@@@@.@..@.@@@.@@.@@.@..@@@.@..@.@@.@..@@@@@.@.@@.@@@@@@@.@@..
|
||||
@@@@.@@@@@..@..@@@.@..@@@@@.@@@.@@@@..@.@@.@@@@.@@@@@.@.@.@@@@@.@@@@..@@.@@..@@@..@@..@@@@@@.@.@.@...@..@@.@.@@.@..@@@@@@.@..@@.@.@@@@@..
|
||||
@@@.@@@@@.@@@.@@@@@@@@@@@@@@@@..@@..@@..@@@@@@@@..@@@.@@@@...@..@.@@@@@.@.@@...@.@..@.@@@@@@.@@@@..@...@@@.@.@..@@@@.@@@@@@@@@@.@@.@@.@@@
|
||||
@.@@@@.@.....@@@@@.@@......@@@.@@...@.@@@@@.@.@@@@..@...@..@@..@@.@.@@..@..@..@.@@@.@@@@@@.@@@.@@@.@@..@.@@.@.@@....@.@..@...@@.@.@@@@@.@
|
||||
@@@@.@@@@@@..@@.@.@@.@@.@....@@@...@.@@@@@.@..@@@.@@@@@@@@@@@@@@.@.@@@.@.@@@.@.@@.@@.@@@@..@@@@.@@..@@@..@...@..@@.@@@@@@@@.@@@@@.@@@@@@.
|
||||
.@@...@.@....@@@@..@@.@@@@@@..@@@@@.@@@@@@@...@....@@@@@.@@.@@.@..@@@@@@.@...@@@@.@@@.@@@@..@@.@.@.@.@@@.@..@@@...@@@@@@.@@@@..@...@@..@@
|
||||
.@...@@@@..@@@@@..@@@..@@@@@@@.@.@@..@..@@.@..@@@@@.@.@@.@..@@@@@..@...@@.@@@.@@.@@@@@@..@....@...@@@@@@@.@@@@@.@@@@@@.@......@@.@.@..@..
|
||||
@.@@.@.@@@@@@.@.@@@.@@...@.@..@@@@@.@@@.@.@@..@.@.@@@.@@.@@@@@@.@@@@@@..@@.@..@.@...@@.@@@@@.@@@@.@@.@@@@@..@@.@@@@@@@@@..@@@@.@@.@@@@@@.
|
||||
@@.@.@.@@@.@@@.@@@...@@@@@@.@.@@@@@.@@@@@.@..@@.@..@.@@.@@@.@@@@..@@@@...@..@@@..@@@@@.@@@@@@@.@...@@.@@.@@@@..@@@@....@@@.@.@.@@.@@..@@@
|
||||
.@.@@@@.@.@..@@@@.@@@@..@@@@@.@@.@...@@@@.@.@.@@@@.@.@@@.@@..@@.@@.@.@.@..@..@@@@@.@.@..@@@@.@@..@.@@.@..@.@@.@@@@@@@@@@@@@@@@@@..@@@@@@.
|
||||
@@@@@.@@.@@@@.@@@@@.@.@@@@.@..@@@@@.@@@.@@...@@.@@..@@@@.@@@@@.@@@.@@.@.@@@@@@.@@@.@@@@@.@@@@.@.@@@@@..@.@@@@@@@..@@...@@@.@...@@@...@..@
|
||||
@@@@@....@.@..@@@.@@@.@..@..@...@.@@.@@@@@@@.@@@@.@@@.@@@@@@...@@@@.@@.@..@@@@.....@@@.@.@@@...@@@.@@.@@@.@..@..@@@@.@@..@@...@@@....@@@.
|
||||
.@@@@@@@..@.@.@.@..@@@@@@@@@@.@@@@.@@@@@@@.@@@@@..@@@..@..@@..@@..@@@@@@..@@@.@@@@.@@...@..@.@.@@@@@@@@@@.@@@@.@@@@@.@@@@..@@..@@@@@@@@..
|
||||
@@@.....@@.@@@@@@..@@@...@@@@.@@..@@@@@@...@@@@@@..@.@@@@.@@@@.@@.@@..@@@@..@..@.@@.@...@@@@...@..@@@.@@.....@@@@@@@@@.@@@@.@.@@@@@.@@@@.
|
||||
@@@@..@@@@@@@@@..@@@@.@@@@@@@@.@@@@@@@@.@@@@@@@@@.@@.@.@@@.@@@.@@.@.@....@@@@.@...@.@@@.@.@.@.@@.@@@@.@@@@@@@@@@@@@.@.@@@.@@@@.@@@.@@@@..
|
||||
.@@@.@.@@..@@.@@@@..@@@@@..@.@.....@.@....@@@@@@@@.@.@@@@.@...@..@....@@@@@.@@@@@@.@.@@@.@....@@@@@@@@@.@.@@.@@@@@@.@@.@...@..@@@@@@@..@.
|
||||
@@@....@@.@@@@@@@@.@@@@.@@@@@@..@@.@@@@..@.@.@@@@@@...@@@.@@.@..@.@.@.@.@@.@.@@@@@.@@@@@...@.@.@@.@@@@@@@@.@@@..@@@.@.@@.@@@@@@@@@.@@@@@@
|
||||
.@@..@@.@..@@..@@.@@@@@@....@.@@@.@@.@@@@@@@.@...@@@@@@@@.@@@@@@.@@@@@@@@@...@@...@@@@.@.@@.@.@@...@@@@@@@@@@...@@@@.@@@@@@..@@@@@.@.@@..
|
||||
@.@@@..@...@@.@@@@@.@@@.@....@@@@@@..@@.@@@@@@@@@@.@@@.....@.@@@@@@@.@.@...@@@.@....@@@@@@@@@@.@@@@.@@.@@@.@.@.....@.@.@.@@@.@@@.@.@@@@@@
|
||||
@@.@.@@@...@@@@@@.@@...@.@.@.@@@@@@@@@@@@@@...@@@@@@@@@@.@.@@@..@.@@.@@@@@@@@@@@@.@.@.@@.@..@@@@@@@@@@..@.@@@@@.@@.@.@.@.@.@@@..@@.@@@@@.
|
||||
@@..@@.@@@.@@@@@@..@@@.@.@@.@@@.@.@@.@.@@@@@..@@@.@@@.@@.@@@.@@@@...@@@@@.@.@@@.@@@@@..@@@@.@@@@@@@@@.@@@@.@@..@@@@@.@@.@@@..@.@@@@@@@..@
|
||||
@@@@@@@@@@@@@@@.@@.@@@@.@.@.@@@...@@.@@@.@...@@@@@.@.@@.@@@@.@.@@@.@@.@.@@@.@.@@@.@@..@.@@.@@@.@@..@@@@..@@.@@@.@.@.@@.....@.@..@.@@@@@.@
|
||||
.@@@....@.@...@@@..@.@@@@.@.@@@@@@.@@@.@.@..@.@..@...@@.@@@@@@..@...@.@.@@@.@@.@.@.@.@@.@@@.@@@....@@@@.@@@..@..@@.@@..@..@@@@.@@.@..@@@@
|
||||
@@@.@...@@@@@.@@.@@.@..@.@...@@@.@@@@@@@..@@@@@.@@@.@@..@.@@@@@.@.@..@@@@@@..@@@@@@..@@@@.@@.@@.@.@@@.@@..@.@.@..@..@@@....@@@.@@..@.@.@.
|
||||
.@@@@@@@@@.@@@.@@@@....@@@@@..@@..@@@@@@@@@....@@@@@@@..@..@.@...@@@@@@@@@@@@@@.@@@@..@.@.@.@@@@@@@@@.@@@@@@...@@@@.@@.@.@..@.@.@.@.@.@@@
|
||||
.@@@@@..@@@@.@@@@.@@@@@@@@@@@@@..@...@@@@..@.@@.@@@@@@.@..@@@@..@@@@@@.@.@@@@@@@@@@@@.....@@@@@@.@@@@@@@@.@@@@@@@@@@@@.@.@@@..@@@@..@...@
|
||||
@.@...@@@......@@@.@@.@@.@.@@@..@@.@.@..@@@..@.@@@@@.@@@...@@...@..@.@..@@@@....@@..@.@@..@.@.@@..@@@@@.@@@@.@@@.@.@@.@.@@.....@@.@@@@@@@
|
||||
@@@@.@@@....@@@@@.@@@.@@@@@.@@@...@.@@@@.@.@@@.@@@@@@@@.@@@@@.@@@@@.@....@.@@@@..@.@..@@.@.@@.@@.@@.@.@..@@@@.@.@@.@@@@@@@@@@.@.@.@@.@.@@
|
||||
@@@@.@.@.@@@@...@@@.@.@@@@@@@@@@.@@.@@@@.@@@.@@@..@@@...@@@@@..@@@.@@@@@.@..@......@@..@.@@@@@@..@@.@.@@@.@@@@@@@@@@..@..@@@@@.@@.@@.@..@
|
||||
@@.@@@@@.@.@@@@@@@.@..@@@@@@.@.@.@@@.@@@@@@@.@@@@.@@@@.@.@@.@@@.@@@.@@@.@@@.@@@.@@@.@@@@.@@..@.@..@@@.@.@.@@@@@@@@...@@@@@@...@.@@@@@.@@.
|
||||
@@@@@..@@.@..@....@@@@@@@.@@@@@@.@@@@@@@@@.@@.@@@@.@@@@@.@..@@@@@@@@.@....@@@@.@@@@..@.@@..@@@@@@...@@.@@@@...@.@.@.@@@@@@@..@@@@@@@@@@@@
|
||||
@@.@@@...@@.@@.@.@@@@@@@@.@@.@@.@...@@@@@@..@@.@@@...@@@.@@@@@@.@@@@.@@@.@@..@@@@@@@@@@@@.....@..@@...@.@@@@@@@..@..@.@.@@@@@@.@.@@.@@..@
|
||||
.@@@@.@@.@@.@@@@.@@@@.@@.@.@...@.@@......@@.@@@@@@.@@@@@@@@@@@@@@..@@@@.@@@@@@.@@@@..@@.@@.@.@..@@@..@@..@@@.@@@@.@@@@.@@.@@.@....@@@..@.
|
||||
@@@@.@.@.@@@@@.@...@@@@@@.@@@.@@@..@@@@.@.@@@@@@@@.@..@@...@@.@.@@@@..@@@@@@...@..@@.@@@@...@@@.@@@@@.@@@.@@.@@.@@@@.@@@@...@@@@..@@..@@.
|
||||
@....@.@.@@@@@@@......@@..@.@..@@.@@...@.@.@@.@@@.@@@@..@@.@@@@@..@.@.@@@@@.@@@@@.@@@@@.@.@@@@..@...@..@.@@@@@@@@@@@.@@.@@.@@@@@@@@@.@@@.
|
||||
@@@@..@@@@@.@@@@.@.@@@.@.@...@@@@@.@@.@.@..@@.@@@.@@..@@.@@@@..@@.@@@.@@@.@@@@@@.@.@@@@@@.@..@.@..@@@@.@.@@@@@.@@.@.@@@@@@..@@@@.@@..@@@@
|
||||
@@@.@@@....@@.@@.@@@@@@@@@.@@@..@@@@.@.@.@@@.@.@@@@@@.@.@..@@.@@@@.@@@@@@@@@@@@.@@@.@@@@@.@@@@@@@.@.@@.....@@@@@..@...@@...@@@@@@..@@@@@.
|
||||
@.@@@@@...@@.@@@@@.@@@.@.@.@.@..@@@...@..@@@@.@@@...@..@@@.@..@.@...@@@@@@.@@@@@.@@@@@..@.@@...@@@@@.@.@.@.@@@@@@@@@@.@@.@@@.@.@.@@.@.@@@
|
||||
.@.@.@.@@.@@@.@@@.@@@@@.@@...@.@@.@@@@@@@@@@@@@@@@@.@@@@@@..@.@@@@@@@.@.@@@@@@@@.@@..@@@@.@.@.@@.@@.@@.@.@@@@@...@..@@@..@@@@@.@.@.@@@@@@
|
||||
.@@@@@..@@@@@@.@.@.@@@@@@@.@.@@@@@@@.@.@.@.@.@@@@.@@.@@@@@@@@.@@@@@@@.@@@@@@@@.@..@@@@.@@..@@@@.@@@.@@@.@@..@@@@.@@@@.@.@.@@@@..@@@@..@.@
|
||||
@@@@@@@@@@@@@.@.@@..@.....@.@@@.@.@...@....@.@@@@@@.@...@.@@@@@.@@@@@...@@@...@..@@..@@.....@@@.@@.@@@@@.@.@@.@@@.@@.@@@@@...@@.@@....@@.
|
||||
.@@@..@.@@@..@.@@.@..@@@@.@..@@@@..@@.@@@@@.@@@@.@.@...@@@@.@..@@@@@@.@@@.@@@.@.@......@@@@@@@@@.@.@@.@@@@@..@@.@@.@....@@@@@..@@@@.@@@@.
|
||||
@@@@@.@.@.@@..@@.@@@@@.@@@@@@.@@@@@@@@@..@@@@.@@.@@@.@.@@.@..@..@@@@.@@@@@.@@@@@@@@@@@.@@....@.@.@@@@.@@..@@@@....@.@@@..@@@.@.@@.@@.@.@@
|
||||
@.@@.@.@@@.@@@@.@@..@.@@@@@.@@.@@@@@@@@.@@@.@@..@@@@@@@@@..@@.@@@.@.@.@...@@..@@@....@....@@.@@@@.@.@@@.@@..@@@..@@@@.@@.@.@@@.@@@@@@@@.@
|
||||
@@@@.@@@@..@@.@.@@@..@@@@...@@@@.@@@@.@@@@..@@@@@@.@@@@@@.@@@@@@@.@@@.@.@@..@.@@@.@@@.@@.@..@@@.@..@@.@@@@@@@.@@@@@@@.@@..@@..@@@@..@@.@.
|
||||
.@.@@@@@@.....@.@.@@..@.@.@@@@.@@.@@...@.@..@@@.@..@@@@.@@@@@.@@@@..@@@@.@.@@@@..@@@@@@@@@.....@.@@@..@@.@@.@.@@...@@@@.@@.@@@.@@.@@.@.@@
|
||||
@@.@@.@@@...@.@.@@@@..@@@..@@.@@@..@.@@..@.@.@@@@@@@..@@@....@.@.@@@@@@@@.@.@.@@.@.@.@@@@@..@@.@@@..@@@@@...@@..@..@@@.@.@.@..@@@..@@@@@@
|
||||
@..@@.@.@.@.@.@.@@@@@@@@.@@@@@@@@@@@@@@@@@@.@@@@.@@@@..@.@..@.@..@@@..@@@@@@.@@@@..@@.@@.@@@@@@@@.@@@@@..@@@@@@.@.@....@@.@@@@.@@@@.@@...
|
||||
.@@@@@.....@@.@.@@.@@@@@.@.@@...@.@.@.@@@..@.@.@.@.@.@@@@@@@@.@@@@..@@@.@@@@@@@.@.@.@@@.@@..@@@@@.@@....@@@@.@@@.@.@@.@.@@..@.@.@@@.@@.@.
|
||||
@.@@..@@.@@@@@.@@@..@@@@@..@@..@@@.@@@@@@@.@@.@..@@@@.@@@@@.@@@@@@..@@@@@@@...@.@@..@.@@@.@@.@@.@@..@...@@.@@..@@.@...@..@@.@@.@@@@@.@@@.
|
||||
@@..@@@@.@@@@@@@@@@@@@@@.@@.@@@@@@@@@...@@@@...@@.@.@.@@@...@.@@@..@@@@.@@@@@@@@@@@@@@...@..@@.@@@@..@.@@@.@...@@@@@@.@@@@@..@..@@.@.@@@@
|
||||
@.@@@@.@@@@@..@@@.@@..@@@.@@@@@..@@.@@@...@..@.@.@.@@@.@@@.@@@@@.@@@@..@@@.@@@.@.@.@@@@..@@@@@@.@@@..@.@.@@@..@.@.@.@@@.@@@@@.@@@.@@...@@
|
||||
@.@@...@..@@@.@.@..@@@@@..@..@@@@@@@@.@..@.@@.@@@@.@...@.@@@@@..@.@@..@.@..@@@@@@.@.@.@@.@@@.@@@@@@@@@@@@@@@@@@@@@@@.@...@@@@@@@..@@..@@.
|
||||
@@@..@@.@..@@...@@.@@@@@@@...@@.@@@@@@@..@...@.@@@@.@@@@.@@@@@.@@.@@@...@@@.@...@...@@..@.@@@@.@.@.@@@..@@@@.@@@@..@@..@...@..@@@@..@@@@@
|
||||
@.@@@..@@...@@@@@@@@@@@@@.@@..@@@@...@@@@@@@...@@@@@.@..@@@@@.@@.@@.@@@@@@@@..@.@.@@@.@@@@@@@@@@@@@@@@.@.@..@@.@@.@.@@.@@.@@@.@@@.@.@.@.@
|
||||
..@.@@@@@@@.@.@@..@...@@@..@@@..@@@.@@@@@@.@.@@.@@.@@@@@@@.@@.@@@@@@..@.@@@@@@@.@@.@@@@@@@@@@@@@@.@@..@@@.@.@..@..@@@..@@@@@@@@@...@@@@@@
|
||||
@@@@@@@.@@@@@@.@..@..@@@@@@..@@@@.@@..@@@@.@.@.@@.@@@@@.@.@.@@@@@@@@...@@@@@.@@.@.@@@.@@@.@@.@.@@@@@@@@@@@.....@.....@.@@@@@.@@@@@@@....@
|
||||
@.@@@@@@.@@.@..@@@@.@@.@@.@@@.@.@@@@@.@..@@@@.@...@@..@.@.@@@@.@...@..@.@.@..@@@@.@@@.@@@.@@@@.......@@@.@.@@@...@@.@@.....@.@...@.@@@..@
|
||||
@@@@....@.@.@.@@.@@@.@@@@.@@@@@@@.@@@@@.@.@@@.@@@@.@@@@@@@.@@@@@@.@@@@.@..@@.@@@@...@@..@@.@..@.@..@.@@@@..@@.@@@..@.@@@@@@@@@.@@@@@.@@@@
|
||||
@@@@@@@@@@@@@....@@@@@..@@@.@.@@@@@@@@..@.@@.@@@@@@.@@@.@@.@....@..@@@@@@.@@@@..@@@@.@@@.@...@@@.@..@@.@.@@@..@@@.@@@@@.@..@@@@@.@@.@...@
|
||||
@.@@@@@..@@.@@.@@@@@.....@....@.@@@..@@.@@@@@.@@@@@@@@@@@@.@@@..@.@@.@@..@@@...@@..@.@@@@@@@@@@@..@@..@.@@...@@@@.@.@@@.@..@@..@@@.@@@@@.
|
||||
@@@.@@.@@@@@@@@..@.@..@@@@@.....@.@.@@@@@@.@@@@@.@.@@.@@@@.@.@.@@@@@@..@@@@.@@@@...@@@@....@@@.@@.@@@.@.@@@.@@@@.@@@....@@@@.@@@@@.@@@..@
|
||||
@.@@@...@@...@.@@@..@@@@@...@@.@@.@..@@@.@.@..@@.@@@@@@..@@...@@@@.@.@@..@..@..@@@.@.@@@@@..@.@@@.@..@.@@..@....@@@@@@@@@@@@@@.@@..@.@.@@
|
||||
@@@@@@.@@@...@.@.@@@@.@@@.@..@@@@@@.@.@@@@@@@@.@.@.@.@..@@@@..@@.@@..@@@.@@@@@.@@@@.@@@@@...@@...@@@..@@@@@.@@@.@@..@.@...@.@.@@..@..@@.@
|
||||
@...@@@@.@@@..@@@@.@@.@@.@....@.@...@@...@@.@@@.@.@.@@@...@..@.@@@.@@@@.@@@@..@@..@@@@.@.@@@..@@@.@..@....@@.@..@@@.@@@@@@.@@@@.@.@@@@@@.
|
||||
@.@@@.@@@@@@@.@@.@@@@@@@@@@@@@.@@@@@.@@@.@@.@.@@@.@.@.@.@.@@@@.@@.@..@@@@.@@@.@.@@@@@.@@@@...@.@...@.@.@@.@@@...@...@@.@.@.@@@@@...@@@.@.
|
||||
@@.@.@.@....@@..@...@@@.@@.@@@@..@@@@@@@.@@.@@...@..@..@....@@@@.@@@@@@..@.@..@@@@.@.@@@@@.@..@@@@@@@..@@.@...@@@@@.@@@@.@@..@@@.@@.@.@.@
|
||||
.@@@@@@@@.....@@@.@.@@@@.@.@@.@@.@@@.@@..@.@@@@@@@@....@@@@@@@@.@@.@@@.@.@....@..@.@@@@@@.@..@.@@.@..@.@.@@@@@..@@@..@.@@.@@@.@@@@@.@...@
|
||||
..@@.@@@..@@.@.@@@.@@@.@...@@@@@@.@..@@@.@..@@@@@.@@.@@@@@@@.@@@.@..@@..@@@@.@@@..@@@@..@.@@@@.@@@@@...@@....@@@@@.@@@...@@..@@@@.@@@@.@@
|
||||
@@@@@@..@.@@.@..@@.@@@@@@@..@@@@..@@@@@.@@@@@@.@@@@.@@@@@.@@@.@@...@@@@.@@@...@@@@@@.@.@@@..@@.@@@@....@@@@.@@@@.@@.@..@.@@@.@@@@.@@@...@
|
||||
......@@@@@@@@...@@@@@@@@...@@@@@.@@@@@.@@@@...@.@@@.@@.@...@@@.@...@.@@@@.@@@@..@...@@@......@@.@@@@@.@.@@@@.@.@@@@.@@@@.@..@@@.@@.@@..@
|
||||
....@...@@@.@@@@...@..@@@.@...@@@.@.@@..@@@@@@.@..@@@@@.@@@@@.@@@@@.@@.....@@@@@@...@@.@.@@@@@@@@..@@@@@@@@@.@@@..@.@...@@.@@@@@@..@@.@.@
|
||||
..@@@.@@@.@.@...@@@@.@@@@....@...@@@@@@.@@@@@@@@.@@.@@.@@@@@@@@@.@@@@@@..@@@@.@..@@.@@@.@@@.@@@@@....@...@@...@@.@..@@@@@@..@@...@@@.@.@.
|
||||
@@@@.@@@...@@.@.@@.@@.@@@@@@@.@@@@@.@@@..@...@.@.@.@.@@@@.@@....@@@@@.@@@@..@@@@@@@.@...@@@.@@..@..@.@..@@..@.@@@@@..@@.@@.@@@.@@@@.@@.@@
|
||||
.@.@@.@@@@@@..@@@@..@@..@@@.@..@@@@.@@@@..@@.@@@@@.@.@@.@@@@@@..@@@..@....@@@@@@@@@@@@@@.@@.@..@@@@..@@.@@@@@@.@.@.@.@@@@.@@.@....@.@@@@@
|
||||
@.@@@@@@.@@.@...@@.@@.@@@@@.@.@@@@@@.@@@...@@.@@@..@@..@..@@.@@@.@@.@@@..@@@..@..@.@@@.@@@.@....@.@@@@@..@@@.@@@.@.@@@@@@...@.@@..@@@@@@.
|
||||
.@@@.@@@@@@.@..@.@@@@@@.@@@@.@@@...@@@.@..@..@@.@.@...@.@@@@..@@@.@@@@...@@@.@@.@@@@@@.@@@.@@@.@.@..@..@..@...@@@@@@.@..@@..@@@@@@.@@.@@@
|
||||
.@@@@@.@@@.@.@.@@@.@..@.@...@@@@@..@@.@@@@.@.@@@.@@.@@@..@@@@..@@.@@@@@@@@.@@.@@@@..@@@.@@.@.@@.@.@.@@.@.@.@@.@.@@@.@@@.@@..@@@@..@..@.@@
|
||||
@@@@.@.@@.@@@..@@@@..@@@@@@@.@.@..@...@@..@.@@@.@@@@.@@..@.@@@@@...@.@..@.@.@@@.....@@.@@@@@@@.@@@@.@@.@@@@@@.@.@@..@@@@.@@..@@@.@@@.@@@.
|
||||
.@@....@@..@@@@@.@@@..@..@@@@@@@@@@.@@@.@@@@.@@@@@@@@..@@.@@@@..@@....@@..@.@@@@@..@@@@.@@@@@.@.@.@..@@@@..@@..@...@.@@...@.@.@@@@.@@..@.
|
||||
.@.@@@@.@@..@@@..@..@@.@@.@@@.@@.@...@..@.@.@@@@.@..@@..@.@@@..@@@...@@@@@.@@@@@@@.@@..@.@..@@@@@.@@@..@@@@@@@@@@@.@..@@@.@@..@..@@@...@@
|
||||
@...@.@.@@@@@@@@@@@@.@@.@.@.@@..@@@.@.@.@@...@@@@.@@.@@.@@@@@@...@@..@@@@.@@@@@..@@@@@@@.@@@@.@@..@@@@@@@@@@@@..@@..@.@@.@.@.@@@.@.@@@@@@
|
||||
@..@@@.@..@@@.@@@@@@.@@.@@.@@@..@@@..@@@.@.@@.@..@@@@@@.@...@@.@@...@@@@.@.@@@@.@@@@.@.@@@@@@@...@.@@@.@.....@.@.@@.@.@.@@@@@@@.@.@.@@@@.
|
||||
@.@@@.@@@.@@@@@@@@@@@.@@@@@@@@@..@@@@.@@..@@@@@...@@@....@@@@..@@..@@@@@.@@.@@.@.@.@@.@@@@.@.@..@@....@@..@.@@.@@@@..@.....@@@..@@.@..@..
|
||||
.@@...@...@.@@.@.@.@.@....@@@@@.@@..@.@..@@@..@@.@@@@@@...@.@@@.@.@@@@@@..@@.@.@...@.@@@..@@.@..@.@@.@....@@.@@.@@@...@@..@...@@@.@@.@@.@
|
||||
@@.@.@@@@...@@@@@@@@.@@....@.@...@.@.@.@@@@....@.@@.@@@..@@.@@@@@@@.@@@@@.@@.@@@.@.@@@.@.@..@@@.@@.@..@@.@@@.@@.@@@@@@@.@@@@@@..@..@@.@@.
|
||||
....@..@@@....@@@@.@@.@.@.@.@@@@.@.@@@.@..@@.@.@@@.@@@@..@@@.@..@...@@@..@@@@..@@@@@@..@@.@.@@@@@@@@...@@.@@..@...@.@.@@..@..@.@@.@@..@.@
|
||||
@@@@.@@@@@@@@@.@@@..@@..@..@.@..@@@.@.@.@@@@@...@@@@.@...@@@@@@@@.@.@..@@.@@@@@@@......@..@@@@.@@@..@.@@.@@.@.@@@...@@@@.@.@..@.@@@.@@@..
|
||||
@@.@@@@@.@@@.@@@@@..@...@@...@.@.@.@..@.@@@.@.@.@.@@.@@@@.@@@..@@@@...@@.@@.@@@@@@@.@@.@@.@@@.@@@.@@@@.@@@@@@.@.@@.@@@.@..@@.@@@@.@@@..@.
|
||||
@@@..@@.@.@.@@..@..@.@...@@@.@@@.@.@..@..@@@@@@@.@@.@@..@.@.@@@@.@.@..@.@.@@@...@.@.@@.@@@@..@.@@@@@.@@@..@@.@@@@@@@..@@@.@@@@@@@.@@@@@.@
|
||||
@@.@@...@@@.@@@@@@.@.@@.@@@@@@.@@@..@@.@@@.@@..@.@@.@..@@@@@@.@@@.....@.@@@@@.@@..@@..@@..@@.@.@@@@@@.@@.@.@@.@...@@@@@@.@.@@@...@@@.@@@@
|
||||
@@..@@@@.@.@.@@@@@@@@.@@.@.@@@.@@@@..@..@@@@@@.@@...@@.@@..@.@@..@@.@@@@.@@.@.@@@@@@@.@@@...@..@.@@...@@@@.@@..@.@@@@@@@@@.@@.@.@.@.@@@.@
|
||||
.@.@@..@@@@@....@@@.@@@.@@.@@...@.@@...@@@@@.@@@....@.@@.@@@@.@@@.@@@@@@..@@@@.@@@...@..@@@@@.@....@@@@.@.@.@.@@@@.@.@@@..@@.@@...@....@@
|
||||
@.@.@@...@@.@@...@.@..@..@@@...@.@@@.@@@@@@.@@@.@@@@@@@@...@@@.@..@...@..@@.@@@.@..@.@@@..@@@...@@@..@.@@@@@.@..@@.@..@@.@@@@@@@@.@..@.@@
|
||||
@@@..@.@..@.@@.@@@@@@.@@@.@@@....@@.@@@.@@@....@..@.@...@@..@@@@@@@@@@...@@.@@@.@@@.@@@@@@.@@.@...@.@@.@@@....@@.@@@.@.@@.@...@.@@@@.@@@@
|
||||
.@@@@..@@@.@.@.@@@.@..@@.@@.@.@@@@@@.@@@@.@@...@@@@.@@..@.@@.@@@@@@@@@..@@@@.@@@@.@.@@@....@@.@.@@.@@@@@@...@@@@@@@.@..@..@..@@.@.@.@....
|
||||
.@@@@@.@.@@.@.@@@@@@..@.@@.@@...@@.@@@@.@.@.@@@.@@@@....@.@@@@@@.@@@@.@@@@.@@.@@@@@@@@.@.@..@.@@@.@@@@@...@@.@..@.@@@.@.@@@@.....@.@.@@.@
|
||||
.@@.@@@.@@@.@@.@...@@...@@@@..@@.@@@..@.@@.@@.@.@@@@.@@@@.@..@@@@.@@@@@@.@.@@.@.@@..@@@@@@@@@.@@@@@.@@@@..@@@.@@.@@.@.@@@@@.@@@@@.@....@.
|
||||
@@.@@@.@@@@.....@@@.@.@@.@.@@.@@..@@@@@@..@@@@@@@@@@.@@@@@@@.@@..@@@@..@@..@@@.....@.@..@@@@.@@.@.@..@@..@@.@@..@.....@@.@@@...@.@.@.@@@@
|
||||
@..@@@@.@.@@@@.@.@.@.@.@..@.@..@@@@@.@@@.@@.@...@@@@.@@.@@@@@@@@..@@@@.@@@@.@@@@..@@@..@.@@.@@@@@@@@@.@.@@.@@@.@.@@@.@@.@@..@.@@@@@@..@.@
|
||||
37
2025/d05/ex1/ex1.py
Executable file
37
2025/d05/ex1/ex1.py
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
from typing import NamedTuple
|
||||
|
||||
|
||||
class Range(NamedTuple):
|
||||
start: int
|
||||
end: int
|
||||
|
||||
@classmethod
|
||||
def from_str(cls, input: str) -> "Range":
|
||||
start, end = input.split("-")
|
||||
return cls(int(start), int(end))
|
||||
|
||||
def contains(self, point: int) -> bool:
|
||||
return self.start <= point <= self.end
|
||||
|
||||
|
||||
def solve(input: str) -> int:
|
||||
def parse(input: str) -> tuple[list[Range], list[int]]:
|
||||
ranges, ids = input.split("\n\n")
|
||||
return [Range.from_str(r) for r in ranges.splitlines()], [
|
||||
int(n) for n in ids.splitlines()
|
||||
]
|
||||
|
||||
ranges, ids = parse(input)
|
||||
return sum(any(range.contains(id) for range in ranges) for id in ids)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
input = sys.stdin.read()
|
||||
print(solve(input))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
1178
2025/d05/ex1/input
Normal file
1178
2025/d05/ex1/input
Normal file
File diff suppressed because it is too large
Load diff
50
2025/d05/ex2/ex2.py
Executable file
50
2025/d05/ex2/ex2.py
Executable file
|
|
@ -0,0 +1,50 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
from typing import NamedTuple
|
||||
|
||||
|
||||
class Range(NamedTuple):
|
||||
start: int
|
||||
end: int
|
||||
|
||||
@classmethod
|
||||
def from_str(cls, input: str) -> "Range":
|
||||
start, end = input.split("-")
|
||||
return cls(int(start), int(end))
|
||||
|
||||
def contains(self, point: int) -> bool:
|
||||
return self.start <= point <= self.end
|
||||
|
||||
|
||||
def solve(input: str) -> int:
|
||||
def parse(input: str) -> tuple[list[Range], list[int]]:
|
||||
ranges, ids = input.split("\n\n")
|
||||
return [Range.from_str(r) for r in ranges.splitlines()], [
|
||||
int(n) for n in ids.splitlines()
|
||||
]
|
||||
|
||||
def merge_overlaps(ranges: list[Range]) -> list[Range]:
|
||||
# Sort ranges by start, then merge overlapping ones
|
||||
ranges = sorted(ranges)
|
||||
res = [ranges[0]]
|
||||
for interval in ranges[1:]:
|
||||
# `+ 1` to merge [0, 2] and [2, 5]
|
||||
if interval.start <= (res[-1].end + 1):
|
||||
res[-1] = Range(res[-1].start, max(interval.end, res[-1].end))
|
||||
else:
|
||||
res.append(interval)
|
||||
return res
|
||||
|
||||
ranges, _ = parse(input)
|
||||
ranges = merge_overlaps(ranges)
|
||||
return sum(range.end - range.start + 1 for range in ranges)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
input = sys.stdin.read()
|
||||
print(solve(input))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
1178
2025/d05/ex2/input
Normal file
1178
2025/d05/ex2/input
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue