From 983db0d7a47aad7905a3d03780f4adefc3b2d663 Mon Sep 17 00:00:00 2001 From: Jiyun Kim Date: Wed, 12 Apr 2023 16:18:23 +0900 Subject: [PATCH 1/3] =?UTF-8?q?#2=20:=201978=5F=EC=86=8C=EC=88=98=20?= =?UTF-8?q?=EC=B0=BE=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4\354\210\230 \354\260\276\352\270\260.py" | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 "\354\235\264\355\213\260\354\247\200\354\234\244/1978_\354\206\214\354\210\230 \354\260\276\352\270\260.py" diff --git "a/\354\235\264\355\213\260\354\247\200\354\234\244/1978_\354\206\214\354\210\230 \354\260\276\352\270\260.py" "b/\354\235\264\355\213\260\354\247\200\354\234\244/1978_\354\206\214\354\210\230 \354\260\276\352\270\260.py" new file mode 100644 index 0000000..4aefe48 --- /dev/null +++ "b/\354\235\264\355\213\260\354\247\200\354\234\244/1978_\354\206\214\354\210\230 \354\260\276\352\270\260.py" @@ -0,0 +1,19 @@ +### 소수의 개수 찾기 +n = int(input()) # 입력받을 숫자 갯수 + +nums = list(map(int, input().split())) # 공백으로 숫자 구분 +# 입력받은 n개의 숫자 ex: [1, 3, 5, 7] + +prime_cnt=0 #소수 갯수 +isPrime = True #소수 여부 + +for i in nums: + if i == 1: + continue + for j in range(2, i): # nums에 있는 숫자 i를 2부터 i-1까지 나눔 + if i % j == 0: # 나누어떨어지면 + isPrime = False # 소수 아님 + if isPrime == True: # 소수이면 + prime_cnt += 1 # 소수 갯수+1 +print(prime_cnt) + From ddf1e640aeeb1711843a69aea9b41e29b4fe9099 Mon Sep 17 00:00:00 2001 From: Jiyun Kim Date: Wed, 12 Apr 2023 16:59:30 +0900 Subject: [PATCH 2/3] =?UTF-8?q?#2=20:=2015650=5FN=EA=B3=BC=20M(2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../15650_N\352\263\274 M(2).py" | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 "\354\235\264\355\213\260\354\247\200\354\234\244/15650_N\352\263\274 M(2).py" diff --git "a/\354\235\264\355\213\260\354\247\200\354\234\244/15650_N\352\263\274 M(2).py" "b/\354\235\264\355\213\260\354\247\200\354\234\244/15650_N\352\263\274 M(2).py" new file mode 100644 index 0000000..ef55bd5 --- /dev/null +++ "b/\354\235\264\355\213\260\354\247\200\354\234\244/15650_N\352\263\274 M(2).py" @@ -0,0 +1,10 @@ +import itertools +n, m = map(int, input().split()) + +nums = [ i for i in range(1, n+1)] #1~n까지 nums에 넣기 + +arr = itertools.combinations(nums, m) #중복 제외, 순서 상관없는 조합 만들기 +for i in arr: + for j in i: + print(j, end=' ') + print() \ No newline at end of file From 000f5872ce323194ac3a577c778fa4e0514e9a4e Mon Sep 17 00:00:00 2001 From: Jiyun Kim Date: Thu, 13 Apr 2023 00:47:46 +0900 Subject: [PATCH 3/3] =?UTF-8?q?#2=20:=201978=5F=EC=86=8C=EC=88=98=20?= =?UTF-8?q?=EC=B0=BE=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../1978_\354\206\214\354\210\230 \354\260\276\352\270\260.py" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/\354\235\264\355\213\260\354\247\200\354\234\244/1978_\354\206\214\354\210\230 \354\260\276\352\270\260.py" "b/\354\235\264\355\213\260\354\247\200\354\234\244/1978_\354\206\214\354\210\230 \354\260\276\352\270\260.py" index 4aefe48..b0cc742 100644 --- "a/\354\235\264\355\213\260\354\247\200\354\234\244/1978_\354\206\214\354\210\230 \354\260\276\352\270\260.py" +++ "b/\354\235\264\355\213\260\354\247\200\354\234\244/1978_\354\206\214\354\210\230 \354\260\276\352\270\260.py" @@ -5,9 +5,9 @@ # 입력받은 n개의 숫자 ex: [1, 3, 5, 7] prime_cnt=0 #소수 갯수 -isPrime = True #소수 여부 for i in nums: + isPrime = True #소수 여부 if i == 1: continue for j in range(2, i): # nums에 있는 숫자 i를 2부터 i-1까지 나눔