generated from public/aoc_template
25 lines
489 B
Python
25 lines
489 B
Python
my_input = open("inputs/input_3", "r").read().split("\n")
|
|
|
|
p1 = 0
|
|
read_sum = 0
|
|
for line in my_input:
|
|
number, base = line.split()
|
|
base = int(base)
|
|
number = int(number, base)
|
|
p1 += base
|
|
read_sum += number
|
|
|
|
p2 = read_sum
|
|
|
|
p3 = ""
|
|
b65chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#"
|
|
while read_sum > 64:
|
|
rem = read_sum % 65
|
|
read_sum = read_sum // 65
|
|
p3 = b65chars[rem] + p3
|
|
p3 = b65chars[read_sum] + p3
|
|
|
|
print(p1)
|
|
print(p2)
|
|
print(p3)
|