From a50bbf7c1f0c6ee9c5fd3edfd1e9ab60e4ec8a81 Mon Sep 17 00:00:00 2001 From: yenru0 Date: Thu, 6 Aug 2020 19:24:17 +0900 Subject: [PATCH] =?UTF-8?q?=EC=86=8C=EC=88=98=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=ED=84=B8=EC=96=B4=EA=B0=80=EA=B8=B0=209020=20=EA=B3=A8?= =?UTF-8?q?=EB=93=9C=EB=B0=94=ED=9D=90=20=EC=A0=9C=EC=99=B8,=20=EC=95=84?= =?UTF-8?q?=EB=A7=88=20=EB=8C=80=EC=9E=85=20=EC=97=AC=EB=9F=AC=EB=B2=88=20?= =?UTF-8?q?=ED=95=B4=EC=84=9C=20=EC=98=B3=EC=9D=80=EA=B1=B0=20=ED=95=98?= =?UTF-8?q?=EB=A9=B4=20=EB=90=A0=EB=93=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zeta_python/9020.py | 6 ++++++ zeta_python/completed/1929.py | 16 ++++++++++++++++ zeta_python/completed/2581.py | 24 ++++++++++++++++++++++++ zeta_python/completed/4948.py | 28 ++++++++++++++++++++++++++++ 4 files changed, 74 insertions(+) create mode 100644 zeta_python/9020.py create mode 100644 zeta_python/completed/1929.py create mode 100644 zeta_python/completed/2581.py create mode 100644 zeta_python/completed/4948.py diff --git a/zeta_python/9020.py b/zeta_python/9020.py new file mode 100644 index 0000000..68cde05 --- /dev/null +++ b/zeta_python/9020.py @@ -0,0 +1,6 @@ +N = int(input() +P = [] +last = 2 +for _ in range(N): + + # 골듭흐 파티션 diff --git a/zeta_python/completed/1929.py b/zeta_python/completed/1929.py new file mode 100644 index 0000000..7f5f2a0 --- /dev/null +++ b/zeta_python/completed/1929.py @@ -0,0 +1,16 @@ +M, N = map(int, input().split()) +P = [] + +for i in range(2, N+1): + for p in P: + if i % p == 0: + break + elif p ** 2 > i: + if i >= M: + print(i) + P.append(i) + break + else: + if i >= M: + print(i) + P.append(i) diff --git a/zeta_python/completed/2581.py b/zeta_python/completed/2581.py new file mode 100644 index 0000000..34fbe13 --- /dev/null +++ b/zeta_python/completed/2581.py @@ -0,0 +1,24 @@ +M, N = int(input()), int(input()) +P = [] +MP = [] + + +for i in range(2, N+1): + for p in P: + if i % p == 0: + break + elif p ** 2 > i: + if i >= M: + MP.append(i) + P.append(i) + break + else: + if i >= M: + MP.append(i) + P.append(i) + +if MP: + print(sum(MP)) + print(MP[0]) +else: + print(-1) diff --git a/zeta_python/completed/4948.py b/zeta_python/completed/4948.py new file mode 100644 index 0000000..7f7eaf9 --- /dev/null +++ b/zeta_python/completed/4948.py @@ -0,0 +1,28 @@ +N = int(input()) +P = [] +last = 1 +while N != 0: + if 2*N > last: + if last == 1: + last = 2 + for i in range(last, 2*N+1): + for p in P: + if i % p == 0: + break + elif p ** 2 > i: + P.append(i) + break + else: + P.append(i) + c = 0 + for p in P: + if N < p <= 2 * N: + c += 1 + elif p > 2*N: + break + if last < 2*N: + last = 2*N + + print(c) + + N = int(input())