Skip to content

Commit

Permalink
[#3] 백준 단계별 문제
Browse files Browse the repository at this point in the history
  • Loading branch information
hyesuuou committed Dec 25, 2021
1 parent e7a2186 commit 9d92395
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Boj/기본 수학2/1085.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
x, y, w, h = map(int, input().split())

list = [x, y, abs(h-y), abs(w-x)]
print(min(list))

22 changes: 22 additions & 0 deletions Boj/기본 수학2/3009.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
xList = []
yList = []
for i in range(3):
x, y = map(int, input().split())
xList.append(x)
yList.append(y)


if xList.count(xList[0]) == 1:
print(xList[0], end=" ")
elif xList.count(xList[1]) == 1:
print(xList[1], end = " ")
elif xList.count(xList[2]) == 1:
print(xList[2], end = " ")


if yList.count(yList[0]) == 1:
print(yList[0], end=" ")
elif yList.count(yList[1]) == 1:
print(yList[1], end = " ")
elif yList.count(yList[2]) == 1:
print(yList[2], end = " ")
27 changes: 27 additions & 0 deletions Boj/기본 수학2/4948.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
n = int(input())
list = []
for i in range(0, 123456*2+1):
if i == 1 or i == 0:
list.append(0)
else:
list.append(i)

for i in range(2, len(list)):
if list[i] == 0:
continue
else:
j = 2
while i*j < len(list):
list[i*j] = 0
j = j+1

while True:
res = 0
for i in range(n+1, 2 * n + 1):
if list[i] != 0:
res = res+1
print(res)
n = int(input())
if n == 0:
break

11 changes: 11 additions & 0 deletions Boj/재귀/10870.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
n = int(input())

def d(a):
if a == 0:
return 0
elif a == 1:
return 1
else:
return d(a-1) + d(a-2)

print(d(n))
5 changes: 5 additions & 0 deletions Boj/재귀/10872.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
n = int(input())
res = 1
for i in range(1, n+1):
res = res * i
print(res)

0 comments on commit 9d92395

Please sign in to comment.