aboutsummaryrefslogtreecommitdiff
path: root/2025/01/a.py
diff options
context:
space:
mode:
Diffstat (limited to '2025/01/a.py')
-rw-r--r--2025/01/a.py8
1 files changed, 7 insertions, 1 deletions
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 @@
1import fileinput 1import fileinput
2 2
3p = 50
4c = 0
3with fileinput.input() as lines: 5with fileinput.input() as lines:
4 for line in lines: 6 for line in lines:
5 ... 7 s = 1 if line[0] == "R" else -1
8 p = (p + s * int(line[1:])) % 100
9 if p == 0:
10 c += 1
6 11
12print(c)

Generated with cgit - Back to sebastiano.tronto.net