diff --git a/request_test/solution.py b/request_test/solution.py index e69de29..d27d3ba 100644 --- a/request_test/solution.py +++ b/request_test/solution.py @@ -0,0 +1,2 @@ +print("test") +print("12345") \ No newline at end of file diff --git "a/week1/10870\355\224\274\353\263\264\353\202\230\354\271\230\354\210\2305/solution.py" "b/week1/10870\355\224\274\353\263\264\353\202\230\354\271\230\354\210\2305/solution.py" index e69de29..5668508 100644 --- "a/week1/10870\355\224\274\353\263\264\353\202\230\354\271\230\354\210\2305/solution.py" +++ "b/week1/10870\355\224\274\353\263\264\353\202\230\354\271\230\354\210\2305/solution.py" @@ -0,0 +1,10 @@ +def F(n): + if n == 0: + return 0 + elif n == 1: + return 1 + else: + return F(n-1) + F(n-2) + +n = int(input()) +print(F(n)) \ No newline at end of file diff --git "a/week1/1110\353\215\224\355\225\230\352\270\260\354\202\254\354\235\264\355\201\264/solution.py" "b/week1/1110\353\215\224\355\225\230\352\270\260\354\202\254\354\235\264\355\201\264/solution.py" index e69de29..b735c07 100644 --- "a/week1/1110\353\215\224\355\225\230\352\270\260\354\202\254\354\235\264\355\201\264/solution.py" +++ "b/week1/1110\353\215\224\355\225\230\352\270\260\354\202\254\354\235\264\355\201\264/solution.py" @@ -0,0 +1,10 @@ +originalNumber = int(input()) +count = 0 +newNumber = originalNumber # 첫 시작 숫자가 입력숫자 +# //10 십의 자리 , %10 일의 자리 +while True: + count += 1 + newNumber = (newNumber%10)*10+(newNumber//10+newNumber%10)%10 + if originalNumber == newNumber: + break +print(count) \ No newline at end of file diff --git a/week1/17910jointAttack/solution.py b/week1/17910jointAttack/solution.py index e69de29..5921e3e 100644 --- a/week1/17910jointAttack/solution.py +++ b/week1/17910jointAttack/solution.py @@ -0,0 +1,21 @@ +from fractions import Fraction + +def add(left, right): + x_list.pop() + # print("pop된 x_list:", x_list) + if len(x_list) == 1: + left = x_list[-1] + right = Fraction(1, right) + # print("1left:", left, "1right:", right) + return Fraction(left + right) + else: + # print("2left:", left, "2right:", right) + # print("next left:", x_list[-2], "next right:", Fraction(left + Fraction(1, right))) + return add(x_list[-2], left + Fraction(1, right)) + +x = int(input()) +x_list = list(map(int, input().split())) +if len(x_list) == 1: + print(x_list[0]) +else: + print(add(x_list[-2], x_list[-1])) \ No newline at end of file diff --git "a/week1/1977\354\231\204\354\240\204\354\240\234\352\263\261\354\210\230/solution.py" "b/week1/1977\354\231\204\354\240\204\354\240\234\352\263\261\354\210\230/solution.py" index e69de29..5e11106 100644 --- "a/week1/1977\354\231\204\354\240\204\354\240\234\352\263\261\354\210\230/solution.py" +++ "b/week1/1977\354\231\204\354\240\204\354\240\234\352\263\261\354\210\230/solution.py" @@ -0,0 +1,16 @@ +import math + +M = int(input()) +N = int(input()) +nums = [] + +for i in range(M, N + 1): + if math.sqrt(i) == int(math.sqrt(i)): + # print("correct:", math.sqrt(i), int(math. sqrt(i))) + nums.append(i) # 완전제곱수를 리스트에 저장 + # print("incorrect:", math.sqrt(i), int(math.sqrt(i))) +if nums: + print(sum(nums)) + print(min(nums)) +else: + print(-1) \ No newline at end of file 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..ad23950 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,11 @@ +def isRight(s): + while True: + s = s.replace("()", "") + if "()" not in s: + if s: return "NO" + else: return "YES" + +T = int(input()) +for i in range(T): + strings = input() + print(isRight(strings)) \ No newline at end of file