From b903155309bd092603808a3a4a5b3eb6e4822a2b Mon Sep 17 00:00:00 2001 From: SUMIN Date: Sat, 11 Apr 2026 11:46:27 +0900 Subject: [PATCH] =?UTF-8?q?Upload=20files=20to=20"=EB=B0=B1=EC=A4=80"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 백준/0209_01.py | 24 ++++++++++++++++++++++++ 백준/0209_01_01.py | 28 ++++++++++++++++++++++++++++ 백준/1016.Py | 23 +++++++++++++++++++++++ 백준/222.cc | Bin 0 -> 1024 bytes 백준/223.cc | Bin 0 -> 1024 bytes 5 files changed, 75 insertions(+) create mode 100644 백준/0209_01.py create mode 100644 백준/0209_01_01.py create mode 100644 백준/1016.Py create mode 100644 백준/222.cc create mode 100644 백준/223.cc diff --git a/백준/0209_01.py b/백준/0209_01.py new file mode 100644 index 0000000..b8f4416 --- /dev/null +++ b/백준/0209_01.py @@ -0,0 +1,24 @@ +from collections import deque + +queue = deque +queue.popleft() +def solution(clothes): + arr=[] + temp=2 + answer = 1 + clothes.sort(key = lambda x:(x[1], x[0])) + maxvalue = len(clothes) + for i in range(0, maxvalue-1): + if (clothes[i][1] != clothes[i+1][1]): + arr.append(temp) + temp=2 + else: + temp+=1 + arr.append(temp) + for j in arr: + answer *= j + answer -= 1 + queue + return answer + +print(solution([["yellow_hat", "headgear"], ["blue_sunglasses", "eyewear"], ["green_turban", "headgear"]])) \ No newline at end of file diff --git a/백준/0209_01_01.py b/백준/0209_01_01.py new file mode 100644 index 0000000..3486c52 --- /dev/null +++ b/백준/0209_01_01.py @@ -0,0 +1,28 @@ +from collections import deque + +def solution(bridge_length, weight, truck_weights): + queue = deque() + index = 0 + seconds = 0 + maxvalue=len(truck_weights)-1 + now_weight=0 + for _ in range(bridge_length): + queue.append(0) + while True: + seconds+=1 + now_weight-=queue.popleft() + if(now_weight+truck_weights[index] <= weight): + queue.append(truck_weights[index]) + now_weight+=truck_weights[index] + if(index==maxvalue): + seconds+=bridge_length + break + else: + index+=1 + else: + queue.append(0) + if(now_weight == 0): + break + return seconds + +print(solution(2, 10, [7,4,5,6])) \ No newline at end of file diff --git a/백준/1016.Py b/백준/1016.Py new file mode 100644 index 0000000..6b17fbb --- /dev/null +++ b/백준/1016.Py @@ -0,0 +1,23 @@ + import math + import sys + + input = sys.stdin.readline + + min, max = map(int, input().split()) + + arr = [False] * (max-min+1) + + for i in range(2, int(math.sqrt(max)+1)): + pow = i * i + start_index = int(min / pow) # 제곱수가 아닌 수 -> 제곱수는 무언가를 곱해서 만드는 수 ? 인걸로 이해했는데 + if min % pow!=0: + start_index += 1 + for j in range(start_index, int(max/pow)+1): + arr[int((j*pow) - min)] = True + + count = 0 + for i in range(0, max-min+1): + if arr[i] == False: + count += 1 + + print(count) diff --git a/백준/222.cc b/백준/222.cc new file mode 100644 index 0000000000000000000000000000000000000000..06d7405020018ddf3cacee90fd4af10487da3d20 GIT binary patch literal 1024 ScmZQz7zLvtFd70QH3R?z00031 literal 0 HcmV?d00001 diff --git a/백준/223.cc b/백준/223.cc new file mode 100644 index 0000000000000000000000000000000000000000..06d7405020018ddf3cacee90fd4af10487da3d20 GIT binary patch literal 1024 ScmZQz7zLvtFd70QH3R?z00031 literal 0 HcmV?d00001