From 55a2a71f7e5cb9ddda9444d49e7dbcf5fb23f0f5 Mon Sep 17 00:00:00 2001 From: Skullheadx <94652084+Skullheadx@users.noreply.github.com> Date: Sat, 19 Nov 2022 15:52:51 -0500 Subject: [PATCH] 2015 S3 --- Main/Python/2015/S3.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Main/Python/2015/S3.py diff --git a/Main/Python/2015/S3.py b/Main/Python/2015/S3.py new file mode 100644 index 0000000..3fee27f --- /dev/null +++ b/Main/Python/2015/S3.py @@ -0,0 +1,20 @@ +G = int(input()) +P = int(input()) + +closed = False +count= 0 +docks = set() +for i in range(P): + g = int(input()) + if not closed: + can_land = False + for d in range(g,0,-1): + if d not in docks: + docks.add(d) + can_land = True + break + if not can_land: + closed = True + else: + count += 1 +print(count) -- 2.54.0