foundation

This commit is contained in:
hofmannol 2024-04-09 16:07:35 +02:00
parent 1b50c6e5d9
commit fe69f32484

View File

@ -250,7 +250,9 @@ class AlgoDatArray:
def __init__(self, size):
self.size = size
self.array = [AlgoDatValue(None)] * size
self.array = []
for i in range(size):
self.array.append(AlgoDatValue(None))
def set(self, index, value):
assert isinstance(value, AlgoDatValue)
@ -323,6 +325,7 @@ def read_int_sequence(filename: str) -> AlgoDatArray:
with open(filename, "r") as file:
l = list(map(int, file.read().split()))
a = AlgoDatArray(len(l))
AlgoDatValue.memory -= len(l)
for i in range(len(l)):
a.set(i, AlgoDatValue(l[i]))
return a