From bdcdf6f58271008c590ac9157e73c901280d092a Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 1 Dec 2025 06:54:43 +0100 Subject: Day 1 I am stupid and I don't know why --- 2025/01/a.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to '2025/01/a.py') diff --git a/2025/01/a.py b/2025/01/a.py index 5fdb11b..114acb4 100644 --- a/2025/01/a.py +++ b/2025/01/a.py @@ -1,6 +1,12 @@ import fileinput +p = 50 +c = 0 with fileinput.input() as lines: for line in lines: - ... + s = 1 if line[0] == "R" else -1 + p = (p + s * int(line[1:])) % 100 + if p == 0: + c += 1 +print(c) -- cgit v1.3