From 297a5129f50934a4b66c79c764ab3cefe149804d Mon Sep 17 00:00:00 2001 From: Reoyl Date: Wed, 20 Apr 2022 22:05:57 +0900 Subject: [PATCH 1/4] =?UTF-8?q?17910=20JointAttack=20=EC=A0=95=EC=9E=AC?= =?UTF-8?q?=ED=99=8D=20-=20=EC=96=B4=EB=94=94=EA=B0=80=20=ED=8B=80?= =?UTF-8?q?=EB=A6=B0=20=EA=B1=B8=EA=B9=8C=EC=9A=94=E3=85=9C=E3=85=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- week1/17910jointAttack/solution.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/week1/17910jointAttack/solution.py b/week1/17910jointAttack/solution.py index e69de29..5b0a18e 100644 --- a/week1/17910jointAttack/solution.py +++ b/week1/17910jointAttack/solution.py @@ -0,0 +1,10 @@ +def jointAttack(array): + if (len(array)<=1): + return array.pop() + + return array.pop(0) + 1 / (jointAttack(array)) + +N = int(input()) +array = [int(_) for _ in input().split()] + +print(jointAttack(array)) \ No newline at end of file From 0ef2b38959840e38911e3a437de817655d35f386 Mon Sep 17 00:00:00 2001 From: Reoyl Date: Thu, 21 Apr 2022 09:30:49 +0900 Subject: [PATCH 2/4] 1934 Least Common Multiplier Solved by using Greatest Common Divisor --- .../solution.py" | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git "a/week1/1934\354\265\234\354\206\214\352\263\265\353\260\260\354\210\230/solution.py" "b/week1/1934\354\265\234\354\206\214\352\263\265\353\260\260\354\210\230/solution.py" index e69de29..c636517 100644 --- "a/week1/1934\354\265\234\354\206\214\352\263\265\353\260\260\354\210\230/solution.py" +++ "b/week1/1934\354\265\234\354\206\214\352\263\265\353\260\260\354\210\230/solution.py" @@ -0,0 +1,12 @@ +def gcd(arr): + while arr[1]>0: + arr[0], arr[1] = arr[1], arr[0]%arr[1] + return arr[0] + +def lcm(arr): + return arr[0]*arr[1] // gcd(arr) + +test_case = [list(map(int, input().split())) for _ in range(int(input()))] + +for case in test_case: + print(lcm(case)) \ No newline at end of file From 9745b208a3583414466168011ae4cd2e07874ce3 Mon Sep 17 00:00:00 2001 From: Reoyl Date: Thu, 21 Apr 2022 09:34:56 +0900 Subject: [PATCH 3/4] nothing on master --- week1/17910jointAttack/solution.py | 10 ---------- .../solution.py" | 12 ------------ 2 files changed, 22 deletions(-) diff --git a/week1/17910jointAttack/solution.py b/week1/17910jointAttack/solution.py index 5b0a18e..e69de29 100644 --- a/week1/17910jointAttack/solution.py +++ b/week1/17910jointAttack/solution.py @@ -1,10 +0,0 @@ -def jointAttack(array): - if (len(array)<=1): - return array.pop() - - return array.pop(0) + 1 / (jointAttack(array)) - -N = int(input()) -array = [int(_) for _ in input().split()] - -print(jointAttack(array)) \ No newline at end of file diff --git "a/week1/1934\354\265\234\354\206\214\352\263\265\353\260\260\354\210\230/solution.py" "b/week1/1934\354\265\234\354\206\214\352\263\265\353\260\260\354\210\230/solution.py" index c636517..e69de29 100644 --- "a/week1/1934\354\265\234\354\206\214\352\263\265\353\260\260\354\210\230/solution.py" +++ "b/week1/1934\354\265\234\354\206\214\352\263\265\353\260\260\354\210\230/solution.py" @@ -1,12 +0,0 @@ -def gcd(arr): - while arr[1]>0: - arr[0], arr[1] = arr[1], arr[0]%arr[1] - return arr[0] - -def lcm(arr): - return arr[0]*arr[1] // gcd(arr) - -test_case = [list(map(int, input().split())) for _ in range(int(input()))] - -for case in test_case: - print(lcm(case)) \ No newline at end of file From 438a302c982cc8898785e8d354b86c2fc3eb69c0 Mon Sep 17 00:00:00 2001 From: Reoyl Date: Thu, 28 Apr 2022 08:37:58 +0900 Subject: [PATCH 4/4] =?UTF-8?q?9012=20=EA=B4=84=ED=98=B8=20-=20=ED=85=8C?= =?UTF-8?q?=ED=8A=B8=EB=A6=AC=EC=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../9012\352\264\204\355\230\270/solution.py" | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git "a/week1/9012\352\264\204\355\230\270/solution.py" "b/week1/9012\352\264\204\355\230\270/solution.py" index e69de29..716894b 100644 --- "a/week1/9012\352\264\204\355\230\270/solution.py" +++ "b/week1/9012\352\264\204\355\230\270/solution.py" @@ -0,0 +1,23 @@ +n = int(input()) +vps = [] + +for _ in range(n): + ps = input() + tetris = [] + + for parenthesis in ps: + if tetris: + if parenthesis==tetris[-1]: + tetris.append(parenthesis) + else: + if parenthesis==')': + tetris.pop() + else: + tetris.append(parenthesis) + + if tetris: + vps.append('NO') + else: + vps.append('YES') + +print(*vps, end='\n') \ No newline at end of file