From bd7c2709b4358e75102c721fd2d2c90bf7a33567 Mon Sep 17 00:00:00 2001 From: Skullheadx <704277@pdsb.net> Date: Wed, 4 Jan 2023 15:34:59 -0500 Subject: [PATCH] 2020 S1 --- Main/Python/2020/S1.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Main/Python/2020/S1.py diff --git a/Main/Python/2020/S1.py b/Main/Python/2020/S1.py new file mode 100644 index 0000000..3eb14fd --- /dev/null +++ b/Main/Python/2020/S1.py @@ -0,0 +1,24 @@ +from queue import PriorityQueue + +def get_speed(a,b): + return abs(a[1]-b[1])/abs(a[0]-b[0]) + + +q = PriorityQueue() +N = int(input()) +for i in range(N): + # T,X = + q.put(tuple(map(int, input().split()))) + + +output = None +prev = q.get() +while not q.empty(): + current = q.get() + + speed = get_speed(current, prev) + prev = current + if output is None or speed > output: + output = speed + +print(output) \ No newline at end of file -- 2.54.0