From 4a5e70e6842f7eda7ead3a2922c1d6215bcc674a Mon Sep 17 00:00:00 2001 From: injoon2019 Date: Sat, 20 Aug 2022 18:23:36 +0900 Subject: [PATCH] =?UTF-8?q?14906=20=ED=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../14906_python_\355\206\240\353\245\264.py" | 57 +++++++++++++++++++ .../16498_python_\355\206\240\353\245\264.py" | 14 +++++ 2 files changed, 71 insertions(+) create mode 100644 "8\354\243\274\354\260\250/14906/14906_python_\355\206\240\353\245\264.py" create mode 100644 "8\354\243\274\354\260\250/16498/16498_python_\355\206\240\353\245\264.py" diff --git "a/8\354\243\274\354\260\250/14906/14906_python_\355\206\240\353\245\264.py" "b/8\354\243\274\354\260\250/14906/14906_python_\355\206\240\353\245\264.py" new file mode 100644 index 0000000..7251b78 --- /dev/null +++ "b/8\354\243\274\354\260\250/14906/14906_python_\355\206\240\353\245\264.py" @@ -0,0 +1,57 @@ +from collections import deque +import sys +import copy +from collections import defaultdict +import heapq + +print("SLURPYS OUTPUT") +N = int(input()) + + +def is_slump(string): + if len(string) >= 1 and not (string[0] == "D" or string[0] == "E"): + return False + for i in range(1, len(string)): + if len(string) > 2 and string[1] != "F": + return False + if len(string) >= 1 and i == len(string) - 1: + return string[-1] == "G" + if string[i] == "F": + continue + else: + return is_slump(string[i:]) + +def is_slimp(string): + if len(string) >= 1 and string[0] != "A": + return False + + if len(string) < 2: + return False + + if len(string) == 2: + return string[1] == "H" + else: + if len(string) >= 2 and string[0] == "A" and string[1] == "B" and is_slimp(string[2:-1]) and string[-1] == "C": + return True + elif len(string) >= 2 and string[0] == "A" and is_slump(string[1:-1]) and string[-1] == "C": + return True + else: + return False + + +def is_slurpy(string): + for i in range(len(string)): + if is_slimp(string[:i]): + if is_slump(string[i:]): + return True + return False + + +for _ in range(N): + sentence = input() + result = is_slurpy(sentence) + if result: + print("YES") + else: + print("NO") +print("END OF OUTPUT") diff --git "a/8\354\243\274\354\260\250/16498/16498_python_\355\206\240\353\245\264.py" "b/8\354\243\274\354\260\250/16498/16498_python_\355\206\240\353\245\264.py" new file mode 100644 index 0000000..dc0554c --- /dev/null +++ "b/8\354\243\274\354\260\250/16498/16498_python_\355\206\240\353\245\264.py" @@ -0,0 +1,14 @@ +from collections import deque +import sys +import copy +from collections import defaultdict +import heapq + +input = sys.stdin.readline + +A, B, C = map(int, input().split()) +a_numbers = sorted(list(map(int, input().split()))) +b_numbers = sorted(list(map(int, input().split()))) +c_numbers = sorted(list(map(int, input().split()))) + +answer = sys.maxsize