K

@kimjuha19

평행하는 선분의 수

Python
4 months ago
n = int(input()) coordinate = [] count = 0 for i in range(n): coordinate.append(list(map(int, input().split()))) for i in range(n): for j in range(i + 1, n): if coordinate[i][0] == coordinate[j][0]:

무인 주문 및 거스름돈 시스템

Python
5 months ago
class Menu: def __init__(self, name, price): self.name = name self.price = price class Kiosk: def __init__(self, menus): self.menus = menus self.cart = []

차종별 구역 및 요금 차등화

Python
5 months ago
class Car: def __init__(self, name, fuel, time): self.name = name self.fuel = fuel self.time = time class ParkingLot: def __init__(self): self.electric_zone = ["B-1", "B-2"] self.compact_zone = ["C-1"

재고 연동 및 운송장 발급 시뮬레이션

Python
5 months ago
import random class Warehouse: def __init__(self): self.stock = {"마우스": 2} def check_stock(self, item, quantity): if item in self.stock and self.stock[item] >= quantity: self.stock[item] -= quantity

로또

Python
5 months ago
import random count = 0 my_nums = [33, 42, 40, 12, 34, 4] lotto_numbers = random.sample(range(1, 46), 6) for i in range(6): if my_nums[i] == lotto_numbers[i]: count += 1

파티 사냥 및 역할별 스킬 구현

Python
5 months ago
class Hero: def __init__(self, monster_hp, hp, damege, area,mana): self.monster_hp = monster_hp self.hp = hp self.damege = damege self.area = area self.mana = mana def warrior(self): self.mon

알파벳 찾기

Python
5 months ago
import string s = "baekjoon" for alphabet in string.ascii_lowercase: print(s.find(alphabet), end=' ')

일곱 난쟁이

Python
5 months ago
heights = [20, 7, 23, 19, 10, 15, 25, 8, 13] total = sum(heights) result = [] for i in range(9): for j in range(i + 1, 9): if total - heights[i] - heights[j] == 100: for k in range(9): if k != i and k != j:

소수 팰린드롬

Python
5 months ago
n = 31 num = n answer = 0 while True: answer = 0 if num >= n: answer += 1

단어 정렬

Python
5 months ago
words = ['but', 'i', 'wont', 'i'] words = list(set(words)) words.sort(key=lambda x: (len(x), x)) print(words)

피보나치 수열

Python
5 months ago
n = 10 dp = [0] * (n+1) dp[0], dp[1] = 0, 1 for i in range(2,n+1): dp[i] = dp[i-2] + dp[i-1] print(max(dp))

숫자 카드 카운팅

Python
5 months ago
from collections import Counter find = [1, 4] cards = [1, 2, 1, 3, 2] answer = [0, 0] counter = Counter(cards) for i in range(0, len(find)): if find[i] in counter:

괄호의 짝

Python
5 months ago
side = "(())()" stack = [] for i in range(len(side)): if side[i] == '(': stack.append('(') else: del stack[0] if len(stack) == 0:

요세푸스 문제

Python
5 months ago
from collections import deque N = 7 K = 3 test = [] answer = [] for i in range(1, N+1): test.append(i)

요세푸스 문제

Python
5 months ago
from collections import deque N = 7 K = 3 test = [] answer = [] for i in range(1, N + 1): test.append(i)

설탕 배달

Python
5 months ago
N = 18 F = 5 T = 3 bags = 0 while N >= 0: if N % F == 0: bags += N // F break N -= T

달팽이의 탈출

Python
5 months ago
height = 5 up = 2 down = 1 total = 0 day = 0 while total < height: day += 1 total += up if total >= height:

도서 주문 및 재고 자동 연동

C++
5 months ago
#include <iostream> #include <string> using namespace std; class BookStore { private: string title; int inventory; int total_sales;

복리 적금 및 이자 시뮬레이션

C++
5 months ago
#include <iostream> #include <string> using namespace std; class SavingsAccount { private: string owner; double balance; double annual_rate;

도서관 대출 시스템

C++
5 months ago
#include <iostream> #include <string> using namespace std; class Member { protected: string name; int limit; int borrowed;