Skip to content

Commit 39df0ec

Browse files
committed
fixes
1 parent 9bdf982 commit 39df0ec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+11831
-11825
lines changed

Diff for: .gitignore

+134-134
Original file line numberDiff line numberDiff line change
@@ -1,135 +1,135 @@
1-
# Byte-compiled / optimized / DLL files
2-
__pycache__/
3-
*.py[cod]
4-
*$py.class
5-
6-
# C extensions
7-
*.so
8-
9-
# AoC
10-
.aoctiles/
11-
*.yaml
12-
13-
# Distribution / packaging
14-
.Python
15-
.idea/
16-
build/
17-
develop-eggs/
18-
dist/
19-
downloads/
20-
eggs/
21-
.eggs/
22-
lib/
23-
lib64/
24-
parts/
25-
sdist/
26-
var/
27-
wheels/
28-
pip-wheel-metadata/
29-
share/python-wheels/
30-
*.egg-info/
31-
.installed.cfg
32-
*.egg
33-
MANIFEST
34-
35-
# PyInstaller
36-
# Usually these files are written by a python script from a template
37-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
38-
*.manifest
39-
*.spec
40-
41-
# Installer logs
42-
pip-log.txt
43-
pip-delete-this-directory.txt
44-
45-
# Unit test / coverage reports
46-
htmlcov/
47-
.tox/
48-
.nox/
49-
.coverage
50-
.coverage.*
51-
.cache
52-
nosetests.xml
53-
coverage.xml
54-
*.cover
55-
*.py,cover
56-
.hypothesis/
57-
.pytest_cache/
58-
59-
# Translations
60-
*.mo
61-
*.pot
62-
63-
# Django stuff:
64-
*.log
65-
local_settings.py
66-
db.sqlite3
67-
db.sqlite3-journal
68-
69-
# Flask stuff:
70-
instance/
71-
.webassets-cache
72-
73-
# Scrapy stuff:
74-
.scrapy
75-
76-
# Sphinx documentation
77-
docs/_build/
78-
79-
# PyBuilder
80-
target/
81-
82-
# Jupyter Notebook
83-
.ipynb_checkpoints
84-
85-
# IPython
86-
profile_default/
87-
ipython_config.py
88-
89-
# pyenv
90-
.python-version
91-
92-
# pipenv
93-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
94-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
95-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
96-
# install all needed dependencies.
97-
#Pipfile.lock
98-
99-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
100-
__pypackages__/
101-
102-
# Celery stuff
103-
celerybeat-schedule
104-
celerybeat.pid
105-
106-
# SageMath parsed files
107-
*.sage.py
108-
109-
# Environments
110-
.env
111-
.venv
112-
env/
113-
.env/
114-
venv/
115-
ENV/
116-
env.bak/
117-
venv.bak/
118-
119-
# Spyder project settings
120-
.spyderproject
121-
.spyproject
122-
123-
# Rope project settings
124-
.ropeproject
125-
126-
# mkdocs documentation
127-
/site
128-
129-
# mypy
130-
.mypy_cache/
131-
.dmypy.json
132-
dmypy.json
133-
134-
# Pyre type checker
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# AoC
10+
.aoctiles/
11+
*.yaml
12+
13+
# Distribution / packaging
14+
.Python
15+
.idea/
16+
build/
17+
develop-eggs/
18+
dist/
19+
downloads/
20+
eggs/
21+
.eggs/
22+
lib/
23+
lib64/
24+
parts/
25+
sdist/
26+
var/
27+
wheels/
28+
pip-wheel-metadata/
29+
share/python-wheels/
30+
*.egg-info/
31+
.installed.cfg
32+
*.egg
33+
MANIFEST
34+
35+
# PyInstaller
36+
# Usually these files are written by a python script from a template
37+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
38+
*.manifest
39+
*.spec
40+
41+
# Installer logs
42+
pip-log.txt
43+
pip-delete-this-directory.txt
44+
45+
# Unit test / coverage reports
46+
htmlcov/
47+
.tox/
48+
.nox/
49+
.coverage
50+
.coverage.*
51+
.cache
52+
nosetests.xml
53+
coverage.xml
54+
*.cover
55+
*.py,cover
56+
.hypothesis/
57+
.pytest_cache/
58+
59+
# Translations
60+
*.mo
61+
*.pot
62+
63+
# Django stuff:
64+
*.log
65+
local_settings.py
66+
db.sqlite3
67+
db.sqlite3-journal
68+
69+
# Flask stuff:
70+
instance/
71+
.webassets-cache
72+
73+
# Scrapy stuff:
74+
.scrapy
75+
76+
# Sphinx documentation
77+
docs/_build/
78+
79+
# PyBuilder
80+
target/
81+
82+
# Jupyter Notebook
83+
.ipynb_checkpoints
84+
85+
# IPython
86+
profile_default/
87+
ipython_config.py
88+
89+
# pyenv
90+
.python-version
91+
92+
# pipenv
93+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
94+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
95+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
96+
# install all needed dependencies.
97+
#Pipfile.lock
98+
99+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
100+
__pypackages__/
101+
102+
# Celery stuff
103+
celerybeat-schedule
104+
celerybeat.pid
105+
106+
# SageMath parsed files
107+
*.sage.py
108+
109+
# Environments
110+
.env
111+
.venv
112+
env/
113+
.env/
114+
venv/
115+
ENV/
116+
env.bak/
117+
venv.bak/
118+
119+
# Spyder project settings
120+
.spyderproject
121+
.spyproject
122+
123+
# Rope project settings
124+
.ropeproject
125+
126+
# mkdocs documentation
127+
/site
128+
129+
# mypy
130+
.mypy_cache/
131+
.dmypy.json
132+
dmypy.json
133+
134+
# Pyre type checker
135135
.pyre/

