Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions request_test/solution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
print("test")
print("12345")
10 changes: 10 additions & 0 deletions week1/10870피보나치수5/solution.py
Original file line number Diff line number Diff line change
@@ -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))
10 changes: 10 additions & 0 deletions week1/1110더하기사이클/solution.py
Original file line number Diff line number Diff line change
@@ -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)
21 changes: 21 additions & 0 deletions week1/17910jointAttack/solution.py
Original file line number Diff line number Diff line change
@@ -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]))
16 changes: 16 additions & 0 deletions week1/1977완전제곱수/solution.py
Original file line number Diff line number Diff line change
@@ -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)
11 changes: 11 additions & 0 deletions week1/9012괄호/solution.py
Original file line number Diff line number Diff line change
@@ -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))