From 0294e78e9385ee1c04fff2ed4c346a781af3e95e Mon Sep 17 00:00:00 2001 From: Zeheng Li Date: Tue, 3 Oct 2023 16:37:28 -0600 Subject: [PATCH] more examples --- src/cosmicpathoptimization.py | 5 +++++ src/spacerace.py | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 src/cosmicpathoptimization.py create mode 100644 src/spacerace.py diff --git a/src/cosmicpathoptimization.py b/src/cosmicpathoptimization.py new file mode 100644 index 0000000..d69214c --- /dev/null +++ b/src/cosmicpathoptimization.py @@ -0,0 +1,5 @@ +import math + +m = int(input()) +t = [int(d) for d in input().split()] +print(f"{math.floor(sum(t)/m)}") diff --git a/src/spacerace.py b/src/spacerace.py new file mode 100644 index 0000000..3e04a3e --- /dev/null +++ b/src/spacerace.py @@ -0,0 +1,8 @@ +n = int(input()) +_ = input() +d = {} +for _ in range(n): + entry = input().split() + d[entry[0]] = float(entry[-1]) + +print(min(d, key=lambda k: d[k]))