]> Skullheadx's Git Forge - CCC.git/commitdiff
2020 S1
authorSkullheadx <704277@pdsb.net>
Wed, 4 Jan 2023 20:34:59 +0000 (15:34 -0500)
committerSkullheadx <704277@pdsb.net>
Wed, 4 Jan 2023 20:34:59 +0000 (15:34 -0500)
Main/Python/2020/S1.py [new file with mode: 0644]

diff --git a/Main/Python/2020/S1.py b/Main/Python/2020/S1.py
new file mode 100644 (file)
index 0000000..3eb14fd
--- /dev/null
@@ -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