Fixed spliting at spaces issue
This commit is contained in:
@@ -48,7 +48,7 @@ def construct(sections: list[int], target: int) -> dict[int, int]:
|
|||||||
# All modules for CS 412 must include a main method that allows it
|
# All modules for CS 412 must include a main method that allows it
|
||||||
# to imported and invoked from other python scripts
|
# to imported and invoked from other python scripts
|
||||||
def main():
|
def main():
|
||||||
sections: list[int] = list(map(int, input().split(" ")))
|
sections: list[int] = list(map(int, input().split()))
|
||||||
target: int = int(input())
|
target: int = int(input())
|
||||||
|
|
||||||
best_sections = construct(sections, target)
|
best_sections = construct(sections, target)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import sys
|
|||||||
# All modules for CS 412 must include a main method that allows it
|
# All modules for CS 412 must include a main method that allows it
|
||||||
# to imported and invoked from other python scripts
|
# to imported and invoked from other python scripts
|
||||||
def main():
|
def main():
|
||||||
sounds: list[str] = sys.stdin.readline().strip().split(" ")
|
sounds: list[str] = sys.stdin.readline().strip().split()
|
||||||
num_animals: int = int(sys.stdin.readline().strip())
|
num_animals: int = int(sys.stdin.readline().strip())
|
||||||
|
|
||||||
animal_map: dict[str, str] = {}
|
animal_map: dict[str, str] = {}
|
||||||
|
|||||||
@@ -12,18 +12,17 @@ import sys
|
|||||||
# to imported and invoked from other python scripts
|
# to imported and invoked from other python scripts
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
sounds: list[str] = sys.stdin.readline().strip().split(" ")
|
sounds: list[str] = sys.stdin.readline().strip().split()
|
||||||
num_animals: int = int(sys.stdin.readline().strip())
|
num_animals: int = int(sys.stdin.readline().strip())
|
||||||
|
|
||||||
fox_sounds: list[str] = []
|
fox_sounds: list[str] = []
|
||||||
animals_ecountered: list[str] = []
|
animals_ecountered: list[str] = []
|
||||||
|
|
||||||
animal_sounds: list[tuple[str, str]] = list(
|
animal_sounds: list[tuple[str, str]] = []
|
||||||
map(
|
|
||||||
lambda line: line.strip().split(" goes "),
|
for line in sys.stdin.readlines()[:num_animals]:
|
||||||
sys.stdin.readlines()[:num_animals],
|
split_line = line.strip().split(" goes ")
|
||||||
)
|
animal_sounds.append((split_line[0], split_line[1]))
|
||||||
)
|
|
||||||
|
|
||||||
for sound in sounds:
|
for sound in sounds:
|
||||||
animal_found = False
|
animal_found = False
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ def tile(grid: np.ndarray, hole: tuple[int, int]) -> None:
|
|||||||
# to imported and invoked from other python scripts
|
# to imported and invoked from other python scripts
|
||||||
def main():
|
def main():
|
||||||
n: int = int(input())
|
n: int = int(input())
|
||||||
x, y = map(int, input().split(" "))
|
x, y = map(int, input().split())
|
||||||
|
|
||||||
grid: np.ndarray = np.zeros((2**n, 2**n), dtype=int)
|
grid: np.ndarray = np.zeros((2**n, 2**n), dtype=int)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user