K

@kimjuha19

듣보잡

Python
4 months ago
nohear = ["ohhenrie", "charlie", "baesangwook"] nosee = ["obama", "baesangwook"] common = set(nohear).intersection(nosee) common_sorted = sorted(common) p = len(common_sorted) print(f"{p}명, {common_sorted}")

AC

Python
4 months ago
num = [1,2,3,4] a = "RDD" for i in range(len(a)): if a[i] == "R": num = num[::-1] elif a[i] == "D": num.remove(num[0]) print(num)

나무 자르기

Python
4 months ago
tree = [20, 15, 10, 17] K = 7 left = 0 right = max(tree) answer = 0 while left <= right: mid = (left + right) // 2

문서 편집기 '찾아 바꾸기'

Python
4 months ago
length = "mirkovC4nizCC44" boom = "C4" while boom in length: length = length.replace(boom, "") print(length)

주식 투자 시뮬레이션

Python
4 months ago
prices = [1, 2, 3, 2, 3] n = len(prices) answer = [] for i in range(n): count = 0 for j in range(i+1, n): if prices[j] >= prices[i]: count += 1 else:

무인도 캠핑 장비 가방

Python
4 months ago
box = [70, 50, 80, 50] L = 100 box.sort() light = 0 heavy = len(box) - 1 boat = 0 while light <= heavy:

신선 식품 배송 구간

Python
4 months ago
box = [2, 5, 1, 3, 4, 7, 9] K = 15 left = 0 current_sum = 0 count = 0 for right in range(len(box)): current_sum += box[right]

전시장 조명 관리

Python
4 months ago
arr = [10,8,13,9,15] answer = [] for i in range(len(arr)): for j in range(i+1,len(arr)): if arr[i] < arr[j]: answer.append(j+1) break else: answer.append(0)

공항 보안 검색대 대기

Python
4 months ago
s = "ABCBCA" t = "BC" stack = [] len_t = len(t) for c in s: stack.append(c) if len(stack) >= len_t and "".join(stack[-len_t:]) == t:

인테리어 타일 깔기

Python
4 months ago
N = 3 MOD = 10007 dp = [0] * (N + 1) dp[0] = 1 dp[1] = 1 for i in range(2, N + 1): dp[i] = (dp[i - 1] + 2 * dp[i - 2]) % MOD

도서관 책장 높이 맞추기

Python
4 months ago
books = [20, 15, 10, 17] K = 7 left = 0 right = max(books) answer = 0 while left <= right: mid = (left + right) // 2

마라톤 구간 합 관리

Python
4 months ago
target = [1, 2, 3, 4, 2, 5, 3] M = 10 water = 0 count = 0 min = 0 for i in range(len(target)): count += 1 water += target[i] if water >= M:

물류 창고 택배 적재

Python
4 months ago
box = [10, 7, 8, 11] answer = [] for i in range(len(box)): for j in range(i+1,len(box)): if box[j] > box[i]: answer.append(j + 1) break else: answer.append(0)

트럭 적재량 시뮬레이션

Python
4 months ago
class Package: def __init__(self, name, weight): self.name = name self.weight = weight class Truck: def __init__(self, max_weight=1000): self.max_weight = max_weight self.current_weight = 0 self.packa

쿠폰 중복 적용 제한 로직

Python
4 months ago
class Coupon: def __init__(self, name, ctype, value): self.name = name self.ctype = ctype self.value = value class Order: def __init__(self, total_price): self.total_price = total_price self.coupons =

상속을 활용한 포인트 적립

Python
4 months ago
class Customer: def __init__(self, name): self.name = name self.points = 0 def pay(self, amount): self.points += int(amount * 0.01) class VIPCustomer(Customer): def pay(self, amount):

좌석 등급별 수하물 규정

Python
4 months ago
class Ticket: def __init__(self, passenger_name, seat_class, baggage_kg): self.passenger_name = passenger_name self.seat_class = seat_class self.baggage_kg = baggage_kg def calculate_extra_fee(self): if self.

누적 방문 포인트 및 등급제

Python
4 months ago
class Member: def __init__(self, name, visits): self.name = name self.visits = visits def grade_and_discount(self): if self.visits >= 50: return "골드", 0.2 elif self.visits >= 30: retur

환자 우선순위 분류 시스템

Python
4 months ago
import heapq import itertools class Patient: _counter = itertools.count() def __init__(self, name, pain_level): self.name = name self.pain_level = pain_level self.arrival_order = next(Patient._counter)

가전 기기 에너지 모니터

Python
4 months ago
class Device: def __init__(self, name, power_watt): self.name = name self.power_watt = power_watt self.hours = 0 def set_hours(self, hours): self.hours = hours def energy_kwh(self):