ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

Advent Of Code 2025 Solution

2026/8/6 5:08:41 拓冰建站 浏览量
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)%100else:st = (st+step)%100res += (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//100step = step%100if d == "L":if st-step <= 0 and st != 0:res += 1st = (st-step+100)%100else:if st+step >= 100 and st != 0:res += 1st = (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}\)