From: Skullheadx <704277@pdsb.net> Date: Wed, 4 Jan 2023 20:34:59 +0000 (-0500) Subject: 2020 S1 X-Git-Url: http://git.skullheadx.com/phil/index.html?a=commitdiff_plain;h=bd7c2709b4358e75102c721fd2d2c90bf7a33567;p=CCC.git 2020 S1 --- 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