K

@kimjuha19

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

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;

자율주행 택시 구간별 요금제

C++
5 months ago
#include <iostream> #include <string> using namespace std; class AutoTaxi { private: string car_number; int location; string mode;

단계별 인증 및 계정 잠금 시스템

C++
5 months ago
#include <iostream> #include <string> using namespace std; class SecureLogin { private: string ID; string password; int fail_count;

수 이어 쓰기 1

Python
5 months ago
N = 120 length = 1 start = 1 answer = 0 while start <= N: end = start * 10 - 1 if end > N: end = N

연속합

Python
5 months ago
arr = [10, -4, 3, 1, 5, 6, -35, 12, 21, -1] current_sum = arr[0] max_sum = arr[0] for i in range(1, len(arr)): current_sum = max(arr[i], current_sum + arr[i]) max_sum = max(max_sum, current_sum) print(max_sum)

방 번호

Python
5 months ago
N = "9999" count = [0] * 10 for ch in N: count[int(ch)] += 1 six_nine = count[6] + count[9] count[6] = (six_nine + 1) // 2 count[9] = 0

분해합

Python
5 months ago
N = 216 result = 0 for M in range(1, N + 1): digit_sum = 0 temp = M while temp > 0: digit_sum += temp % 10 temp //= 10

쇠막대기

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

연속합

Python
5 months ago
arr = [10, -4, 3, 1, 5, 6, -35, 12, 21, -1] current_sum = arr[0] max_sum = arr[0] for i in range(1, len(arr)): current_sum = max(arr[i], current_sum + arr[i]) max_sum = max(max_sum, current_sum) print(max_sum)

카드2

Python
5 months ago
from collections import deque N = 6 cards = deque(range(1, N + 1)) while len(cards) > 1: cards.popleft() cards.append(cards.popleft()) print(cards[0])

색종이

Python
5 months ago
paper = [(3, 7), (15, 7), (5, 2)] answer = set() for x,y in paper: for i in range(x,x+10): for j in range(y,y+10): answer.add((i,j)) print(len(answer))

호떡가게 운영하기

Python
5 months ago
k = 5 n = 300 time = 0 made = 0 sold = 0 while time <= n: time += 1

연예인 인기도

Python
5 months ago
popularity = [5,3,5,4,5] city = [1,0,2,1,2] target = 5 answer = [0,0,0] for i in range(len(popularity)): if popularity[i] == target: answer[city[i]] += 1

원숭이 나무타기

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

보물

Python
5 months ago
A = [1, 1, 1, 6, 0] B = [2, 7, 8, 3, 1] A.sort() B.sort(reverse=True) result = 0 for i in range(len(A)): result += A[i] * B[i]

등수 구하기

Python
5 months ago
scores = [100, 90, 80] new_score = 90 limit = 10 rank = 1 for s in scores: if s > new_score: rank += 1 if rank > limit:

제로

Python
5 months ago
numbers = [1, 3, 5, 4, 0, 0, 7, 0, 0,0, 6] stack = [] for n in numbers: if n == 0: stack.pop() else: stack.append(n)

단어 정렬

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

소수 구하기

Python
5 months ago
M = 3 N = 16 prime = [True] * (N + 1) prime[0] = prime[1] = False for i in range(2, int(N ** 0.5) + 1): if prime[i]: for j in range(i * i, N + 1, i): prime[j] = False