From: Skullheadx <94652084+Skullheadx@users.noreply.github.com> Date: Sat, 19 Nov 2022 20:52:51 +0000 (-0500) Subject: 2015 S3 X-Git-Url: http://git.skullheadx.com/nixos/static/now.html?a=commitdiff_plain;h=55a2a71f7e5cb9ddda9444d49e7dbcf5fb23f0f5;p=CCC.git 2015 S3 --- 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)