Diff for: .img/2022/22.png

8 Bytes
Loading

Diff for: .img/2022/25.png

-1 Bytes
Loading

Diff for: .img/2023/12.png

8.57 KB
Loading

Diff for: .img/2023/13.png

8.92 KB
Loading

Diff for: .img/2023/14.png

7.98 KB
Loading

Diff for: .img/2023/15.png

8.66 KB
Loading

Diff for: .img/2023/16.png

8.91 KB
Loading

Diff for: .img/2023/17.png

4.03 KB
Loading

Diff for: .img/2023/18.png

8.91 KB
Loading

Diff for: .img/2023/19.png

8.84 KB
Loading

Diff for: .img/2023/20.png

9.26 KB
Loading

Diff for: .img/2023/21.png

7.02 KB
Loading

Diff for: .img/2023/22.png

4.13 KB
Loading

Diff for: .img/2023/23.png

9.63 KB
Loading

Diff for: .img/2023/24.png

8.48 KB
Loading

Diff for: .img/2023/25.png

7.48 KB
Loading

Diff for: 2022/01/main.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
with open('input.txt') as file:
2-
lines = file.read().strip().split('\n\n')
3-
4-
cal = sorted([sum(map(int, line.split('\n'))) for line in lines])
5-
6-
print(cal[-1])
7-
print(sum(cal[-3:]))
1+
with open('input.txt') as file:
2+
lines = file.read().strip().split('\n\n')
3+
4+
cal = sorted([sum(map(int, line.split('\n'))) for line in lines])
5+
6+
print(cal[-1])
7+
print(sum(cal[-3:]))

Diff for: 2022/01/test.txt

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
1000
2-
2000
3-
3000
4-
5-
4000
6-
7-
5000
8-
6000
9-
10-
7000
11-
8000
12-
9000
13-
1+
1000
2+
2000
3+
3000
4+
5+
4000
6+
7+
5000
8+
6000
9+
10+
7000
11+
8000
12+
9000
13+
1414
10000

Diff for: 2022/02/main.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
with open('input.txt') as file:
2-
lines = [i.strip().split(' ') for i in file.read().strip().splitlines()]
3-
4-
win, loss = {3: 1, 2: 3, 1: 2}, {1: 3, 3: 2, 2: 1}
5-
options = [[ord(i[0]) - (ord('A') - 1), ord(i[1]) - (ord('X') - 1)] for i in lines if i]
6-
rps = lambda p1, p2: 3 + p2 if not p1 - p2 else 6 + p2 if win[p1] == p2 else p2
7-
print(sum([rps(*i) for i in options]))
8-
print(sum([rps(i[0], {1: loss[i[0]], 2: i[0], 3: win[i[0]]}[i[1]]) for i in options]))
1+
with open('input.txt') as file:
2+
lines = [i.strip().split(' ') for i in file.read().strip().splitlines()]
3+
4+
win, loss = {3: 1, 2: 3, 1: 2}, {1: 3, 3: 2, 2: 1}
5+
options = [[ord(i[0]) - (ord('A') - 1), ord(i[1]) - (ord('X') - 1)] for i in lines if i]
6+
rps = lambda p1, p2: 3 + p2 if not p1 - p2 else 6 + p2 if win[p1] == p2 else p2
7+
print(sum([rps(*i) for i in options]))
8+
print(sum([rps(i[0], {1: loss[i[0]], 2: i[0], 3: win[i[0]]}[i[1]]) for i in options]))

Diff for: 2022/02/test.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
A Y
2-
B X
1+
A Y
2+
B X
33
C Z

Diff for: 2022/03/test.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
vJrwpWtwJgWrhcsFMMfFFhFp
2-
jqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL
3-
PmmdzqPrVvPwwTWBwg
4-
wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn
5-
ttgJtRGJQctTZtZT
1+
vJrwpWtwJgWrhcsFMMfFFhFp
2+
jqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL
3+
PmmdzqPrVvPwwTWBwg
4+
wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn
5+
ttgJtRGJQctTZtZT
66
CrZsJsPPZsGzwwsLwLmpwMDw

Diff for: 2022/04/main.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
with open('input.txt') as file:
2-
lines = [line.rstrip() for line in file]
3-
4-
total1, total2 = 0, 0
5-
for line in lines:
6-
[a, b], [c, d] = ([list(map(int, i)) for i in [j.split('-') for j in (line.split(','))]])
7-
if (a - c) * (b - d) <= 0:
8-
total1 += 1
9-
if (b - c) * (a - d) <= 0:
10-
total2 += 1
11-
print(total1)
12-
print(total2)
1+
with open('input.txt') as file:
2+
lines = [line.rstrip() for line in file]
3+
4+
total1, total2 = 0, 0
5+
for line in lines:
6+
[a, b], [c, d] = ([list(map(int, i)) for i in [j.split('-') for j in (line.split(','))]])
7+
if (a - c) * (b - d) <= 0:
8+
total1 += 1
9+
if (b - c) * (a - d) <= 0:
10+
total2 += 1
11+
print(total1)
12+
print(total2)

Diff for: 2022/04/test.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
2-4,6-8
2-
2-3,4-5
3-
5-7,7-9
4-
2-8,3-7
5-
6-6,4-6
1+
2-4,6-8
2+
2-3,4-5
3+
5-7,7-9
4+
2-8,3-7
5+
6-6,4-6
66
2-6,4-8

0 commit comments

Comments
 (0)