From 9d92395cfe44b1aaa0266018634f73bf3e31aed6 Mon Sep 17 00:00:00 2001 From: hyesuuou <68391767+hyesuuou@users.noreply.github.com> Date: Sun, 26 Dec 2021 02:05:37 +0900 Subject: [PATCH] =?UTF-8?q?[#3]=20=EB=B0=B1=EC=A4=80=20=EB=8B=A8=EA=B3=84?= =?UTF-8?q?=EB=B3=84=20=EB=AC=B8=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../1085.py" | 5 ++++ .../3009.py" | 22 +++++++++++++++ .../4948.py" | 27 +++++++++++++++++++ "Boj/\354\236\254\352\267\200/10870.py" | 11 ++++++++ "Boj/\354\236\254\352\267\200/10872.py" | 5 ++++ 5 files changed, 70 insertions(+) create mode 100644 "Boj/\352\270\260\353\263\270 \354\210\230\355\225\2312/1085.py" create mode 100644 "Boj/\352\270\260\353\263\270 \354\210\230\355\225\2312/3009.py" create mode 100644 "Boj/\352\270\260\353\263\270 \354\210\230\355\225\2312/4948.py" create mode 100644 "Boj/\354\236\254\352\267\200/10870.py" create mode 100644 "Boj/\354\236\254\352\267\200/10872.py" diff --git "a/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2312/1085.py" "b/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2312/1085.py" new file mode 100644 index 0000000..b553844 --- /dev/null +++ "b/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2312/1085.py" @@ -0,0 +1,5 @@ +x, y, w, h = map(int, input().split()) + +list = [x, y, abs(h-y), abs(w-x)] +print(min(list)) + diff --git "a/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2312/3009.py" "b/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2312/3009.py" new file mode 100644 index 0000000..b38466c --- /dev/null +++ "b/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2312/3009.py" @@ -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 = " ") \ No newline at end of file diff --git "a/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2312/4948.py" "b/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2312/4948.py" new file mode 100644 index 0000000..2df5459 --- /dev/null +++ "b/Boj/\352\270\260\353\263\270 \354\210\230\355\225\2312/4948.py" @@ -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 + diff --git "a/Boj/\354\236\254\352\267\200/10870.py" "b/Boj/\354\236\254\352\267\200/10870.py" new file mode 100644 index 0000000..7824e49 --- /dev/null +++ "b/Boj/\354\236\254\352\267\200/10870.py" @@ -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)) \ No newline at end of file diff --git "a/Boj/\354\236\254\352\267\200/10872.py" "b/Boj/\354\236\254\352\267\200/10872.py" new file mode 100644 index 0000000..0367e70 --- /dev/null +++ "b/Boj/\354\236\254\352\267\200/10872.py" @@ -0,0 +1,5 @@ +n = int(input()) +res = 1 +for i in range(1, n+1): + res = res * i +print(res) \ No newline at end of file