From 586544788e664ff0cc68ab676300e24d7229cf82 Mon Sep 17 00:00:00 2001 From: bellaria19 <52782842+bellaria19@users.noreply.github.com> Date: Wed, 8 May 2024 14:29:54 +0900 Subject: [PATCH 01/10] =?UTF-8?q?10851=EB=B2=88=20-=20=EC=88=AB=EC=9E=90?= =?UTF-8?q?=20=EC=B9=B4=EB=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 201902738/10851.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 201902738/10851.py diff --git a/201902738/10851.py b/201902738/10851.py new file mode 100644 index 0000000..a477f3e --- /dev/null +++ b/201902738/10851.py @@ -0,0 +1,18 @@ +import sys + +N = int(sys.stdin.readline()) + +card_list = list(map(int, sys.stdin.readline().strip().split())) + +M = int(sys.stdin.readline()) +num_list = list(map(int, sys.stdin.readline().strip().split())) + +card_dict = {} +for card in card_list: + card_dict[card] = 1 + +for num in num_list: + if num in card_dict: + print(1, end=' ') + else: + print(0, end=' ') From 527bb36e2dfc49ff1eb7e3079c078370ae633b32 Mon Sep 17 00:00:00 2001 From: bellaria19 <52782842+bellaria19@users.noreply.github.com> Date: Wed, 8 May 2024 14:30:15 +0900 Subject: [PATCH 02/10] =?UTF-8?q?14425=EB=B2=88=20-=20=EB=AC=B8=EC=9E=90?= =?UTF-8?q?=EC=97=B4=20=EC=A7=91=ED=95=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 201902738/14425.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 201902738/14425.py diff --git a/201902738/14425.py b/201902738/14425.py new file mode 100644 index 0000000..7da9967 --- /dev/null +++ b/201902738/14425.py @@ -0,0 +1,16 @@ +import sys + +N, M = map(int, sys.stdin.readline().strip().split()) + +str_list = {} + +for _ in range(N): + str_list[sys.stdin.readline().strip()] = 1 + +count = 0 +for _ in range(M): + input = sys.stdin.readline().strip() + if input in str_list: + count += 1 + +print(count) From 91fadd347c3056cc778e7e7f3e8e4f9a4cf47249 Mon Sep 17 00:00:00 2001 From: bellaria19 <52782842+bellaria19@users.noreply.github.com> Date: Wed, 8 May 2024 14:30:35 +0900 Subject: [PATCH 03/10] =?UTF-8?q?7785=EB=B2=88=20-=20=ED=9A=8C=EC=82=AC?= =?UTF-8?q?=EC=97=90=20=EC=9E=88=EB=8A=94=20=EC=82=AC=EB=9E=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 201902738/7785.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 201902738/7785.py diff --git a/201902738/7785.py b/201902738/7785.py new file mode 100644 index 0000000..edfc797 --- /dev/null +++ b/201902738/7785.py @@ -0,0 +1,15 @@ +import sys + +N = int(sys.stdin.readline()) + +people = {} +for _ in range(N): + name, option = sys.stdin.readline().strip().split() + if option == 'enter': + people[name] = 1 + else: + del(people[name]) + +people = sorted(people.keys(), reverse=True) +for person in people: + print(person) From 0c1f0c8a1a1b775b048d3bea6e55d3b9283fa035 Mon Sep 17 00:00:00 2001 From: bellaria19 <52782842+bellaria19@users.noreply.github.com> Date: Wed, 8 May 2024 14:30:58 +0900 Subject: [PATCH 04/10] =?UTF-8?q?1620=EB=B2=88=20-=20=EB=82=98=EB=8A=94?= =?UTF-8?q?=EC=95=BC=20=ED=8F=AC=EC=BC=93=EB=AA=AC=20=EB=A7=88=EC=8A=A4?= =?UTF-8?q?=ED=84=B0=20=EC=9D=B4=EB=8B=A4=EC=86=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 201902738/1620.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 201902738/1620.py diff --git a/201902738/1620.py b/201902738/1620.py new file mode 100644 index 0000000..9436796 --- /dev/null +++ b/201902738/1620.py @@ -0,0 +1,14 @@ +import sys + +N, M = map(int, sys.stdin.readline().strip().split()) + +pokemon_dict = {} + +for i in range(N): + pokemon = sys.stdin.readline().strip() + pokemon_dict[pokemon] = str(i + 1) + pokemon_dict[str(i + 1)] = pokemon + +for _ in range(M): + input = sys.stdin.readline().strip() + print(pokemon_dict[input]) From 2180ea182b96df41f4e92efd79e03b4cd701412e Mon Sep 17 00:00:00 2001 From: bellaria19 <52782842+bellaria19@users.noreply.github.com> Date: Wed, 8 May 2024 14:31:15 +0900 Subject: [PATCH 05/10] =?UTF-8?q?1764=EB=B2=88=20-=20=EB=93=A3=EB=B3=B4?= =?UTF-8?q?=EC=9E=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 201902738/1764.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 201902738/1764.py diff --git a/201902738/1764.py b/201902738/1764.py new file mode 100644 index 0000000..2d01054 --- /dev/null +++ b/201902738/1764.py @@ -0,0 +1,20 @@ +import sys + +N, M = map(int, sys.stdin.readline().strip().split()) + +people = {} +for _ in range(N): + people[sys.stdin.readline().strip()] = 0 + +count = 0 +for _ in range(M): + name = sys.stdin.readline().strip() + if name in people: + people[name] += 1 + count += 1 + +people = sorted(people.items(), key=lambda x: x[0]) +print(count) +for k, v in people: + if v > 0: + print(k) From 32c62aa26f2f5aa9e71b6fc47aeacda8045b0e63 Mon Sep 17 00:00:00 2001 From: bellaria19 <52782842+bellaria19@users.noreply.github.com> Date: Fri, 10 May 2024 00:12:42 +0900 Subject: [PATCH 06/10] =?UTF-8?q?25206=EB=B2=88=20-=20=EB=84=88=EC=9D=98?= =?UTF-8?q?=20=ED=8F=89=EC=A0=90=EC=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 201902738/25206.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 201902738/25206.py diff --git a/201902738/25206.py b/201902738/25206.py new file mode 100644 index 0000000..8c3a24c --- /dev/null +++ b/201902738/25206.py @@ -0,0 +1,13 @@ +import sys + +score = {"A+": 4.5, "A0": 4.0, "B+": 3.5, "B0": 3.0, "C+": 2.5, "C0": 2.0, "D+": 1.5, "D0": 1.0, "F": 0.0} + +sum_credits = 0 +sum_grade = 0 +for _ in range(20): + name, credit, rank = map(str, sys.stdin.readline().strip().split()) + if rank != "P": + sum_credits += float(credit) + sum_grade += score[rank] * float(credit) + +print("%.6f" % (sum_grade / sum_credits)) From a737f5c7e5c4c2e3e83b467afcbef70a0f088233 Mon Sep 17 00:00:00 2001 From: bellaria19 <52782842+bellaria19@users.noreply.github.com> Date: Fri, 10 May 2024 00:13:20 +0900 Subject: [PATCH 07/10] =?UTF-8?q?1269=EB=B2=88=20-=20=EB=8C=80=EC=B9=AD?= =?UTF-8?q?=EC=B0=A8=EC=A7=91=ED=95=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 201902738/1269.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 201902738/1269.py diff --git a/201902738/1269.py b/201902738/1269.py new file mode 100644 index 0000000..e13f915 --- /dev/null +++ b/201902738/1269.py @@ -0,0 +1,11 @@ +import sys + +A, B = map(int, sys.stdin.readline().strip().split()) + +setA = set(list(map(int, sys.stdin.readline().strip().split()))) +setB = set(list(map(int, sys.stdin.readline().strip().split()))) + +sub_setA = setA - setB +sub_setB = setB - setA + +print(len(sub_setA) + len(sub_setB)) From 37437f4705d1e6b4547691bfa13e32b77632c600 Mon Sep 17 00:00:00 2001 From: bellaria19 <52782842+bellaria19@users.noreply.github.com> Date: Fri, 10 May 2024 00:14:05 +0900 Subject: [PATCH 08/10] =?UTF-8?q?1205=EB=B2=88=20-=20=EB=93=B1=EC=88=98=20?= =?UTF-8?q?=EA=B5=AC=ED=95=98=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 201902738/1205.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 201902738/1205.py diff --git a/201902738/1205.py b/201902738/1205.py new file mode 100644 index 0000000..2d61a69 --- /dev/null +++ b/201902738/1205.py @@ -0,0 +1,16 @@ +import sys + +N, S, P = map(int, sys.stdin.readline().strip().split()) +tmp = 0 +if N != 0: + Scores = list(map(int, sys.stdin.readline().strip().split())) + Scores.append(S) + Scores.sort(reverse=True) + tmp = Scores.index(S) + 1 + dup = Scores.count(S) + if tmp + dup - 1 > P: + print(-1) + else: + print(tmp) +else: + print(1) From 52288b4ed99e23291e11fd39e74511c8aa17ecd7 Mon Sep 17 00:00:00 2001 From: bellaria19 <52782842+bellaria19@users.noreply.github.com> Date: Fri, 10 May 2024 00:14:39 +0900 Subject: [PATCH 09/10] =?UTF-8?q?1149=EB=B2=88=20-=20RGB=EA=B1=B0=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 201902738/1149.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 201902738/1149.py diff --git a/201902738/1149.py b/201902738/1149.py new file mode 100644 index 0000000..eb81857 --- /dev/null +++ b/201902738/1149.py @@ -0,0 +1,16 @@ +import sys + +N = int(sys.stdin.readline()) +RGB = [] +PREV = "" + +for i in range(N): + r, g, b = map(int, sys.stdin.readline().strip().split()) + if i == 0: + RGB.append([r, g, b]) + else: + RGB.append([r + min(RGB[i - 1][1], RGB[i - 1][2]), + g + min(RGB[i - 1][0], RGB[i - 1][2]), + b + min(RGB[i - 1][0], RGB[i - 1][1])]) + +print(min(RGB[N - 1])) From d6d294b43852008774328e18d67e73cbe1cc98f6 Mon Sep 17 00:00:00 2001 From: bellaria19 <52782842+bellaria19@users.noreply.github.com> Date: Fri, 10 May 2024 00:15:16 +0900 Subject: [PATCH 10/10] =?UTF-8?q?1013=EB=B2=88=20-=20Contact?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 201902738/1013.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 201902738/1013.py diff --git a/201902738/1013.py b/201902738/1013.py new file mode 100644 index 0000000..086117c --- /dev/null +++ b/201902738/1013.py @@ -0,0 +1,11 @@ +import sys, re + +pattern = r'((100+1+)|(01))+' + +n = int(sys.stdin.readline()) +for _ in range(n): + s = sys.stdin.readline().strip() + if re.fullmatch(pattern, s): + print("YES") + else: + print("NO") \ No newline at end of file