Advent Of Code 2025 Solution
\[\Large\texttt{Advent Of Code 2025}
\]
\(\texttt{Intro}\)
今年怎么变成只有 12 天了 qwq
这是一个从每年 12 月 1 日开始的为期 12 天的编程挑战,每天中午 1 pm 会公布一道题。
每道题会有两个部分,你需要用编程解决每一个部分。
本文会使用 C++,Python 进行编程。
网址:https://adventofcode.com/2025
\(\texttt{Day 1}\)
\(\texttt{Part 1}\)
data = open(0).readlines()
st = 50
res = 0
for it in data:
d, step = it[0], int(it[1:])
if d == "L":
st = (st-step+100)%100
else:
st = (st+step)%100
res += (st == 0)
print(res)
\(\texttt{Part 2}\)
data = open(0).readlines()
st = 50
res = 0
for it in data:
d, step = it[0], int(it[1:])
res += step//100
step = step%100
if d == "L":
if st-step <= 0 and st != 0:
res += 1
st = (st-step+100)%100
else:
if st+step >= 100 and st != 0:
res += 1
st = (st+step)%100
print(res)
\(\texttt{Day 2}\)
\(\texttt{Part 1}\)
\(\texttt{Part 2}\)
\(\texttt{Day 3}\)
\(\texttt{Part 1}\)
\(\texttt{Part 2}\)
\(\texttt{Day 4}\)
\(\texttt{Part 1}\)
\(\texttt{Part 2}\)
\(\texttt{Day 5}\)
\(\texttt{Part 1}\)
\(\texttt{Part 2}\)
\(\texttt{Day 6}\)
\(\texttt{Part 1}\)
\(\texttt{Part 2}\)
\(\texttt{Day 7}\)
\(\texttt{Part 1}\)
\(\texttt{Part 2}\)
\(\texttt{Day 8}\)
\(\texttt{Part 1}\)
\(\texttt{Part 2}\)
\(\texttt{Day 9}\)
\(\texttt{Part 1}\)
\(\texttt{Part 2}\)
\(\texttt{Day 10}\)
\(\texttt{Part 1}\)
\(\texttt{Part 2}\)
\(\texttt{Day 11}\)
\(\texttt{Part 1}\)
\(\texttt{Part 2}\)
\(\texttt{Day 12}\)
\(\texttt{Part 1}\)
\(\texttt{Part 2}\)

浙公网安备 33010602011771号